From b2a48d09e720c2e2eca7236781acc7ecac2ff662 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Mon, 18 Mar 2024 12:37:42 +0000 Subject: [PATCH] xwayland: Allow pushing to the clipboard without focus X11 did not have a requirement that apps needed keyboard focus to update a clipboard. Apps could copy things on click. With context menus and grabs there can be no active window at this point. Kwin tried to retrofit a requirement, which doesn't work in all cases. Whilst there are security implications of reading a clipboard there are no security issues about pushing a new clipboard. Gnome also allows X11 apps to push to the clipboard at any point. --- src/xwayland/clipboard.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/xwayland/clipboard.cpp b/src/xwayland/clipboard.cpp index 0a39c541de..f654a2df82 100644 --- a/src/xwayland/clipboard.cpp +++ b/src/xwayland/clipboard.cpp @@ -123,14 +123,6 @@ void Clipboard::checkWlSource() void Clipboard::doHandleXfixesNotify(xcb_xfixes_selection_notify_event_t *event) { - const Window *window = workspace()->activeWindow(); - if (!qobject_cast(window)) { - // clipboard is only allowed to be acquired when Xwayland has focus - // TODO: can we make this stronger (window id comparison)? - createX11Source(nullptr); - return; - } - createX11Source(event); if (X11Source *source = x11Source()) {