summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <smspillaz@gmail.com>2010-12-19 10:29:44 +0800
committerSam Spilsbury <smspillaz@gmail.com>2010-12-19 10:29:44 +0800
commit2f4b3fae6c3c54b3a83f759f46aa3257a5577110 (patch)
tree4501aa931e3980a8afbaa1e5eec6e7ae6429c177
parent39ed3654c468d1fcbf1f9a0a74326fefda53c082 (diff)
downloadcompiz-with-glib-mainloop-2f4b3fae6c3c54b3a83f759f46aa3257a5577110.tar.gz
compiz-with-glib-mainloop-2f4b3fae6c3c54b3a83f759f46aa3257a5577110.tar.bz2
Other mouse buttons should be allowed to change the selected window.
But only button 1 should be able to select windows and terminate scale mode. Fixes incorrectly selected window when the mouse has not been moved after scale mode has been initiated and the mouse is hovering over an unselected window, and then Button2, or Button3 eg is pressed. This broke scaleaddon's pull window and close window bindings. Fixes LP #691087
-rw-r--r--plugins/scale/src/scale.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/plugins/scale/src/scale.cpp b/plugins/scale/src/scale.cpp
index 8fbcbb3..6939aa4 100644
--- a/plugins/scale/src/scale.cpp
+++ b/plugins/scale/src/scale.cpp
@@ -1438,8 +1438,7 @@ PrivateScaleScreen::handleEvent (XEvent *event)
}
break;
case ButtonPress:
- if (event->xbutton.button == Button1 &&
- screen->root () == event->xbutton.root &&
+ if (screen->root () == event->xbutton.root &&
grabIndex &&
state != ScaleScreen::In)
{
@@ -1449,12 +1448,16 @@ PrivateScaleScreen::handleEvent (XEvent *event)
o.push_back (CompOption ("root", CompOption::TypeInt));
o[0].value ().set ((int) screen->root ());
- if (selectWindowAt (button->x_root, button->y_root, true))
+ /* Button1 terminates scale mode, other buttons can select
+ * windows */
+ if (selectWindowAt (button->x_root, button->y_root, true) &&
+ event->xbutton.button == Button1)
{
scaleTerminate (&optionGetInitiateEdge (), 0, o);
scaleTerminate (&optionGetInitiateKey (), 0, o);
}
- else if (optionGetShowDesktop ())
+ else if (optionGetShowDesktop () &&
+ event->xbutton.button == Button1)
{
CompPoint pointer (button->x_root, button->y_root);
CompRect workArea (screen->workArea ());