Motif popup fix (#370)

Add resize check also since that is not something that popup should
have.
Closes #365
This commit is contained in:
GoranKovac 2026-02-08 21:41:11 +01:00 committed by GitHub
parent e6dd3c05c0
commit 86f5bd5d86
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 27 additions and 3 deletions

View file

@ -723,9 +723,12 @@ impl XState {
wmhint_popup = motif_popup wmhint_popup = motif_popup
&& wm_hints.is_some_and(|h| !h.acquire_input_via_wm) && wm_hints.is_some_and(|h| !h.acquire_input_via_wm)
&& !hints.functions.as_ref().is_some_and(|f| { && !hints.functions.as_ref().is_some_and(|f| {
f.contains(motif::Functions::Minimize) f.intersects(
|| f.contains(motif::Functions::Maximize) motif::Functions::Minimize
|| f.contains(motif::Functions::All) | motif::Functions::Maximize
| motif::Functions::Resize
| motif::Functions::All,
)
}); });
// If the motif hints indicate the user shouldn't be able to do anything // 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. // to the window at all, it stands to reason it's probably a popup.

View file

@ -2174,6 +2174,27 @@ fn popup_heuristics() {
&[0x1_u32, 0, 0, 0, 0, 0, 0, 0, 0], &[0x1_u32, 0, 0, 0, 0, 0, 0, 0, 0],
); );
f.map_as_toplevel(&mut connection, battle_net); 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] #[test]