Detecting if UTILITY is popup (#323)

Ardour uses UTILITY atom all over the place for toplevel windows:
Plugins, Dialogs etc
However it does not provide any MOTIF_HINTS at all.

WeChat however uses them for popups and also provides MOTIF_HINTS with
flags 0x2 indicating that only decorations are active. MaterialMaker
also follows what WeChat is doing for right click menus.

This fix assigns UTILITY as popup ONLY if MOTIF_HINTS are provided and
functions are not active.

Couple of apps like Godot mark their windows
(_NET_WM_WINDOW_TYPE_UTILITY) with override_redirect which makes them
popup by default. Potentionally is_popup can be overriden in case MOTIF
functions exists with so no_function_motif would be false.

This fix prefers override_redirect in case that scenario comes up.

Closes #294
This commit is contained in:
GoranKovac 2025-12-22 01:30:50 +01:00 committed by GitHub
parent 979eab242e
commit bf738fffbb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 66 additions and 18 deletions

View file

@ -1400,11 +1400,8 @@ impl<S: X11Selection + 'static> InnerServerState<S> {
.world
.get::<&client::wl_surface::WlSurface>(entity)
.unwrap();
let needs_satellite_decorations = wl_decoration.is_none()
&& window
.attrs
.decorations
.is_none_or(|d| d == Decorations::Server);
let needs_satellite_decorations =
wl_decoration.is_none() && window.attrs.decorations.is_none_or(|d| d.is_serverside());
let (sat_decoration, buf) = needs_satellite_decorations
.then(|| {
DecorationsDataSatellite::try_new(