diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-06-02 17:02:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-02 17:02:46 +0200 |
commit | 0c8f562711a51dd73a824f9a4010fc4825c4ccce (patch) | |
tree | cce266c76b05a74749738d8cf7a7b5e220d6ac0e /platform/linuxbsd/display_server_x11.cpp | |
parent | a21cb213cbf74ad035b27fbb1305fe13682bc0d1 (diff) | |
parent | 40b3be79127cddf8673a0ad8758682a211874cb5 (diff) |
Merge pull request #61538 from bruvzg/fix_popup_close_passthr
Diffstat (limited to 'platform/linuxbsd/display_server_x11.cpp')
-rw-r--r-- | platform/linuxbsd/display_server_x11.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/platform/linuxbsd/display_server_x11.cpp b/platform/linuxbsd/display_server_x11.cpp index 887d916f35..4aec111022 100644 --- a/platform/linuxbsd/display_server_x11.cpp +++ b/platform/linuxbsd/display_server_x11.cpp @@ -3298,19 +3298,20 @@ void DisplayServerX11::popup_close(WindowID p_window) { } } -void DisplayServerX11::mouse_process_popups() { +bool DisplayServerX11::mouse_process_popups() { _THREAD_SAFE_METHOD_ if (popup_list.is_empty()) { - return; + return false; } uint64_t delta = OS::get_singleton()->get_ticks_msec() - time_since_popup; if (delta < 250) { - return; + return false; } int number_of_screens = XScreenCount(x11_display); + bool closed = false; for (int i = 0; i < number_of_screens; i++) { Window root, child; int root_x, root_y, win_x, win_y; @@ -3340,6 +3341,7 @@ void DisplayServerX11::mouse_process_popups() { } if (C) { _send_window_event(windows[C->get()], DisplayServerX11::WINDOW_EVENT_CLOSE_REQUEST); + closed = true; } } } @@ -3347,6 +3349,7 @@ void DisplayServerX11::mouse_process_popups() { last_mouse_monitor_pos = pos; } } + return closed; } void DisplayServerX11::process_events() { @@ -3357,7 +3360,7 @@ void DisplayServerX11::process_events() { ++frame; #endif - mouse_process_popups(); + bool ignore_events = mouse_process_popups(); if (app_focused) { //verify that one of the windows has focus, else send focus out notification @@ -3407,6 +3410,10 @@ void DisplayServerX11::process_events() { for (uint32_t event_index = 0; event_index < events.size(); ++event_index) { XEvent &event = events[event_index]; + if (ignore_events) { + XFreeEventData(x11_display, &event.xcookie); + continue; + } WindowID window_id = MAIN_WINDOW_ID; |