From 1d9ec3caa37f7b5e7863ea32f3213953f13d5c7d Mon Sep 17 00:00:00 2001 From: Setadokalo Date: Wed, 25 Oct 2023 18:32:40 -0500 Subject: [PATCH] Fix freeze when requesting clipboard image from our own window --- platform/linuxbsd/x11/display_server_x11.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/linuxbsd/x11/display_server_x11.cpp b/platform/linuxbsd/x11/display_server_x11.cpp index a1a844cb05d..55c637fc93a 100644 --- a/platform/linuxbsd/x11/display_server_x11.cpp +++ b/platform/linuxbsd/x11/display_server_x11.cpp @@ -672,7 +672,7 @@ Atom DisplayServerX11::_clipboard_get_image_target(Atom p_source, Window x11_win unsigned long atom_count = 0; Window selection_owner = XGetSelectionOwner(x11_display, p_source); - if (selection_owner != None) { + if (selection_owner != None && selection_owner != x11_window) { // Block events polling while processing selection events. MutexLock mutex_lock(events_mutex); @@ -783,7 +783,7 @@ Ref DisplayServerX11::clipboard_get_image() const { Window selection_owner = XGetSelectionOwner(x11_display, clipboard); - if (selection_owner != None) { + if (selection_owner != None && selection_owner != x11_window) { // Block events polling while processing selection events. MutexLock mutex_lock(events_mutex);