mirror of
https://github.com/VallierDev/uu-remote-linux.git
synced 2026-11-16 16:50:41 +01:00
Privacy: keep the cover window out of the task manager (#169)
* fix(privacy): keep the cover window out of the task manager The cover is a plain Wayland toplevel and GTK's skip-taskbar hint is X11 only, so KWin listed it: the task manager showed an unidentified window (class uuremote-server, caption "uu-remote-linux privacy") with the icon theme's generic "wayland" icon, a yellow W in Papirus. Mark the window through KWin scripting after the cover reports ready. The same one-shot script mechanism already moves windows to the virtual output. Failure only logs; the cover itself is unaffected. Verified on KDE Plasma 6.8 Wayland: setting skipTaskbar on the running cover removes the task manager entry immediately, and the entry returns when a new cover window is created without the fix. `cargo test --features wayland,portal`: 320 passed, 10 ignored. * fix(privacy): match every cover window, not just the first caption Picture mode creates one cover per physical monitor with the same title, and KWin appends " <2>" and similar suffixes to duplicate captions, so the exact match skipped every cover after the first on a multi-monitor host. Match the title as a prefix instead. * fix(privacy): report the cover ready only after its windows are mapped The child wrote "ready" before gtk_main(), so the host marked skip-taskbar while KWin may not have listed the cover yet; a cover that mapped later kept the task manager entry. Pump the pending GTK events to map the windows before the handshake, and run the mark script a second time to catch a compositor-side delay.
This commit is contained in:
1 parent
ba8f8ada20
commit
50ff42e8d7
3 files changed
+19
No files matched your search
@@ -23,3 +23,12 @@ pub fn move_windows_to(output: &str) -> Result<(), String> {
|
||||
script(&format!(r#"const v = workspace.screens.find(o => o.name == "{output}");
|
||||
if (v) for (const w of workspace.windowList()) if (w.normalWindow || w.dialog) workspace.sendClientToScreen(w, v);"#))
|
||||
}
|
||||
/// Hides the cover window from the task manager. GTK's skip-taskbar hint is an X11 hint and KWin
|
||||
/// ignores it on Wayland, so the cover showed up as an unidentified window with the theme's
|
||||
/// generic "wayland" icon. `skipTaskbar` is writable through KWin scripting. Picture mode creates
|
||||
/// one cover per physical monitor with the same title, and KWin appends " <2>" and so on to
|
||||
/// duplicate captions, so match the title as a prefix.
|
||||
pub fn hide_cover_from_taskbar() -> Result<(), String> {
|
||||
script(r#"for (const w of workspace.windowList())
|
||||
if (w.resourceClass === "uuremote-server" && w.caption.indexOf("uu-remote-linux privacy") === 0) w.skipTaskbar = true;"#)
|
||||
}
|
||||
@@ -47,6 +47,13 @@ fn cover(data: &Data) -> Result<[f64; 4], String> {
|
||||
if physical.len() != data.outputs.len() { return Err("physical outputs did not come back".into()); }
|
||||
let region = outputs::region(&layout, &virtual_name).ok_or("virtual output geometry")?;
|
||||
super::cover::show(wallpaper().as_deref(), &physical)?;
|
||||
// The cover is a plain Wayland toplevel: GTK's skip-taskbar hint is X11-only, so without this
|
||||
// the task manager shows it as an unidentified window with the theme's generic "wayland" icon.
|
||||
// KWin lists a freshly mapped window asynchronously, so one more pass catches a late cover.
|
||||
for pass in 0..2 {
|
||||
if let Err(e) = kwin::hide_cover_from_taskbar() { log::warn!("Privacy cover taskbar: {e}"); break; }
|
||||
if pass == 0 { std::thread::sleep(std::time::Duration::from_millis(200)); }
|
||||
}
|
||||
Ok(region)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user