Summary: | X11 applications that use _NET_WM_SYNC_REQUEST do not resize correctly on Wayland | ||
---|---|---|---|
Product: | [Plasma] kwin | Reporter: | Eduardo Sánchez Muñoz <eduardosanchezmunoz> |
Component: | xwayland | Assignee: | KWin default assignee <kwin-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | nate, vlad.zahorodnii, xaver.hugl, yanexbug |
Priority: | NOR | ||
Version: | 6.0.4 | ||
Target Milestone: | --- | ||
Platform: | Fedora RPMs | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/plasma/kwin/-/commit/63932229d7fbc8345f1ea9246bd0587162839b77 | Version Fixed In: | 6.3.0 |
Sentry Crash Report: |
Description
Eduardo Sánchez Muñoz
2024-05-02 16:07:26 UTC
*** Bug 490574 has been marked as a duplicate of this bug. *** Git commit 63932229d7fbc8345f1ea9246bd0587162839b77 by Vlad Zahorodnii. Committed on 28/10/2024 at 15:15. Pushed by vladz into branch 'master'. Make Xwayland resizing less glitchy XSYNC requests and wl_surface commits are unsynchronized. This results in the window bouncing when it's being resized. Let's consider a concrete example. Assume that there is a window with 0,0 100x100 geometry and it is being resized by dragging the left edge. If the left edge is dragged by 10px, the following will occur: - wl_surface commits will be blocked (it is needed to ensure the consistent order of XSync acknowledgements and wl_surface commits) - an XSync request will be sent - a ConfigureNotify event will be sent - a client processes the ConfigureNotify by repainting the window and acknowledges the XSync request - kwin notices that the XSync request has been acked and updates the window position to 10,0 and unblocks surface commits The problem is that it can take a while for Xwayland to attach a new buffer to the surface with a size of 90x100. If kwin composes a frame in meanwhile, the effective geometry of the window will be 10,0 100x100, i.e. the right window edge will stick by 10px. Some time later, Xwayland would attach a buffer with the right size (90x100), and the right window edge will be put back in the right place. In order to address the bouncing, this change reworks how the synchronization is performed: - when a window is asked to resize, kwin will freeze wl_surface commits, send a sync request, and configure the window - after the client repaints the window, it acks the sync request - when kwin sees that the sync request has been acked, it will unfreeze the wl_surface commits. And here's the most important part: it will NOT update the window position until Xwayland commits something - when Xwayland commits the wl_surface, kwin will update the window geometry It's important to wait until Xwayland commits the wl_surface because, as it was said previously, it can take a while until Xwayland commits the wl_surface and kwin could compose a frame with the new position but old surface size in meanwhile. M +30 -10 src/x11window.cpp M +2 -0 src/x11window.h https://invent.kde.org/plasma/kwin/-/commit/63932229d7fbc8345f1ea9246bd0587162839b77 |