mirror of
https://github.com/deunix-educ/sourizz.git
synced 2026-11-25 04:39:43 +01:00
Tray: wait for the notification area instead of giving up, and record the Xfce field test
Started at login by the autostart, Sourizz could run before the session's panel published org.kde.StatusNotifierWatcher; ksni then failed once and the daemon stayed without an icon until restarted (seen on Xfce 4.20). The tray is now spawned with assume_sni_available(true), so it registers as soon as the watcher appears. Checked by stopping xfce4-panel, starting the daemon, and restarting the panel: the icon registered by itself. The READMEs list Xfce 4.20 as tested (12 automatic checks, global hotkeys, ring, trail, spotlight, keystrokes, clicks and sounds, annotation, settings window, tray icon and menu). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
+4
-3
@@ -41,7 +41,7 @@ Différences et manques :
|
||||
|
||||
## Installation
|
||||
|
||||
**Fonctionne sur** KDE Plasma (X11 et Wayland), GNOME sous Xorg et les bureaux X11 avec composition ; les compositeurs Wayland de type wlroots (Hyprland, sway…) devraient fonctionner mais ne sont pas testés. **Ne fonctionne pas sur la session Wayland par défaut de GNOME.** Détails dans le [tableau de compatibilité](#x11-et-wayland).
|
||||
**Fonctionne sur** KDE Plasma (X11 et Wayland), GNOME sous Xorg, Xfce et les bureaux X11 avec composition ; les compositeurs Wayland de type wlroots (Hyprland, sway…) devraient fonctionner mais ne sont pas testés. **Ne fonctionne pas sur la session Wayland par défaut de GNOME.** Détails dans le [tableau de compatibilité](#x11-et-wayland).
|
||||
|
||||
Il faut une [chaîne d'outils Rust](https://rustup.rs) stable récente (développé avec la 1.98 ; le projet utilise l'édition 2024). **Aucun paquet `-dev` n'est nécessaire** : la compilation est en Rust pur et charge `libxkbcommon` à l'exécution. La première compilation prend quelques minutes car la fenêtre de réglages embarque egui ; `cargo build --release --no-default-features` compile le démon seul. Si Rust est absent, `./install.sh` propose de l'installer avec rustup (il faut `curl` ou `wget` et un éditeur de liens C comme `build-essential` ; ajoutez `--yes` pour ne pas poser la question).
|
||||
|
||||
@@ -148,7 +148,8 @@ Sourizz a un seul moteur de dessin et deux backends d'affichage ; il choisit le
|
||||
|---|---|---|---|---|---|
|
||||
| **KDE Plasma, X11** | testé | oui | exacte | oui, via XInput2 | oui |
|
||||
| **GNOME sous Xorg** (GNOME 48 et antérieurs) | testé sur 48.7 | oui | exacte | oui, via XInput2 | oui |
|
||||
| Autres bureaux X11 avec composition (Xfce, Cinnamon, MATE, i3, openbox…) | non testé, devrait fonctionner | oui | exacte | oui, via XInput2 | oui |
|
||||
| **Xfce** (X11) | testé sur 4.20 (composition de xfwm4, activée par défaut) | oui | exacte | oui, via XInput2 | oui |
|
||||
| Autres bureaux X11 avec composition (Cinnamon, MATE, i3, openbox…) | non testé, devrait fonctionner | oui | exacte | oui, via XInput2 | oui |
|
||||
| **KDE Plasma, Wayland** | testé sur 6.3.6 | oui | exacte, via un script KWin | demande le groupe `input` | – |
|
||||
| Hyprland | non testé, devrait fonctionner | oui | exacte, via son socket IPC | demande le groupe `input` | – |
|
||||
| sway, river, niri, labwc, COSMIC… | non testé, devrait fonctionner | oui | *estimée* (voir ci-dessous) | demande le groupe `input` | – |
|
||||
@@ -197,7 +198,7 @@ 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. Lancé aussi dans une vraie session KDE Plasma 6.3.6 Wayland : l'anneau suit le pointeur grâce au script KWin, et les effets de clic, leur son, l'affichage des touches, le projecteur et le mode annotation fonctionnent avec la vraie souris, le pavé tactile et le clavier. **GNOME 48.7 (Debian 13), session Wayland :** Sourizz refuse de démarrer avec un message clair, comme prévu, et le backend X11 via XWayland ne suit le pointeur que sur les fenêtres X11. **GNOME 48.7 sous Xorg :** le backend X11 passe les 12 vérifications de `examples/x11_probe.rs` (lancé contre un démon à configuration par défaut, pulsation de l'anneau coupée), les raccourcis globaux fonctionnent, ainsi que le projecteur, l'affichage des touches, les effets et sons de clic, le mode annotation et la fenêtre de réglages ; l'icône de notification et son menu fonctionnent une fois l'extension AppIndicator installée et activée (sans elle, il n'y a pas d'icône). **Non testé** en vrai HiDPI, 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 : l'anneau suit le pointeur grâce au script KWin, et les effets de clic, leur son, l'affichage des touches, le projecteur et le mode annotation fonctionnent avec la vraie souris, le pavé tactile et le clavier. **GNOME 48.7 (Debian 13), session Wayland :** Sourizz refuse de démarrer avec un message clair, comme prévu, et le backend X11 via XWayland ne suit le pointeur que sur les fenêtres X11. **GNOME 48.7 sous Xorg :** le backend X11 passe les 12 vérifications de `examples/x11_probe.rs` (lancé contre un démon à configuration par défaut, pulsation de l'anneau coupée), les raccourcis globaux fonctionnent, ainsi que le projecteur, l'affichage des touches, les effets et sons de clic, le mode annotation et la fenêtre de réglages ; l'icône de notification et son menu fonctionnent une fois l'extension AppIndicator installée et activée (sans elle, il n'y a pas d'icône). **Xfce 4.20 (Xorg) :** les mêmes 12 vérifications automatiques passent, les raccourcis globaux fonctionnent, ainsi que l'anneau, la traînée, le projecteur, l'affichage des touches, les effets et sons de clic, le mode annotation, la fenêtre de réglages et l'icône de notification avec son menu. **Non testé** en vrai HiDPI, sous 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.
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ Differences and gaps:
|
||||
|
||||
## Install
|
||||
|
||||
**Works on** KDE Plasma (X11 and Wayland), GNOME on Xorg, and X11 desktops with a compositor; wlroots-based Wayland compositors (Hyprland, sway…) should work but are untested. **Does not work on GNOME's default Wayland session.** Details in the [compatibility table](#x11-and-wayland).
|
||||
**Works on** KDE Plasma (X11 and Wayland), GNOME on Xorg, Xfce, and X11 desktops with a compositor; wlroots-based Wayland compositors (Hyprland, sway…) should work but are untested. **Does not work on GNOME's default Wayland session.** Details in the [compatibility table](#x11-and-wayland).
|
||||
|
||||
You need a recent stable [Rust toolchain](https://rustup.rs) (developed with 1.98; the crate uses edition 2024). **No `-dev` packages are required**: the build is pure Rust and loads `libxkbcommon` at run time. The first build takes a few minutes because the settings window pulls in egui; `cargo build --release --no-default-features` builds the daemon alone. If Rust is missing, `./install.sh` offers to install it with rustup (it needs `curl` or `wget` and a C linker such as `build-essential`; add `--yes` to skip the question).
|
||||
|
||||
@@ -148,7 +148,8 @@ Sourizz has one drawing engine and two display backends; it picks the right one
|
||||
|---|---|---|---|---|---|
|
||||
| **KDE Plasma, X11** | tested | yes | exact | yes, via XInput2 | yes |
|
||||
| **GNOME on Xorg** (GNOME 48 and earlier) | tested on 48.7 | yes | exact | yes, via XInput2 | yes |
|
||||
| Other X11 desktops with a compositor (Xfce, Cinnamon, MATE, i3, openbox…) | not tested, expected to work | yes | exact | yes, via XInput2 | yes |
|
||||
| **Xfce** (X11) | tested on 4.20 (xfwm4 compositing, on by default) | yes | exact | yes, via XInput2 | yes |
|
||||
| Other X11 desktops with a compositor (Cinnamon, MATE, i3, openbox…) | not tested, expected to work | yes | exact | yes, via XInput2 | yes |
|
||||
| **KDE Plasma, Wayland** | tested on 6.3.6 | yes | exact, via a KWin script | needs the `input` group | – |
|
||||
| Hyprland | not tested, expected to work | yes | exact, via its IPC socket | needs the `input` group | – |
|
||||
| sway, river, niri, labwc, COSMIC… | not tested, expected to work | yes | *estimated* (see below) | needs the `input` group | – |
|
||||
@@ -197,7 +198,7 @@ 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. Also run in a real KDE Plasma 6.3.6 Wayland session: the ring follows the pointer through the KWin script, and the click effects, click sounds, keystroke display, spotlight and annotation mode work with the real mouse, touchpad and keyboard. **GNOME 48.7 (Debian 13), Wayland session:** Sourizz refuses to start with a clear message, as intended, and the X11 backend through XWayland only follows the pointer over X11 windows. **GNOME 48.7 on Xorg:** the X11 backend passes the 12 checks of `examples/x11_probe.rs` (run against a default-config daemon with the ring pulse off), the global hotkeys work, and the spotlight, keystroke display, click effects, click sounds, annotation mode and settings window work; the tray icon and its menu work once the AppIndicator extension is installed and enabled (without it there is no icon). **Not tested** on real HiDPI, or 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: the ring follows the pointer through the KWin script, and the click effects, click sounds, keystroke display, spotlight and annotation mode work with the real mouse, touchpad and keyboard. **GNOME 48.7 (Debian 13), Wayland session:** Sourizz refuses to start with a clear message, as intended, and the X11 backend through XWayland only follows the pointer over X11 windows. **GNOME 48.7 on Xorg:** the X11 backend passes the 12 checks of `examples/x11_probe.rs` (run against a default-config daemon with the ring pulse off), the global hotkeys work, and the spotlight, keystroke display, click effects, click sounds, annotation mode and settings window work; the tray icon and its menu work once the AppIndicator extension is installed and enabled (without it there is no icon). **Xfce 4.20 (Xorg):** the same 12 automatic checks pass, the global hotkeys work, and the ring, trail, spotlight, keystroke display, click effects and sounds, annotation mode, settings window and tray icon with its menu work. **Not tested** on real HiDPI, 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.
|
||||
|
||||
|
||||
+3
-1
@@ -66,7 +66,9 @@ impl Core {
|
||||
pub fn start_tray(&mut self) {
|
||||
use ksni::blocking::TrayMethods;
|
||||
let tray = TrayIcon { cfg: self.cfg.clone(), lang: Lang::resolve(&self.cfg.general.language), hub: self.hub.clone() };
|
||||
match tray.spawn() {
|
||||
// The session may start us before its panel publishes the notification area (autostart at
|
||||
// login): keep waiting for it rather than giving up, and the icon shows up once it exists.
|
||||
match tray.assume_sni_available(true).spawn() {
|
||||
Ok(h) => self.tray = Some(h),
|
||||
Err(e) => log::warn!("no system tray ({e}); control the daemon with the `sourizz` CLI or hotkeys"),
|
||||
}
|
||||
|
||||
@@ -96,6 +96,15 @@ impl ksni::Tray for TrayIcon {
|
||||
String::new()
|
||||
}
|
||||
|
||||
fn watcher_online(&self) {
|
||||
log::info!("system tray available");
|
||||
}
|
||||
|
||||
fn watcher_offline(&self, reason: ksni::OfflineReason) -> bool {
|
||||
log::info!("no system tray for now ({reason:?}); the icon appears when one starts");
|
||||
true
|
||||
}
|
||||
|
||||
/// Left click toggles everything.
|
||||
fn activate(&mut self, _x: i32, _y: i32) {
|
||||
self.hub.send(Command::Toggle("all".into()));
|
||||
|
||||
Reference in New Issue
Block a user