Merge lp:~townsend/compiz/fix-lp1304877 into lp:compiz/0.9.11

Proposed by Christopher Townsend on 2014-04-09
Status: Merged
Approved by: Brandon Schaefer on 2014-04-09
Approved revision: 3854
Merged at revision: 3855
Proposed branch: lp:~townsend/compiz/fix-lp1304877
Merge into: lp:compiz/0.9.11
Diff against target: 69 lines (+19/-26)
2 files modified
src/screen.cpp (+3/-0)
src/window.cpp (+16/-26)
To merge this branch: bzr merge lp:~townsend/compiz/fix-lp1304877
Reviewer Review Type Date Requested Status
Brandon Schaefer (community) 2014-04-09 Approve on 2014-04-09
PS Jenkins bot continuous-integration Approve on 2014-04-09
Review via email: mp+214945@code.launchpad.net

Commit message

Allow binding of other buttons greater than button 7 for windows other than the desktop.

Description of the change

Allow binding of other buttons greater than button 7 for windows other than the desktop.

To post a comment you must log in.
lp:~townsend/compiz/fix-lp1304877 updated on 2014-04-09
3854. By Christopher Townsend on 2014-04-09

Fix Compiz tab/indentation.

Brandon Schaefer (brandontschaefer) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/screen.cpp'
2--- src/screen.cpp 2014-04-02 21:45:25 +0000
3+++ src/screen.cpp 2014-04-09 15:53:23 +0000
4@@ -3438,9 +3438,12 @@
5 if (ignore & ~modHandler->ignoredModMask ())
6 continue;
7
8+ /* Do not allow binding of the scroll wheel for windows other than the desktop
9+ * unless there is a modifier defined */
10 if (window &&
11 !(window->type () & CompWindowTypeDesktopMask) &&
12 bind.button > 3 &&
13+ bind.button < 8 &&
14 !mods)
15 continue;
16
17
18=== modified file 'src/window.cpp'
19--- src/window.cpp 2014-04-07 16:18:09 +0000
20+++ src/window.cpp 2014-04-09 15:53:23 +0000
21@@ -5624,32 +5624,22 @@
22 screen->updatePassiveButtonGrabs(serverFrame);
23 else
24 {
25- if (priv->type & CompWindowTypeDesktopMask)
26- {
27- /* Grab all buttons for the desktop window */
28- XGrabButton (screen->dpy (),
29- AnyButton,
30- AnyModifier,
31- serverFrame, false,
32- ButtonPressMask | ButtonReleaseMask | ButtonMotionMask,
33- GrabModeSync,
34- GrabModeAsync,
35- None,
36- None);
37- }
38- else
39- {
40- /* Only grab buttons 1-3 */
41- for (int i = 1; i <= 3; i++)
42- XGrabButton (screen->dpy (),
43- i,
44- AnyModifier,
45- serverFrame, false,
46- ButtonPressMask | ButtonReleaseMask | ButtonMotionMask,
47- GrabModeSync,
48- GrabModeAsync,
49- None,
50- None);
51+ /* Grab all buttons */
52+ XGrabButton (screen->dpy (),
53+ AnyButton,
54+ AnyModifier,
55+ serverFrame, false,
56+ ButtonPressMask | ButtonReleaseMask | ButtonMotionMask,
57+ GrabModeSync,
58+ GrabModeAsync,
59+ None,
60+ None);
61+
62+ if (!(priv->type & CompWindowTypeDesktopMask))
63+ {
64+ /* Ungrab Buttons 4-7 for scrolling if the window is not the desktop window */
65+ for (int i = 4; i <= 7; i++)
66+ XUngrabButton (screen->dpy (), i, AnyModifier, frame);
67 }
68 }
69 }

Subscribers

People subscribed via source and target branches