feat: popup POPUP & DROPDOWN _NET_WM_WINDOW_TYPE

Thanks for @SamSaffron for the implementation. I added the relevant
check to the `popup_heuristics` integration.
This commit is contained in:
En-En 2025-10-31 23:43:13 +00:00 committed by Supreeeme
parent 7f27257b51
commit e8079bc072
2 changed files with 24 additions and 0 deletions

View file

@ -720,6 +720,8 @@ impl XState {
}
x if [
self.window_atoms.menu,
self.window_atoms.popup_menu,
self.window_atoms.dropdown_menu,
self.window_atoms.tooltip,
self.window_atoms.drag_n_drop,
]
@ -1017,6 +1019,8 @@ xcb::atoms_struct! {
drag_n_drop => b"_NET_WM_WINDOW_TYPE_DND" only_if_exists = false,
splash => b"_NET_WM_WINDOW_TYPE_SPLASH" only_if_exists = false,
menu => b"_NET_WM_WINDOW_TYPE_MENU" only_if_exists = false,
popup_menu => b"_NET_WM_WINDOW_TYPE_POPUP_MENU" only_if_exists = false,
dropdown_menu => b"_NET_WM_WINDOW_TYPE_DROPDOWN_MENU" only_if_exists = false,
utility => b"_NET_WM_WINDOW_TYPE_UTILITY" only_if_exists = false,
tooltip => b"_NET_WM_WINDOW_TYPE_TOOLTIP" only_if_exists = false,
}

View file

@ -340,6 +340,8 @@ xcb::atoms_struct! {
win_type => b"_NET_WM_WINDOW_TYPE",
win_type_normal => b"_NET_WM_WINDOW_TYPE_NORMAL",
win_type_menu => b"_NET_WM_WINDOW_TYPE_MENU",
win_type_popup_menu => b"_NET_WM_WINDOW_TYPE_POPUP_MENU",
win_type_dropdown_menu => b"_NET_WM_WINDOW_TYPE_DROPDOWN_MENU",
win_type_tooltip => b"_NET_WM_WINDOW_TYPE_TOOLTIP",
win_type_dnd => b"_NET_WM_WINDOW_TYPE_DND",
motif_wm_hints => b"_MOTIF_WM_HINTS" only_if_exists = false,
@ -1959,6 +1961,24 @@ fn popup_heuristics() {
&[connection.atoms.win_type_dnd],
);
f.map_as_popup(&mut connection, discord_dnd);
let git_gui_popup = connection.new_window(connection.root, 10, 10, 50, 50, true);
connection.set_property(
git_gui_popup,
x::ATOM_ATOM,
connection.atoms.win_type,
&[connection.atoms.win_type_popup_menu],
);
f.map_as_popup(&mut connection, git_gui_popup);
let git_gui_dropdown = connection.new_window(connection.root, 10, 10, 50, 50, true);
connection.set_property(
git_gui_popup,
x::ATOM_ATOM,
connection.atoms.win_type,
&[connection.atoms.win_type_dropdown_menu],
);
f.map_as_popup(&mut connection, git_gui_dropdown);
}
#[test]