From 86f5bd5d867ad6e120935dfe825f6b903ebbeddd Mon Sep 17 00:00:00 2001 From: GoranKovac Date: Sun, 8 Feb 2026 21:41:11 +0100 Subject: [PATCH] Motif popup fix (#370) Add resize check also since that is not something that popup should have. Closes #365 --- src/xstate/mod.rs | 9 ++++++--- tests/integration.rs | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/xstate/mod.rs b/src/xstate/mod.rs index cb6f9b0..e9425f0 100644 --- a/src/xstate/mod.rs +++ b/src/xstate/mod.rs @@ -723,9 +723,12 @@ impl XState { wmhint_popup = motif_popup && wm_hints.is_some_and(|h| !h.acquire_input_via_wm) && !hints.functions.as_ref().is_some_and(|f| { - f.contains(motif::Functions::Minimize) - || f.contains(motif::Functions::Maximize) - || f.contains(motif::Functions::All) + f.intersects( + motif::Functions::Minimize + | motif::Functions::Maximize + | motif::Functions::Resize + | motif::Functions::All, + ) }); // If the motif hints indicate the user shouldn't be able to do anything // to the window at all, it stands to reason it's probably a popup. diff --git a/tests/integration.rs b/tests/integration.rs index f7bbdf1..c49b5cb 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -2174,6 +2174,27 @@ fn popup_heuristics() { &[0x1_u32, 0, 0, 0, 0, 0, 0, 0, 0], ); f.map_as_toplevel(&mut connection, battle_net); + + let wallpaper_engine = connection.new_window(connection.root, 10, 10, 50, 50, false); + connection.set_property( + wallpaper_engine, + x::ATOM_ATOM, + connection.atoms.win_type, + &[connection.atoms.win_type_normal], + ); + connection.set_property( + wallpaper_engine, + connection.atoms.motif_wm_hints, + connection.atoms.motif_wm_hints, + &[0x3_u32, 0x6, 0x0, 0x0, 0x0], + ); + connection.set_property( + wallpaper_engine, + connection.atoms.wm_hints, + connection.atoms.wm_hints, + &[0x1_u32, 0, 0, 0, 0, 0, 0, 0, 0], + ); + f.map_as_toplevel(&mut connection, wallpaper_engine); } #[test]