Bug 471132 - _NET_FRAME_EXTENTS returns incorrect output on XWAYLAND
Summary: _NET_FRAME_EXTENTS returns incorrect output on XWAYLAND
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (other bugs)
Version First Reported In: 5.27.4
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-16 21:41 UTC by dofficialgman
Modified: 2023-07-08 12:08 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.27.7
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dofficialgman 2023-06-16 21:41:50 UTC
SUMMARY
When using XWAYLAND to draw windows, we can use xwininfo and xprop to get output from the currently drawn window. The values returned for _NET_FRAME_EXTENTS are incorrect when using any scaling factor (fractional and whole). The values returned should be the size of the window borders at the current scaling factor. For example, if the top border is 29pixels at 100%, then at 200% we would expect this value to be 58pixels from  _NET_FRAME_EXTENTS. However the value reported is still 29pixels.

STEPS TO REPRODUCE
1. spawn a window in xwayland with some scaling factor used (example of a YAD window spawned in the top left: ex: `GDK_BACKEND=x11 yad --geometry=200x200+0+0`)
2. check the winows output from xwininfo and note the "Absolute upper-left Y:" `xwininfo`
3. compare to the output from xprop `xprop _NET_FRAME_EXTENTS -id window_id_from_xwininfo`

OBSERVED RESULT
the observed result is that the output from xwininfo is correct with the "Absolute upper-left Y:" equaling the scaled window border size while the output from _NET_FRAME_EXTENTS is the window border size without any scaling. This is not the case on GNOME or native XORG with scaling

EXPECTED RESULT
the output from xwininfo and _NET_FRAME_EXTENTS match

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Ubuntu Lunar 5.27.4
(available in About System)
KDE Plasma Version: 5.27.4
KDE Frameworks Version: 5.104.0
Qt Version: 5.15.8
Comment 1 dofficialgman 2023-06-16 21:52:48 UTC
It should go without saying this is only applicable when the "Legacy Applications (X11)" setting is set to "Apply scaling by themselves"
Comment 2 Bug Janitor Service 2023-06-26 16:07:35 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/4214
Comment 3 David Edmundson 2023-07-01 12:21:01 UTC
Git commit d8029e461ee115ac339f3d7b2062f01ec9c46c40 by David Edmundson.
Committed on 01/07/2023 at 11:48.
Pushed by davidedmundson into branch 'master'.

x11: Sync frame extents in X11 native pixels

Frame extents are written out over the wire they should be in X11 native
pixels.

i.e if we are using 200% scaling, and have X11 clients scale themselves
then from the point of view of the client reading the properties the
window decorations are twice the size as normal.

M  +4    -4    src/x11window.cpp

https://invent.kde.org/plasma/kwin/-/commit/d8029e461ee115ac339f3d7b2062f01ec9c46c40
Comment 4 dofficialgman 2023-07-03 02:49:20 UTC
Any chance this can be merged into the Plasma/5.27 branch of kwin?
Comment 5 David Edmundson 2023-07-08 10:46:26 UTC
Git commit 2131c9beed0efb723b51781af7095466bd6c806e by David Edmundson.
Committed on 08/07/2023 at 10:33.
Pushed by davidedmundson into branch 'Plasma/5.27'.

x11: Sync frame extents in X11 native pixels

Frame extents are written out over the wire they should be in X11 native
pixels.

i.e if we are using 200% scaling, and have X11 clients scale themselves
then from the point of view of the client reading the properties the
window decorations are twice the size as normal.


(cherry picked from commit d8029e461ee115ac339f3d7b2062f01ec9c46c40)

M  +4    -4    src/x11window.cpp

https://invent.kde.org/plasma/kwin/-/commit/2131c9beed0efb723b51781af7095466bd6c806e