From 8d733a1245691c656dc8fa3008eb095adbd97f62 Mon Sep 17 00:00:00 2001 From: Victoria Brekenfeld Date: Thu, 27 Mar 2025 17:41:39 +0100 Subject: [PATCH] xwayland: Always allow writing into clipboard Overriding contents is no security issue and this is necessary for a bunch of apps to work correctly. --- src/xwayland.rs | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/xwayland.rs b/src/xwayland.rs index d3ae7a6c..71a24d98 100644 --- a/src/xwayland.rs +++ b/src/xwayland.rs @@ -762,22 +762,20 @@ impl XwmHandler for State { fn new_selection(&mut self, xwm: XwmId, selection: SelectionTarget, mime_types: Vec) { trace!(?selection, ?mime_types, "Got Selection from Xwayland",); - if self.common.is_x_focused(xwm) { - let seat = self - .common - .shell - .read() - .unwrap() - .seats - .last_active() - .clone(); - match selection { - SelectionTarget::Clipboard => { - set_data_device_selection(&self.common.display_handle, &seat, mime_types, xwm) - } - SelectionTarget::Primary => { - set_primary_selection(&self.common.display_handle, &seat, mime_types, xwm) - } + let seat = self + .common + .shell + .read() + .unwrap() + .seats + .last_active() + .clone(); + match selection { + SelectionTarget::Clipboard => { + set_data_device_selection(&self.common.display_handle, &seat, mime_types, xwm) + } + SelectionTarget::Primary => { + set_primary_selection(&self.common.display_handle, &seat, mime_types, xwm) } } }