Merge lp:~brandontschaefer/compiz/disable-tap-detection into lp:compiz/0.9.9

Proposed by Brandon Schaefer
Status: Merged
Approved by: Daniel van Vugt
Approved revision: 3408
Merged at revision: 3408
Proposed branch: lp:~brandontschaefer/compiz/disable-tap-detection
Merge into: lp:compiz/0.9.9
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/disable-tap-detection
Reviewer Review Type Date Requested Status
Daniel van Vugt Approve
jenkins (community) continuous-integration Needs Fixing
Review via email: mp+127370@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

See commit message.

To post a comment you must log in.
Revision history for this message
jenkins (martin-mrazik+qa) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

We should avoid double negatives because they're confusing to read. So:
            <xsl:when test="./disable_tap_detection/text() = 'true'">
should be:
            <xsl:when test="./enable_tap_detection/text() = 'false'">

review: Needs Fixing
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Also, for consistency and clarity DisableTapDetection should be called something else starting with "State..."

Otherwise, it looks good. And tap detection still works as before.

review: Needs Fixing
3408. By Brandon Schaefer

* Renamed things

Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

Alright, renamed some things :) (Hopefully it is descriptive enough!)

Revision history for this message
jenkins (martin-mrazik+qa) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

OK, looks good. And I've retested confirming tap detection still works (when you want it).

review: Approve
Revision history for this message
Michael Terry (mterry) wrote :

