diff options
author | Florian Müllner <fmuellner@gnome.org> | 2021-11-30 18:04:56 +0100 |
---|---|---|
committer | Florian Müllner <fmuellner@gnome.org> | 2021-12-14 18:23:23 +0100 |
commit | 3643e0ba1effafe0a8addd53f13ee41ad7227f3e (patch) | |
tree | a02267b224778900116655cf32e2fe63396fef43 /src/core/events.c | |
parent | ccf6bbc6731042b80f28dd3daf52fbd41a5dfe82 (diff) | |
download | mutter-3643e0ba1effafe0a8addd53f13ee41ad7227f3e.tar.gz |
events: Bypass windows with modal transients
The expected behavior for modal dialogs is that the user
cannot interact with the parent window. However toolkits
like GTK and Qt can only implement that behavior for windows
within the same process.
Address this by enforcing that behavior in the compositor to
get "foreign" windows and other toolkits behave consistently.
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4825
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2123>
Diffstat (limited to 'src/core/events.c')
-rw-r--r-- | src/core/events.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/core/events.c b/src/core/events.c index 60fb91233..a8f854a02 100644 --- a/src/core/events.c +++ b/src/core/events.c @@ -420,10 +420,15 @@ meta_display_handle_event (MetaDisplay *display, * See: https://gitlab.gnome.org/GNOME/mutter/issues/88 */ if (meta_window_handle_ui_frame_event (window, event)) - bypass_wayland = (event->type == CLUTTER_BUTTON_PRESS || - event->type == CLUTTER_TOUCH_BEGIN); + { + bypass_wayland = (event->type == CLUTTER_BUTTON_PRESS || + event->type == CLUTTER_TOUCH_BEGIN); + } else - meta_window_handle_ungrabbed_event (window, event); + { + bypass_wayland = meta_window_has_modals (window); + meta_window_handle_ungrabbed_event (window, event); + } /* This might start a grab op. If it does, then filter out the * event, and if it doesn't, replay the event to release our |