You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-25 15:37:42 +00:00
Fix freeze when requesting clipboard image from our own window
This commit is contained in:
@@ -672,7 +672,7 @@ Atom DisplayServerX11::_clipboard_get_image_target(Atom p_source, Window x11_win
|
|||||||
unsigned long atom_count = 0;
|
unsigned long atom_count = 0;
|
||||||
|
|
||||||
Window selection_owner = XGetSelectionOwner(x11_display, p_source);
|
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.
|
// Block events polling while processing selection events.
|
||||||
MutexLock mutex_lock(events_mutex);
|
MutexLock mutex_lock(events_mutex);
|
||||||
|
|
||||||
@@ -783,7 +783,7 @@ Ref<Image> DisplayServerX11::clipboard_get_image() const {
|
|||||||
|
|
||||||
Window selection_owner = XGetSelectionOwner(x11_display, clipboard);
|
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.
|
// Block events polling while processing selection events.
|
||||||
MutexLock mutex_lock(events_mutex);
|
MutexLock mutex_lock(events_mutex);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user