Window placement on GTK4 differs vs GTK3
I've brought this here on Matthias's request after filing the same bug over at GTK's issue tracker. I'd like your help to determine what exactly the regression is in GTK4, or if Xfwm4 really is doing something wrong here. So I have reproduced the bug report verbatim.
Steps to reproduce
- Ensure smart placement is set to trigger with minimum size windows in xfwm4's tweaks
- Start gtk3-widget-factory on an empty workspace
- Start gtk4-widget-factory on an empty workspace
- Observe differences in placement
Current behavior
GTK3-based applications are placed by xfwm4 with respect to the shadow extents. GTK4 applications, on the other hand, are placed as if their extents are a normal part of the window, so there is a gap between the corner of the workspace and the content of the window. Xfwm4's smart placement causes GTK3 Widget Factory to be placed right at the top-left without any gaps.
Expected outcome
GTK4 widget factory should be snug against the corner of the workspace per smart placement rules.
Version information
OS: Arch Linux GTK3: 3.24.30 GTK4: 4.4.0 Desktop environment: Xfce 4.16 Window manager: Xfwm 4.16.1
Additional information
I've attached some screenshots displaying the issue and the output of xprop on both windows:
GTK3 Widget Factory: gtk3-xprop.txt
GTK4 Widget Factory: gtk4-xprop.txt
The main thing that jumps out to me is a differing _MOTIF_WM_HINTS
value between the two: _MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x2, 0x0, 0x0, 0x0, 0x0
on GTK3 vs _MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x3, 0x1, 0x0, 0x0, 0x0
on GTK4. Could this be a possible reason placement is incorrect?
Xfwm4 already changed its code to accommodate the way GTK3 does shadows. In addition, it is also possible that this change adversely affects other window managers as well. I would appreciate it if we could give it a fair shake here.