Mark windows with _NET_WM_STATE_SKIP_TASKBAR as popups

Also includes some light refactoring of the popup flow in general
and trimming down some unused code.

I suspect this may cause some windows to unexpectedly become popups when they
otherwise shouldn't, but that's a bridge we'll cross when we get there.

Fixes #110 and #112.
This commit is contained in:
Shawn Wallace 2025-04-27 01:08:16 -04:00
parent d1639eca87
commit 56a681bfec
4 changed files with 173 additions and 163 deletions

View file

@ -301,6 +301,9 @@ xcb::atoms_struct! {
wm_protocols => b"WM_PROTOCOLS",
net_active_window => b"_NET_ACTIVE_WINDOW",
wm_delete_window => b"WM_DELETE_WINDOW",
net_wm_state => b"_NET_WM_STATE",
skip_taskbar => b"_NET_WM_STATE_SKIP_TASKBAR",
transient_for => b"WM_TRANSIENT_FOR",
clipboard => b"CLIPBOARD",
targets => b"TARGETS",
multiple => b"MULTIPLE",
@ -1642,3 +1645,21 @@ fn forced_1x_scale_consistent_x11_size() {
assert_eq!(geo.width(), 30);
assert_eq!(geo.height(), 30);
}
#[test]
fn popup_properties() {
let mut f = Fixture::new();
let mut connection = Connection::new(&f.display);
let win_toplevel = connection.new_window(connection.root, 0, 0, 20, 20, false);
f.map_as_toplevel(&mut connection, win_toplevel);
let win_popup_dialog = connection.new_window(connection.root, 10, 10, 50, 50, false);
connection.set_property(
win_popup_dialog,
x::ATOM_ATOM,
connection.atoms.net_wm_state,
&[connection.atoms.skip_taskbar],
);
f.map_as_popup(&mut connection, win_popup_dialog);
}