Merge lp://qastaging/~unity-team/unity/3v1n0-quick-alt+tab-fixes into lp://qastaging/unity

Proposed by Brandon Schaefer
Status: Superseded
Proposed branch: lp://qastaging/~unity-team/unity/3v1n0-quick-alt+tab-fixes
Merge into: lp://qastaging/unity
Diff against target: 697 lines (+275/-89)
12 files modified
manual-tests/Switcher.txt (+1/-1)
plugins/unityshell/src/BamfLauncherIcon.cpp (+45/-30)
plugins/unityshell/src/Launcher.cpp (+3/-1)
plugins/unityshell/src/PluginAdapter.cpp (+80/-44)
plugins/unityshell/src/PluginAdapter.h (+4/-1)
plugins/unityshell/src/UScreen.cpp (+9/-3)
plugins/unityshell/src/UScreen.h (+1/-0)
plugins/unityshell/src/WindowManager.cpp (+11/-1)
plugins/unityshell/src/WindowManager.h (+5/-2)
plugins/unityshell/src/unityshell.cpp (+8/-5)
tests/autopilot/autopilot/tests/test_launcher.py (+63/-0)
tests/autopilot/autopilot/tests/test_switcher.py (+45/-1)
To merge this branch: bzr merge lp://qastaging/~unity-team/unity/3v1n0-quick-alt+tab-fixes
Reviewer Review Type Date Requested Status
Alex Launi (community) quality Needs Fixing
Tim Penhey (community) Needs Fixing
Sam Spilsbury (community) Approve
Review via email: mp+100911@code.qastaging.launchpad.net

This proposal has been superseded by a proposal from 2012-04-15.

Commit message

Fixes quick alt+tab and also fixes clicking on a launcher icon to raise the last focused application.

Description of the change

Grabbed 3v1n0's quick alt+tab fix branch:
https://code.launchpad.net/~3v1n0/unity/quick-alt+tab-fixes/+merge/85583 and merged it with trunk and fixed the conflicts. This problem is very similar to this bug: https://bugs.launchpad.net/unity/+bug/959339 which this branch also now fixes that bug!

== Problem ==
Quick alt+tab and clicking on a launcher icon raises all of the applications of that type.

== Fix ==
The fix was to add 'OnlyVisibleOnTop' to the enum WindowManager::FocusVisibility so when you want to only focus the top window use that.

To use Quick alt+tab you have to press alt+tab before a timer goes off. Right now it is set to 200ms, but is very easy to change.

Screencast of the fixed version: http://ubuntuone.com/7YaWciQnaZHfzr35asSz0N

== Test ==
There are autopilot test for both bugs.

To post a comment you must log in.
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

30 - if ((mapped && wm->IsWindowMapped(xid)) || !mapped)
31 + if ((mapped && wm->IsWindowMapped(xid) && !bamf_window_get_transient(BAMF_WINDOW(view))) || !mapped)
32 {

About this, I think I included that change mostly for testing purposes, I'm not sure it's actually wanted so move it out.

I didn't work too much on my branch lately since I didn't know if that was still the wanted desig, but if now it is, I'll be happy to get this merged :)

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

I ran all the autopilot test that I thought these changes would effect.

Launcher Autopilot tests:
Ran 43 tests in 296.560s
OK

Switcher Autopilot tests:
Ran 21 tests in 187.666s
OK

Dash Autopilot tests:
Ran 32 tests in 225.549s
OK

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Tests OK, no iconic window regressions (which is what I was a little concerned about)

review: Approve
Revision history for this message
Tim Penhey (thumper) wrote :

Clicking on the launcher to reveal only the top most one works.

However the quick alt-tab one does not work.

If I have two terminal windows and one gedit. Focus gedit and quick alt-tab, it raises both terminals.

review: Needs Fixing
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Probably it is caused by the fact that now we use a very small delay for the Alt+Tab.
A workaround could be to use another time reference to consider an Alt+Tab quick, more than the only window visibility.

I mean, even if the window is shown for 100ms or less, the Alt+Tab is surely a quick one (as there's no time to look to the content of the window).

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

I just ended up making a timer called quick_tab_timer_, which will go for 200ms if you hold on to alt for any longer it makes quick_tab = false. Seems like a nice and customizable way.

Revision history for this message
Alex Launi (alexlauni) wrote :

It shouldn't be too difficult to automate the manual tests. Please do not merge this with the manual tests.

review: Needs Fixing (quality)
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

@Alex

Sorry about having the manual test in there. I was trying to get this branch in 5.10 and was rushing to get it done. Never a good sign when it comes to quality. There are now autopilot test for each bug!

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

So I guess diff continutes to complain about there not being a new line...I even took the trunk version of Switcher.txt and replaced it and it still gives that problem...

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

I've just checked this code again, there's a problem with the minimized windows when using the launcher icon.
Don't worry about that Brandon, I'll take care of that ;)

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

Yeah, I just saw that. At lease we know what design wants now :). Thank you!

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.