summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRui Matos <tiagomatos@gmail.com>2014-02-28 14:51:52 +0100
committerRui Matos <tiagomatos@gmail.com>2014-02-28 14:55:14 +0100
commit674bcef6da7cd9882b7e1820e1edf35bd5d48da0 (patch)
treebef4570c6ac64d2d01e143453bdd1ed5039c2396
parent86c1c3024526e479c2e65dee896757549d346c1e (diff)
downloadmutter-674bcef6da7cd9882b7e1820e1edf35bd5d48da0.tar.gz
Handle mouse-button-modifier being disabled
In case 'mouse-button-modifier' is disabled the mask is 0 which means we would always grab.
-rw-r--r--src/compositor/compositor.c3
-rw-r--r--src/core/display.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c
index 52c0db8c8..4c6f0e21d 100644
--- a/src/compositor/compositor.c
+++ b/src/compositor/compositor.c
@@ -991,6 +991,9 @@ event_is_passive_button_grab (MetaDisplay *display,
if (device_event->evtype != XI_ButtonPress)
return FALSE;
+ if (display->window_grab_modifiers == 0)
+ return FALSE;
+
if ((device_event->mods.effective & display->window_grab_modifiers) !=
display->window_grab_modifiers)
return FALSE;
diff --git a/src/core/display.c b/src/core/display.c
index 7f59a8413..acd26c68c 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -2108,7 +2108,7 @@ meta_display_handle_event (MetaDisplay *display,
* care about. Just let the event through.
*/
unmodified = (event->button.modifier_state & grab_mask) == 0;
- fully_modified = (event->button.modifier_state & grab_mask) == grab_mask;
+ fully_modified = grab_mask && (event->button.modifier_state & grab_mask) == grab_mask;
if (unmodified && window && window->have_focus_click_grab)
{