From 11cd112f5f8f82386215163f6791c4279ccd3b3f Mon Sep 17 00:00:00 2001 From: Denis Defolie Date: Fri, 30 Oct 2026 10:29:59 +0100 Subject: [PATCH] Document the KWin Wayland trail stall seen on real hardware Field test on KDE Plasma 6.3.6 (Intel + NVIDIA hybrid laptop): the pointer freezes for ~0.5 s every 2-3 s while a trail is drawn. Measurements ruled out our loop, buffer allocation, damage size, the D-Bus feed and callback waits. Record it as a known limitation in both READMEs and in CLAUDE.md, and update what was tested on Wayland. Co-Authored-By: Claude Sonnet 5.5 --- CLAUDE.md | 1 + README.fr.md | 4 +++- README.md | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 6c348c4..d5a078a 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -47,6 +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 with a trail (real hardware, Intel + NVIDIA laptop, KWin 6.3.6).** The pointer freezes ~0.5 s every 2-3 s while a trail is drawn; ring alone and idle daemon are fine. 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, stalls unrelated to it), the D-Bus pointer feed (75-140 positions/s, harmless), waiting for frame callbacks (committing after 20 ms changed nothing). Not tried: other trail styles, KWin on the Intel GPU only (`KWIN_DRM_DEVICES`), position extrapolation for the ring lag. Documented as a known limitation in both READMEs. ## Testing Wayland without a Wayland session diff --git a/README.fr.md b/README.fr.md index 8726813..1c056ff 100644 --- a/README.fr.md +++ b/README.fr.md @@ -185,13 +185,15 @@ La session elle-même se choisit sur l'écran de connexion (par exemple « Plasm Limite connue : sur les sorties HiDPI avec un facteur d'échelle supérieur à 1, la surcouche est dessinée en 1× puis agrandie par le compositeur, ce qui la rend légèrement floue (les positions restent correctes). +Limite connue : sous KDE Plasma Wayland (KWin 6.3.6, portable à GPU hybride Intel UHD 630 + NVIDIA MX250), le pointeur se fige environ une demi-seconde toutes les deux à trois secondes tant qu'une **traînée** est dessinée. L'anneau seul ne le provoque pas, ni Sourizz avec tous les effets coupés. Sourizz lui-même n'est pas bloqué pendant ces gels et la zone qu'il redessine est petite : la cause se trouve dans la façon dont KWin traite ces mises à jour continues sur ce matériel, et elle n'est pas encore comprise. Sur une telle configuration, désactivez la traînée (`sourizz set trail.enabled false`) ou utilisez la session X11. L'anneau peut aussi traîner légèrement derrière un pointeur rapide sous Wayland, car sa position suit un chemin plus long (script KWin puis D-Bus) que les événements bruts XInput2 utilisés sous X11. + ## Ce qui a été testé En toute honnêteté sur la vérification : - **Automatisé :** 57 tests unitaires (configuration, moteur, suivi des zones à redessiner, invariants de rendu, gestion des touches avec de vraies dispositions AZERTY/QWERTY, traduction evdev, analyse des commandes). En particulier, un test de propriété vérifie que le redessin incrémental est identique au pixel près à un redessin complet pour chaque forme de projecteur, style de traînée et effet de clic. - **X11 :** éprouvé en conditions réelles sous Debian 13, KDE Plasma 6.3, deux écrans — fenêtres de surcouche, traversée des clics, dessin de l'anneau / des clics / des traînées, aucun pixel fantôme après un mouvement rapide, raccourci global, ligne de commande, rechargement de la configuration en direct, menu de l'icône via D-Bus, fenêtre de réglages. -- **Wayland :** éprouvé contre un compositeur **KWin 6.3** imbriqué — surcouche layer-shell, rendu de l'anneau / du projecteur / de la barre d'annotation, capture du mode annotation, script KWin de position du pointeur. **Non testé** avec de vrais périphériques souris et clavier (le chemin evdev n'a que des tests unitaires), en vrai HiDPI, ni sous Hyprland, sway, niri ou d'autres compositeurs. +- **Wayland :** éprouvé contre un compositeur **KWin 6.3** imbriqué — surcouche layer-shell, rendu de l'anneau / du projecteur / de la barre d'annotation, capture du mode annotation, script KWin de position du pointeur. Lancé aussi dans une vraie session KDE Plasma 6.3.6 Wayland (voir la limite sur la traînée ci-dessus) : l'anneau suit le pointeur grâce au script KWin et les vrais périphériques souris, pavé tactile et clavier sont ouverts. **Non vérifié** en session réelle : effets et sons de clic, affichage des touches et mode annotation. **Non testé** en vrai HiDPI, sous GNOME, Hyprland, sway, niri ou d'autres compositeurs. Considérez la prise en charge de Wayland comme une première version solide qui demande davantage de tests sur le terrain ; les rapports de bogues accompagnés de la sortie de `sourizz -vv` sont bienvenus. diff --git a/README.md b/README.md index b6d1c32..9b2a00d 100644 --- a/README.md +++ b/README.md @@ -185,13 +185,15 @@ The session itself is chosen at the login screen (for example "Plasma (X11)" or Known limitation: on HiDPI outputs with a scale above 1 the overlay is drawn at 1× and upscaled by the compositor, so it looks slightly soft (positions are correct). +Known limitation: on KDE Plasma Wayland (KWin 6.3.6, laptop with an Intel UHD 630 + NVIDIA MX250 hybrid GPU) the pointer freezes for about half a second every two to three seconds while a **trail** is drawn. The ring alone does not trigger it, and neither does Sourizz with all effects off. Sourizz itself is not blocked during these stalls and the area it redraws is small, so the cause lies in how KWin handles the continuous updates on this hardware; it is not understood yet. On such a setup, turn the trail off (`sourizz set trail.enabled false`) or use the X11 session. The ring can also lag slightly behind a fast-moving pointer on Wayland, because its position takes a longer path (KWin script, then D-Bus) than the raw XInput2 events used on X11. + ## What was tested Being honest about verification: - **Automated:** 57 unit tests (config, engine, damage tracking, rendering invariants, key handling with real AZERTY/QWERTY layouts, evdev translation, IPC parsing). Notably, a property test checks that incremental repainting is pixel-identical to a full repaint for every spotlight shape, trail style and click effect. - **X11:** exercised live on Debian 13, KDE Plasma 6.3, two monitors — overlay windows, click-through, ring/click/trail drawing, no ghost pixels after fast motion, global hotkey, CLI, live config reload, tray menu over D-Bus, settings window. -- **Wayland:** exercised against a nested **KWin 6.3** compositor — layer-shell overlay, ring/spotlight/annotation toolbar rendering, annotation mode capture, the KWin pointer script. **Not tested** with real mouse and keyboard devices (the evdev path has unit tests only), on real HiDPI, or on Hyprland, sway, niri or other compositors. +- **Wayland:** exercised against a nested **KWin 6.3** compositor — layer-shell overlay, ring/spotlight/annotation toolbar rendering, annotation mode capture, the KWin pointer script. Also run in a real KDE Plasma 6.3.6 Wayland session (see the trail limitation above): the ring follows the pointer through the KWin script and the real mouse, touchpad and keyboard devices are opened. **Not verified** on a real session: click effects and sounds, keystroke display and annotation mode. **Not tested** on real HiDPI, GNOME, or Hyprland, sway, niri or other compositors. Treat Wayland support as a solid first version that needs more field testing; bug reports with `sourizz -vv` output are welcome.