Merge lp:~brandontschaefer/compiz/fix-950160-6.0 into lp:compiz/0.9.8

Proposed by Brandon Schaefer
Status: Work in progress
Proposed branch: lp:~brandontschaefer/compiz/fix-950160-6.0
Merge into: lp:compiz/0.9.8
Diff against target: 119 lines (+34/-5)
4 files modified
include/core/action.h (+2/-1)
src/privatescreen.h (+4/-0)
src/screen.cpp (+18/-4)
xslt/bcop.xslt (+10/-0)
To merge this branch: bzr merge lp:~brandontschaefer/compiz/fix-950160-6.0
Reviewer Review Type Date Requested Status
Compiz Maintainers Pending
Review via email: mp+132926@code.launchpad.net

Commit message

Added a new template that will check tap_detection. If it is false then add
CompAction::StateTapIgnore to the actions state.

If StateTapIgnore is set then in grabUngrabManyKeys ignore grabbing all
modifier+<keys>, because we don't care if the modifier is a tap or not.

This allows for Super+P to work with this unity branch:
https://code.launchpad.net/~brandontschaefer/unity/disable-tap-for-super/+merge/127407

Description of the change

Added a new template that will check tap_detection. If it is false then add
CompAction::StateTapIgnore to the actions state.

If StateTapIgnore is set then in grabUngrabManyKeys ignore grabbing all
modifier+<keys>, because we don't care if the modifier is a tap or not.

This allows for Super+P to work with this unity branch:
https://code.launchpad.net/~brandontschaefer/unity/disable-tap-for-super/+merge/127407

To post a comment you must log in.
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

FYI, when ready, I will still be hesitant to land this until it's been tested by a few people in raring. The same goes for backporting anything.

Too many times recently we've backported code that contained regressions. Simply because the backport was rushed in before the changes were fully tested in the development series.

Unmerged revisions

3412. By Brandon Schaefer

* Adds StateIgnoreTap, so you can set a key to not dectect taps (which makes it not XGrab each key+*)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'include/core/action.h'
2--- include/core/action.h 2012-09-07 22:37:20 +0000
3+++ include/core/action.h 2012-11-05 17:07:35 +0000
4@@ -75,7 +75,8 @@
5 StateCancel = 1 << 10,
6 StateAutoGrab = 1 << 11,
7 StateNoEdgeDelay = 1 << 12,
8- StateTermTapped = 1 << 13
9+ StateTermTapped = 1 << 13,
10+ StateIgnoreTap = 1 << 14
11 } StateEnum;
12
13 /**
14
15=== modified file 'src/privatescreen.h'
16--- src/privatescreen.h 2012-06-24 09:00:27 +0000
17+++ src/privatescreen.h 2012-11-05 17:07:35 +0000
18@@ -427,8 +427,12 @@
19 void updatePassiveKeyGrabs ();
20 void updatePassiveButtonGrabs(Window serverFrame);
21
22+ void setCurrentState(CompAction::State state);
23+
24 private:
25 CompScreen * const screen;
26+ CompAction::State currentState;
27+
28 std::list<ButtonGrab> buttonGrabs;
29 std::list<KeyGrab> keyGrabs;
30 };
31
32=== modified file 'src/screen.cpp'
33--- src/screen.cpp 2012-09-18 01:44:23 +0000
34+++ src/screen.cpp 2012-11-05 17:07:35 +0000
35@@ -3349,10 +3349,13 @@
36 * This is so that we can detect taps on individual modifier
37 * keys, and know to cancel the tap if <modifier>+k is pressed.
38 */
39- int minCode, maxCode;
40- XDisplayKeycodes (screen->dpy(), &minCode, &maxCode);
41- for (k = minCode; k <= maxCode; k++)
42- grabUngrabOneKey (modifiers | ignore, k, grab);
43+ if (!(currentState & CompAction::StateIgnoreTap))
44+ {
45+ int minCode, maxCode;
46+ XDisplayKeycodes (screen->dpy(), &minCode, &maxCode);
47+ for (k = minCode; k <= maxCode; k++)
48+ grabUngrabOneKey (modifiers | ignore, k, grab);
49+ }
50 }
51
52 if (CompScreen::checkForError (screen->dpy()))
53@@ -3529,6 +3532,12 @@
54 }
55 }
56
57+void
58+cps::GrabManager::setCurrentState(CompAction::State state)
59+{
60+ currentState = state;
61+}
62+
63 bool
64 CompScreenImpl::addAction (CompAction *action)
65 {
66@@ -3539,6 +3548,8 @@
67 if (action->active ())
68 return false;
69
70+ grabManager.setCurrentState(action->state());
71+
72 if (action->type () & CompAction::BindingTypeKey)
73 {
74 if (!grabManager.addPassiveKeyGrab (action->key ()))
75@@ -3579,6 +3590,8 @@
76 if (!action->active ())
77 return;
78
79+ grabManager.setCurrentState(action->state());
80+
81 if (action->type () & CompAction::BindingTypeKey)
82 grabManager.removePassiveKeyGrab (action->key ());
83
84@@ -5385,6 +5398,7 @@
85
86 cps::GrabManager::GrabManager (CompScreen *screen) :
87 screen(screen),
88+ currentState(0),
89 buttonGrabs (),
90 keyGrabs ()
91 {
92
93=== modified file 'xslt/bcop.xslt'
94--- xslt/bcop.xslt 2012-05-18 06:52:20 +0000
95+++ xslt/bcop.xslt 2012-11-05 17:07:35 +0000
96@@ -475,6 +475,7 @@
97 </xsl:text>
98 <xsl:text> action.setState (state | CompAction::StateInitKey);
99 </xsl:text>
100+ <xsl:call-template name="initTapDetection"/>
101 <xsl:if test="default/text() and default/text() != 'disabled'">
102 <xsl:text> action.keyFromString ("</xsl:text>
103 <xsl:value-of select="default/text()"/>
104@@ -735,6 +736,15 @@
105 </xsl:if>
106 </xsl:template>
107
108+ <xsl:template name="initTapDetection">
109+ <xsl:choose>
110+ <xsl:when test="./tap_detection/text() = 'false'">
111+ <xsl:text> action.setState (action.state() | CompAction::StateIgnoreTap);
112+</xsl:text>
113+ </xsl:when>
114+ </xsl:choose>
115+ </xsl:template>
116+
117 <xsl:template name="initIntRestriction">
118 <xsl:param name="value"/>
119 <xsl:value-of select="$value"/>

Subscribers

People subscribed via source and target branches