display: Expose window_grab_modifiers

Since commit c255031b6d we pass scroll-events through to
the compositor if the window_grab_modifiers are pressed;
in order to allow gnome-shell to check for those events,
expose the struct member as a MetaDisplay property.

Also take the opportunity to pick a more generic name, now
that the modifier is no longer used exclusively for mouse
clicks (unless we maintain the notion of scroll events as
button 4 and 5 "clicks").

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1695>
This commit is contained in:
Florian Müllner
2021-01-29 20:56:46 +01:00
committed by Marge Bot
parent 30e1c51b33
commit 7901b98808
6 changed files with 29 additions and 10 deletions

View File

@ -6499,7 +6499,7 @@ meta_window_handle_mouse_grab_op_event (MetaWindow *window,
{
case CLUTTER_BUTTON_PRESS:
{
ClutterModifierType grab_mods = meta_display_get_window_grab_modifiers (window->display);
ClutterModifierType grab_mods = meta_display_get_compositor_modifiers (window->display);
/* This is the keybinding or menu case where we've
* been dragging around the window without the button
@ -8426,7 +8426,7 @@ meta_window_handle_ungrabbed_event (MetaWindow *window,
* care about. Just let the event through.
*/
grab_mods = meta_display_get_window_grab_modifiers (display);
grab_mods = meta_display_get_compositor_modifiers (display);
event_mods = clutter_event_get_state (event);
unmodified = (event_mods & grab_mods) == 0;
source = clutter_event_get_source_device (event);