summaryrefslogtreecommitdiffstats
path: root/platform/linuxbsd
diff options
context:
space:
mode:
authorAnni Ryynänen <anni@anniryynanen.com>2024-06-06 20:00:05 +0300
committerAnni Ryynänen <anni@anniryynanen.com>2024-06-06 20:00:05 +0300
commitae1e2182ec756293b650ea6493df1883f822158f (patch)
treee85da7e10004d2d04000f0c2035f663f69b4a33c /platform/linuxbsd
parente96ad5af98547df71b50c4c4695ac348638113e0 (diff)
downloadredot-engine-ae1e2182ec756293b650ea6493df1883f822158f.tar.gz
Stop color picker tooltip from stealing input events
Input events go to the tooltip because it's added to `popup_list` in DisplayServer `popup_open`. I think there's no harm in tooltips being omitted from the list, so this commit blocks non-popup windows from being added if they have `FLAG_NO_FOCUS` and `FLAG_MOUSE_PASSTHROUGH`. I'm not happy with this way of detecting tooltips. It'll also catch other windows where this behavior may or may not be wanted. I thought about adding `FLAG_TOOLTIP`, but went with the smaller change for now. Fixes #79500.
Diffstat (limited to 'platform/linuxbsd')
-rw-r--r--platform/linuxbsd/x11/display_server_x11.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/platform/linuxbsd/x11/display_server_x11.cpp b/platform/linuxbsd/x11/display_server_x11.cpp
index 34b6d0219a..4d7ee97e78 100644
--- a/platform/linuxbsd/x11/display_server_x11.cpp
+++ b/platform/linuxbsd/x11/display_server_x11.cpp
@@ -4190,8 +4190,11 @@ void DisplayServerX11::popup_open(WindowID p_window) {
}
}
+ // Detect tooltips and other similar popups that shouldn't block input to their parent.
+ bool ignores_input = window_get_flag(WINDOW_FLAG_NO_FOCUS, p_window) && window_get_flag(WINDOW_FLAG_MOUSE_PASSTHROUGH, p_window);
+
WindowData &wd = windows[p_window];
- if (wd.is_popup || has_popup_ancestor) {
+ if (wd.is_popup || (has_popup_ancestor && !ignores_input)) {
// Find current popup parent, or root popup if new window is not transient.
List<WindowID>::Element *C = nullptr;
List<WindowID>::Element *E = popup_list.back();