Browse Source

Fix freeze when requesting clipboard image from our own window

Setadokalo 1 year ago
parent
commit
1d9ec3caa3
1 changed files with 2 additions and 2 deletions
  1. 2 2
      platform/linuxbsd/x11/display_server_x11.cpp

+ 2 - 2
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<Image> 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);