summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <sam.spilsbury@canonical.com>2011-02-11 20:23:39 +0800
committerSam Spilsbury <sam.spilsbury@canonical.com>2011-02-11 20:23:39 +0800
commitf5f41b9bbed9ccdcdc6fbb47c4ae0067ee71e7a5 (patch)
tree76ce0363cd46fcbd8995328b843eb8d57824623d
parent1358c4c6f431cc53d5dafb884ef5b5629006fea7 (diff)
downloadcompiz-with-glib-mainloop-f5f41b9bbed9ccdcdc6fbb47c4ae0067ee71e7a5.tar.gz
compiz-with-glib-mainloop-f5f41b9bbed9ccdcdc6fbb47c4ae0067ee71e7a5.tar.bz2
Convert modifier masks from virtual to real ones before grabbing button.
Also skip ignored modifier if it is also in the cleared ignored bits
-rw-r--r--src/window.cpp31
1 files changed, 18 insertions, 13 deletions
diff --git a/src/window.cpp b/src/window.cpp
index c40d5da..e0cdd16 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -4725,23 +4725,28 @@ PrivateWindow::updatePassiveButtonGrabs ()
/* Grab only we have bindings on */
foreach (PrivateScreen::ButtonGrab &bind, screen->priv->buttonGrabs)
{
+ unsigned int mods = modHandler->virtualToRealModMask (bind.modifiers);
+
+ if (mods & CompNoMask)
+ continue;
+
for (unsigned int ignore = 0;
ignore <= modHandler->ignoredModMask (); ignore++)
{
if (ignore & ~modHandler->ignoredModMask ())
- {
- XGrabButton (screen->priv->dpy,
- bind.button,
- bind.modifiers | ignore,
- frame,
- false,
- ButtonPressMask | ButtonReleaseMask |
- ButtonMotionMask,
- GrabModeSync,
- GrabModeAsync,
- None,
- None);
- }
+ continue;
+
+ XGrabButton (screen->priv->dpy,
+ bind.button,
+ mods | ignore,
+ frame,
+ false,
+ ButtonPressMask | ButtonReleaseMask |
+ ButtonMotionMask,
+ GrabModeSync,
+ GrabModeAsync,
+ None,
+ None);
}
}
}