I commented in the Unity branch about this too, but I'd like to see a regression test for this. I happened to run into Steve Magoun in Lexington, and he mentioned that this bug had regressed more than once.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'include/core/action.h'
--- include/core/action.h 2012-09-07 22:37:20 +0000
+++ include/core/action.h 2012-10-02 16:31:20 +0000
@@ -75,7 +75,8 @@
75 StateCancel = 1 << 10,75 StateCancel = 1 << 10,
76 StateAutoGrab = 1 << 11,76 StateAutoGrab = 1 << 11,
77 StateNoEdgeDelay = 1 << 12,77 StateNoEdgeDelay = 1 << 12,
78 StateTermTapped = 1 << 1378 StateTermTapped = 1 << 13,
79 StateIgnoreTap = 1 << 14
79 } StateEnum;80 } StateEnum;
8081
81 /**82 /**
8283
=== modified file 'src/privatescreen.h'
--- src/privatescreen.h 2012-06-24 09:00:27 +0000
+++ src/privatescreen.h 2012-10-02 16:31:20 +0000
@@ -427,8 +427,12 @@
427 void updatePassiveKeyGrabs ();427 void updatePassiveKeyGrabs ();
428 void updatePassiveButtonGrabs(Window serverFrame);428 void updatePassiveButtonGrabs(Window serverFrame);
429429
430 void setCurrentState(CompAction::State state);
431
430private:432private:
431 CompScreen * const screen;433 CompScreen * const screen;
434 CompAction::State currentState;
435
432 std::list<ButtonGrab> buttonGrabs;436 std::list<ButtonGrab> buttonGrabs;
433 std::list<KeyGrab> keyGrabs;437 std::list<KeyGrab> keyGrabs;
434};438};
435439
=== modified file 'src/screen.cpp'
--- src/screen.cpp 2012-09-18 01:44:23 +0000
+++ src/screen.cpp 2012-10-02 16:31:20 +0000
@@ -3349,10 +3349,13 @@
3349 * This is so that we can detect taps on individual modifier3349 * This is so that we can detect taps on individual modifier
3350 * keys, and know to cancel the tap if <modifier>+k is pressed.3350 * keys, and know to cancel the tap if <modifier>+k is pressed.
3351 */3351 */
3352 int minCode, maxCode;3352 if (!(currentState & CompAction::StateIgnoreTap))
3353 XDisplayKeycodes (screen->dpy(), &minCode, &maxCode);3353 {
3354 for (k = minCode; k <= maxCode; k++)3354 int minCode, maxCode;
3355 grabUngrabOneKey (modifiers | ignore, k, grab);3355 XDisplayKeycodes (screen->dpy(), &minCode, &maxCode);
3356 for (k = minCode; k <= maxCode; k++)
3357 grabUngrabOneKey (modifiers | ignore, k, grab);
3358 }
3356 }3359 }
33573360
3358 if (CompScreen::checkForError (screen->dpy()))3361 if (CompScreen::checkForError (screen->dpy()))
@@ -3529,6 +3532,12 @@
3529 }3532 }
3530}3533}
35313534
3535void
3536cps::GrabManager::setCurrentState (CompAction::State state)
3537{
3538 currentState = state;
3539}
3540
3532bool3541bool
3533CompScreenImpl::addAction (CompAction *action)3542CompScreenImpl::addAction (CompAction *action)
3534{3543{
@@ -3539,6 +3548,8 @@
3539 if (action->active ())3548 if (action->active ())
3540 return false;3549 return false;
35413550
3551 grabManager.setCurrentState(action->state());
3552
3542 if (action->type () & CompAction::BindingTypeKey)3553 if (action->type () & CompAction::BindingTypeKey)
3543 {3554 {
3544 if (!grabManager.addPassiveKeyGrab (action->key ()))3555 if (!grabManager.addPassiveKeyGrab (action->key ()))
@@ -3579,6 +3590,8 @@
3579 if (!action->active ())3590 if (!action->active ())
3580 return;3591 return;
35813592
3593 grabManager.setCurrentState(action->state());
3594
3582 if (action->type () & CompAction::BindingTypeKey)3595 if (action->type () & CompAction::BindingTypeKey)
3583 grabManager.removePassiveKeyGrab (action->key ());3596 grabManager.removePassiveKeyGrab (action->key ());
35843597
@@ -5385,6 +5398,7 @@
53855398
5386cps::GrabManager::GrabManager (CompScreen *screen) :5399cps::GrabManager::GrabManager (CompScreen *screen) :
5387 screen(screen),5400 screen(screen),
5401 currentState(0),
5388 buttonGrabs (),5402 buttonGrabs (),
5389 keyGrabs ()5403 keyGrabs ()
5390{5404{
53915405
=== modified file 'xslt/bcop.xslt'
--- xslt/bcop.xslt 2012-05-18 06:52:20 +0000
+++ xslt/bcop.xslt 2012-10-02 16:31:20 +0000
@@ -475,6 +475,7 @@
475</xsl:text>475</xsl:text>
476 <xsl:text> action.setState (state | CompAction::StateInitKey);476 <xsl:text> action.setState (state | CompAction::StateInitKey);
477</xsl:text>477</xsl:text>
478 <xsl:call-template name="initTapDetection"/>
478 <xsl:if test="default/text() and default/text() != 'disabled'">479 <xsl:if test="default/text() and default/text() != 'disabled'">
479 <xsl:text> action.keyFromString ("</xsl:text>480 <xsl:text> action.keyFromString ("</xsl:text>
480 <xsl:value-of select="default/text()"/>481 <xsl:value-of select="default/text()"/>
@@ -735,6 +736,15 @@
735 </xsl:if>736 </xsl:if>
736 </xsl:template>737 </xsl:template>
737738
739 <xsl:template name="initTapDetection">
740 <xsl:choose>
741 <xsl:when test="./tap_detection/text() = 'false'">
742 <xsl:text> action.setState (action.state() | CompAction::StateIgnoreTap);
743</xsl:text>
744 </xsl:when>
745 </xsl:choose>
746 </xsl:template>
747
738 <xsl:template name="initIntRestriction">748 <xsl:template name="initIntRestriction">
739 <xsl:param name="value"/>749 <xsl:param name="value"/>
740 <xsl:value-of select="$value"/>750 <xsl:value-of select="$value"/>

Subscribers

People subscribed via source and target branches