Merge lp://qastaging/~aacid/unity-2d/unity-2d_pointer_barrier into lp://qastaging/unity-2d

Proposed by Albert Astals Cid
Status: Merged
Approved by: Gerry Boland
Approved revision: 974
Merged at revision: 963
Proposed branch: lp://qastaging/~aacid/unity-2d/unity-2d_pointer_barrier
Merge into: lp://qastaging/unity-2d
Diff against target: 1524 lines (+1187/-52)
22 files modified
CMakeLists.txt (+4/-0)
data/com.canonical.Unity2d.gschema.xml (+38/-0)
debian/control (+1/-0)
libunity-2d-private/CMakeLists.txt (+1/-0)
libunity-2d-private/Unity2d/plugin.cpp (+4/-0)
libunity-2d-private/src/CMakeLists.txt (+5/-0)
libunity-2d-private/src/decayedvalue.cpp (+65/-0)
libunity-2d-private/src/decayedvalue.h (+45/-0)
libunity-2d-private/src/pointerbarrier.cpp (+361/-0)
libunity-2d-private/src/pointerbarrier.h (+154/-0)
libunity-2d-private/src/pointerbarriermanager.cpp (+84/-0)
libunity-2d-private/src/pointerbarriermanager.h (+44/-0)
libunity-2d-private/tests/CMakeLists.txt (+4/-0)
libunity-2d-private/tests/pointerbarriertest.cpp (+312/-0)
shell/Shell.qml (+11/-18)
shell/common/visibilityBehaviors/AutoHideBehavior.qml (+6/-12)
shell/common/visibilityBehaviors/IntelliHideBehavior.qml (+5/-5)
shell/launcher/Launcher.qml (+23/-1)
shell/launcher/LauncherLoader.qml (+3/-13)
tests/launcher/autohide_show_tests.rb (+6/-0)
tests/launcher/autohide_show_tests_common.rb (+5/-3)
tests/launcher/autohide_show_tests_rtl.rb (+6/-0)
To merge this branch: bzr merge lp://qastaging/~aacid/unity-2d/unity-2d_pointer_barrier
Reviewer Review Type Date Requested Status
Gerry Boland (community) Approve
Review via email: mp+94983@code.qastaging.launchpad.net

Description of the change

Implementation of Pointer barriers and use in the launcher autohide behaviour

To post a comment you must log in.
Revision history for this message
Albert Astals Cid (aacid) wrote :

There is the issue that it crashes when run inside of VirtualBox, it crashes because the XFixesBarrierNotifyEvent->xany.display is set to 0 (happens only inside the VirtualBox VM)

Revision history for this message
Gerry Boland (gerboland) wrote :

Setup: 2 monitors, and shell in RTL mode (so launcher is on right of monitor 1, which borders monitor 2)

Steps to repro:
1. On screen 1 I push mouse against barrier, so launcher reveals
2. I push a bit harder so mouse passes through barrier to screen 2

Bug: Launcher stays open.

I also notice you drop the barrier while the launcher is open. Then for the above bug, there's no barrier stopping the mouse passing from screen 2 to screen 1.

Yes this bug is a bit "multi-monitor" :)

review: Needs Fixing (functional)
Revision history for this message
Gerry Boland (gerboland) wrote :

Removing intellihide, you'll need to remove reference to it from com.canonical.Unity2d.gschema.xml. Also will we need a way to migrate existing intellihide settings to autohide/fixed?

Revision history for this message
Gerry Boland (gerboland) wrote :

Checking with Unity, I noticed 3 differences:
1. barrier extends along whole edge of screen, including panel
2. pushing the bit of the barrier that meets the panel does *not* reveal launcher
3. as you push launcher barrier, a small shadow appears which indicates you should push harder to get launcher to open.

Revision history for this message
Gerry Boland (gerboland) wrote :

Also in RTL multi-monitor setup described above (https://code.launchpad.net/~aacid/unity-2d/unity-2d_pointer_barrier/+merge/94983/comments/205455)

If I push the left edge of screen 2 (which borders the launcher on screen 1), it makes the launcher reveal.

review: Needs Fixing
Revision history for this message
Gerry Boland (gerboland) wrote :

Bug: for hide-mode: 0, no barrier in effect at all
hide-mode 1,2: while launcher visible, no barrier in effect at all

Revision history for this message
Gerry Boland (gerboland) wrote :

Some minor code style comments (possibly my code to start with!):

In PointerBarrierWrapper::createBarrier(), please add braces around statements like:

+ if (!m_enabled)
+ return;

Can you add a debug comment explaining that barrier must be horizontal/vertical here:
+ if ((m_p1.x() != m_p2.x()) && (m_p1.y() != m_p2.y()))
+ return;

In PointerBarrierWrapper::decay(), your indentation is wrong, 2 spaces instead of the usual 4.

You should add yourself as an author to pointerbarrier.h

review: Needs Fixing
Revision history for this message
Gerry Boland (gerboland) wrote :

Functionally this is perfect, nice!

Code-wise, I can find no problems with the math anywhere. There is a little more going on that I had expected, but I can see no way to avoid everything you've done. So again, nice job!

Just some names I think could be clearer:
- "breakp1" could simply be "p1" and so on.
- "trigger" more understandable with "triggerZone" maybe?
- DecayedValue::add maybe clearer with DecayedValue::addAndCheckExceedingTarget since it returns an important bool.

I also want to see more tests of this barrier. Could you write a couple of unit tests, which run under a fake X server (xvfb) - as all tests in libunity-2d-private/tests do right now. We'd need to verify that the barrier works inside xvfb first however.

You can use XTest to move the mouse around. The source code of xdotool is a nice place to see it being used.

review: Needs Fixing
Revision history for this message
Gerry Boland (gerboland) wrote :

Works great, and the simplification helps too. Test is good, I'm approving.
Thank you Albert!

review: Approve
Revision history for this message
Gerry Boland (gerboland) wrote :

Holding off approval until FFe obtained

973. By Albert Astals Cid

Merge lp:unity-2d

974. By Albert Astals Cid

Fix docu

Revision history for this message
Gerry Boland (gerboland) wrote :

FFe obtained, can now merge when tarmac instance happy again.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches