Merge lp:~mzanetti/unity8/fix-drawer-hiding-on-quick-meta-a into lp:unity8

Proposed by Michael Zanetti
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 2837
Merged at revision: 2853
Proposed branch: lp:~mzanetti/unity8/fix-drawer-hiding-on-quick-meta-a
Merge into: lp:unity8
Diff against target: 61 lines (+33/-0)
2 files modified
plugins/Utils/WindowInputMonitor.cpp (+3/-0)
tests/plugins/Utils/WindowInputMonitorTest.cpp (+30/-0)
To merge this branch: bzr merge lp:~mzanetti/unity8/fix-drawer-hiding-on-quick-meta-a
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration Approve
Albert Astals Cid (community) Approve
Review via email: mp+317880@code.launchpad.net

Commit message

Cancel the home key activation if something else is pressed along with Meta

This fixes emitting a "home key pressed" signal if the actual press was a combination
of Meta + something else which in turn caused problems like the drawer hiding again
on a very quick Meta+A press.

Description of the change

 * Are there any related MPs required for this MP to build/function as expected? Please list.
no
 * Did you perform an exploratory manual test run of your code change and any related functionality?
yes
 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
no
 * If you changed the UI, has there been a design review?
no

To post a comment you must log in.
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
2835. By Michael Zanetti

add a test

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2835
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3170/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4159
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2446
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2446
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4187
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4025
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4025/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4025
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4025/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4025
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4025/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4025
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4025/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4025
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4025/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4025
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4025/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3170/rebuild

review: Approve (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

Did you just prove the test is not correct by having it pass with the code in WindowInputMonitor commented out?

review: Needs Fixing
2836. By Michael Zanetti

reenable code

Revision history for this message
Michael Zanetti (mzanetti) wrote :

> Did you just prove the test is not correct by having it pass with the code in
> WindowInputMonitor commented out?

lol, yeah, not sure what happened. fixed

2837. By Michael Zanetti

fix the test

Revision history for this message
Albert Astals Cid (aacid) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Yes

 * Did CI run pass? If not, please explain why.
Waiting for it before top approval, it should

review: Approve
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2836
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3172/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4162
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2448
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2448
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4190
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4028
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4028/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4028
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4028/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4028
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4028/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4028
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4028/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4028
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4028/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4028
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4028/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3172/rebuild

review: Approve (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2837
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3174/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4165
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2450
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2450
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4193
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4030
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4030/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4030
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4030/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4030
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4030/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4030
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4030/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4030
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4030/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4030
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4030/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3174/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/Utils/WindowInputMonitor.cpp'
2--- plugins/Utils/WindowInputMonitor.cpp 2016-09-08 15:52:55 +0000
3+++ plugins/Utils/WindowInputMonitor.cpp 2017-02-22 08:53:46 +0000
4@@ -73,6 +73,9 @@
5 && m_windowLastTouchedTimer->elapsed() >= msecsWithoutTouches) {
6 m_pressedHomeKey = keyEvent->key();
7 m_activationTimer->start();
8+ } else if (m_pressedHomeKey != 0 && !m_homeKeys.contains(keyEvent->key())) {
9+ // something else came in... cancel activation
10+ m_activationTimer->stop();
11 }
12
13 } else if (event->type() == QEvent::KeyRelease) {
14
15=== modified file 'tests/plugins/Utils/WindowInputMonitorTest.cpp'
16--- tests/plugins/Utils/WindowInputMonitorTest.cpp 2016-11-29 15:37:33 +0000
17+++ tests/plugins/Utils/WindowInputMonitorTest.cpp 2017-02-22 08:53:46 +0000
18@@ -89,6 +89,8 @@
19 void tapWhileTouching();
20 void multipleHomeKeys();
21
22+ void keyComboInvolvingHome();
23+
24 void repeatedSuperPress();
25
26 private:
27@@ -197,6 +199,34 @@
28 QCOMPARE(activatedSpy.count(), expectedActivatedCount);
29 }
30
31+void WindowInputMonitorTest::keyComboInvolvingHome()
32+{
33+ WindowInputMonitor homeKeyWatcher(m_fakeTimerFactory->create(this), new FakeElapsedTimer);
34+ QSignalSpy activatedSpy(&homeKeyWatcher, &WindowInputMonitor::homeKeyActivated);
35+ QVERIFY(activatedSpy.isValid());
36+
37+ passTime(1000);
38+ {
39+ QKeyEvent keyEvent(QEvent::KeyPress, Qt::Key_Super_L, Qt::NoModifier);
40+ homeKeyWatcher.update(&keyEvent);
41+ }
42+ {
43+ QKeyEvent keyEvent(QEvent::KeyPress, Qt::Key_A, Qt::NoModifier);
44+ homeKeyWatcher.update(&keyEvent);
45+ }
46+ {
47+ QKeyEvent keyEvent(QEvent::KeyRelease, Qt::Key_A, Qt::NoModifier);
48+ homeKeyWatcher.update(&keyEvent);
49+ }
50+ {
51+ QKeyEvent keyEvent(QEvent::KeyRelease, Qt::Key_Super_L, Qt::NoModifier);
52+ homeKeyWatcher.update(&keyEvent);
53+ }
54+ passTime(1000);
55+
56+ QCOMPARE(activatedSpy.count(), 0);
57+}
58+
59 void WindowInputMonitorTest::tapWhileTouching()
60 {
61 WindowInputMonitor homeKeyWatcher(m_fakeTimerFactory->create(this), new FakeElapsedTimer);

Subscribers

People subscribed via source and target branches