summaryrefslogtreecommitdiffstats
path: root/client/x11/platform.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'client/x11/platform.cpp')
-rw-r--r--client/x11/platform.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/client/x11/platform.cpp b/client/x11/platform.cpp
index 29b5f753..8f0665cb 100644
--- a/client/x11/platform.cpp
+++ b/client/x11/platform.cpp
@@ -3355,6 +3355,8 @@ bool Platform::on_clipboard_grab(uint32_t *types, uint32_t type_count)
XSetSelectionOwner(x_display, clipboard_prop, platform_win, CurrentTime);
XFlush(x_display);
+
+ set_clipboard_owner_unlocked(owner_guest);
return true;
}
@@ -3362,12 +3364,16 @@ int Platform::_clipboard_owner = Platform::owner_none;
void Platform::set_clipboard_owner(int new_owner)
{
+ Lock lock(clipboard_lock);
+ set_clipboard_owner_unlocked(new_owner);
+}
+
+void Platform::set_clipboard_owner_unlocked(int new_owner)
+{
const char * const owner_str[] = { "none", "guest", "client" };
/* Clear pending requests and clipboard data */
{
- Lock lock(clipboard_lock);
-
if (next_selection_request) {
LOG_INFO("selection requests pending upon clipboard owner change, clearing");
while (next_selection_request)