[kwin] Support updateXTime() on Xwayland
Open, Needs TriagePublic

Description

KWin::updateXTime() uses QX11Info::getTimestamp(). This doesn't work if we use platform Wayland. Thus it needs to have a xcb only variant.

sitter added a subscriber: sitter.
meven added a subscriber: meven.Apr 24 2020, 12:46 PM

Since https://gitlab.freedesktop.org/xorg/xserver/commit/a779fda224bee0c4d27636503367e55ae93b33c2
XWayland uses the CLOCK_MONOTONIC that should help.

This doesn't work if we use platform Wayland. Thus it needs to have a xcb only variant.

Please confirm if that still stands.

Please confirm if that still stands.

Do you mean with regards to your patch in D28674? Tbh I don't know what it means and why updateXTime is important to have for XWayland. Is it only for net_wm_sync to have well synced X11/XWayland window resize? Or are there other issues with the non-updated XTime?

meven added a comment.Apr 24 2020, 2:23 PM

Please confirm if that still stands.

Do you mean with regards to your patch in D28674? Tbh I don't know what it means and why updateXTime is important to have for XWayland. Is it only for net_wm_sync to have well synced X11/XWayland window resize?

Yes, mostly

Or are there other issues with the non-updated XTime?

And to prevent the bug of xtime wrapping every 49 days.
But this could be solved some other way as well, if we used CLOCK_MONOTONIC as base for our xtime for instance.

zzag added a subscriber: zzag.Apr 24 2020, 2:39 PM
In T4424#227988, @meven wrote:

Please confirm if that still stands.

Do you mean with regards to your patch in D28674? Tbh I don't know what it means and why updateXTime is important to have for XWayland. Is it only for net_wm_sync to have well synced X11/XWayland window resize?

Yes, mostly

Or are there other issues with the non-updated XTime?

And to prevent the bug of xtime wrapping every 49 days.
But this could be solved some other way as well, if we used CLOCK_MONOTONIC as base for our xtime for instance.

Please don't change how the current X11 time stamp is queried in the standalone X11 platform.

I would recommend to create an overview where XTime is actually used in KWin and how other compositors deal with it. Then try to create a theoretic solution and present that.

It's not clear to me why and how the sync extension is helpful on XWayland. I worked on XWayland in the past quite a bit and I would still need to go through the relevant parts of the XWayland source on how the resize of an XWayland window is actually managed. Is it through X protocol only? Is it by the Wayland surface size associated with the X11 top-level window? If not could it be that way? And if yes would that make sense for KWin?

Also what @zzag said in D28674#656441 makes sense: His point (a) is clear together with the link you provided that XWayland uses CLOCK_MONOTONIC. (b) is more complicated and it would make sense to look at that together with the questions I posed above and look for example at how wlroots handles it. Or mutter if you know its internal structure already for some reason.

zzag added a comment.Apr 24 2020, 4:20 PM

_net_wm_sync_request is the best what we've got, unfortunately.

zzag moved this task from Work In Progress to Done on the Plasma on Wayland board.Apr 29 2020, 1:41 PM