mirror of
https://github.com/deunix-educ/sourizz.git
synced 2026-11-25 04:39:43 +01:00
Fix the pointer freezes on Wayland: stop reopening /dev/input nodes every 3 s
Devices::rescan reopened every event node it did not keep (power button, audio jacks, video bus...) on each call. Opening a node takes 25-70 ms on the field-test laptop, so each rescan blocked the daemon for ~650 ms and the pointer froze for that long every 3 s while Sourizz was drawing. Rejected nodes are now remembered and only new ones are opened. Found with examples/layer_probe.rs, a bare layer-shell overlay with knobs that was extended one Sourizz component at a time until the stall reappeared. The README limitation about trails under KWin was wrong and is removed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -47,7 +47,7 @@ Adding a config option touches: `config.rs` (struct, `Default`, `sanitize`), `i1
|
||||
- **egui ids must be unique on screen.** Two `ComboBox`es sharing an id (e.g. both labelled "Style") act as one control and their popups close each other, so the lists could not be opened. `combo()` in `settings.rs` takes an explicit id — never derive it from the label. `examples/click_at.rs` drives the real settings window through XTEST for such checks (it refuses to click unless the pointer is over our own window).
|
||||
- **Raising an already-open settings window does not work under KWin.** Focus-stealing prevention turns another process's activation request (`ViewportCommand::Focus` after a `SIGUSR1`) into a blinking taskbar entry (`_NET_WM_STATE_DEMANDS_ATTENTION`), so a window buried under others stays buried. `Core::open_settings` therefore kills the old child and spawns a new one, which always maps on top. It is safe because the settings save as they change.
|
||||
- Process name `sourizz-settings` is truncated to 15 chars by the kernel: use `pgrep -x sourizz-setting`, and never `pgrep -f` from a shell whose own command line contains the pattern.
|
||||
- **KWin Wayland stalls whenever we draw (real hardware, Intel + NVIDIA laptop, KWin 6.3.6).** The pointer freezes ~0.5 s every 2-3 s as soon as anything is drawn, even the classic ring alone with `ring.pulse_speed = 0`. It does not happen with `enabled = off` (script and D-Bus feed still running), without Sourizz, or when dragging a window. An earlier "ring alone is fine" result was wrong: the config had changed between tests, so record the config md5 with each run. Measured and ruled out: our loop blocking (no iteration over 40 ms), buffer allocation (reusing buffers changed nothing), damage size (40-380 kpx per commit, unrelated to the stalls), the D-Bus pointer feed, waiting for frame callbacks (committing after 20 ms changed nothing), trail style (`dots`, `rainbow`), pointer speed, frame rate (`general.fps = 30`), continuous commits as such, NVIDIA runtime PM (stays `suspended`). KWin's main thread is not saturated (11-32 % of a core, never in `D` state) and its script kept delivering 100+ positions/s during the stalls, so the wait is probably on the GPU / page flip, with frame callbacks arriving 500-600 ms late. Not tried: a probe client with a variable surface size and rate (would show whether the 1920x1080 shm buffer matters), `KWIN_DRM_DEVICES`, position extrapolation for the ring lag. Documented as a known limitation in both READMEs.
|
||||
- **Never reopen `/dev/input/event*` nodes on a timer.** On the field-test laptop (Intel + NVIDIA, KDE Plasma 6.3.6 Wayland) opening and closing one node costs 25-70 ms, so the old `Devices::rescan` (every 3 s, reopening every node it did not keep: power button, audio jacks, video bus…) blocked the daemon for ~650 ms and froze the pointer for that long, every 3 s, as soon as anything was drawn. `Devices` now remembers rejected nodes (`skipped`) and only opens new ones. How it was found, worth reusing: `examples/layer_probe.rs` is a bare layer-shell overlay with knobs (`--size`, `--fps`, `--damage`, `--follow` for the KWin pointer script, `--seat`, `--evdev`, `--no-rescan`); adding Sourizz's pieces to it one at a time showed which one brought the stall back. Two traps: the "callback delay" I first measured was the time until *our* loop handled the callback, so it showed our own stall as if it were the compositor's; and a loop timer that omits a section (here the rescan, after `poll`) cannot see a stall in it. Record the config md5 with each run, since a changed config once made a test look clean.
|
||||
|
||||
## Testing Wayland without a Wayland session
|
||||
|
||||
|
||||
Reference in New Issue
Block a user