https://bugs.kde.org/show_bug.cgi?id=490577

David Edmundson <k...@davidedmundson.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
      Latest Commit|                            |https://invent.kde.org/plas
                   |                            |ma/kwin/-/commit/7e23386d46
                   |                            |d8441d31a1e82c210179546ee6c
                   |                            |ae1

--- Comment #13 from David Edmundson <k...@davidedmundson.co.uk> ---
Git commit 7e23386d46d8441d31a1e82c210179546ee6cae1 by David Edmundson.
Committed on 10/08/2024 at 21:53.
Pushed by davidedmundson into branch 'master'.

xwayland: Drop outdated guard against clipboard races

This guard was added as part of d335070b80c2f3bc5674355e3edba61bc010bc36.

The guard as-is does not work correctly. If a client quits at the wrong point
or simply never responds to the request for targets, we get into a stuck state
where we will never update the clipboard from Wayland to X again until the
selection owner changes.

The guard appears to be outdated: The rationale given in the original MR was
that it prevented a race where:
 1. The X11 clipboard changes
 2. We start fetching targets
 3. We notify Wayland clients that the clipboard changed is now empty
 4. Klipper replaces the clipboard
 5. Kwin then replaces the X11 clipboard
 6. X11 finishes fetching targets, but this is now discarded as there's a new
X11 clipboard

However we can not find a path for step 2 to happen in the current codebase.
Potentially due to one of many refactors over the past few years.
The wayland selection is only replaced when targets are fully loaded.

The only way it could happen is if an X11 client replaced the clipboard by
explicitly deleting the old selection first, but this also does not appear to
happen in any tested apps.

M  +0    -10   src/xwayland/clipboard.cpp
M  +0    -1    src/xwayland/clipboard.h
M  +0    -10   src/xwayland/primary.cpp
M  +0    -1    src/xwayland/primary.h

https://invent.kde.org/plasma/kwin/-/commit/7e23386d46d8441d31a1e82c210179546ee6cae1

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to