xwayland: delay clipboard check after X selection change

When KWin receives a selection change from an XWayland client, it does not update the selection immediately. Instead, it waits for a selection property change event before obtaining the new offer and updating the selection.

However, between these two events, other events such as focus changes can occur. If the focus changes before the new offer is retrieved, kwin_wayland calls checkWlSource, which writes the Wayland clipboard content back into XWayland, overwriting the new content provided by the XWayland application.

This change introduces a 1-second timer to delay checkWlSource() calls after an X selection change, ensuring that:

  1. Prevents KWin from becoming new selection owner before getting X targets, XWayland applications can successfully write to the clipboard.
  2. If inviald x11 source received, client can still get vaid wayland clipboard data.

BUG: 508004

Edited by Tsic Liu

Merge request reports

Loading