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

Proposed by Marco Trevisan (Treviño)
Status: Work in progress
Proposed branch: lp://qastaging/~3v1n0/unity/quick-alt+tab-fixes.stable
Merge into: lp://qastaging/unity/4.0
Diff against target: 199 lines (+82/-36)
5 files modified
manual-tests/QuickAltTab.txt (+17/-0)
plugins/unityshell/src/BamfLauncherIcon.cpp (+12/-2)
plugins/unityshell/src/PluginAdapter.cpp (+44/-31)
plugins/unityshell/src/SwitcherController.cpp (+8/-3)
plugins/unityshell/src/WindowManager.h (+1/-0)
To merge this branch: bzr merge lp://qastaging/~3v1n0/unity/quick-alt+tab-fixes.stable
Reviewer Review Type Date Requested Status
Sam Spilsbury (community) Needs Fixing
Review via email: mp+85585@code.qastaging.launchpad.net

Description of the change

Make the quick Alt+Tab more consistent.

The quick Alt+Tab should be handled in a different way according to bug #861250, so I've made it possible by making the SwitcherController to use the ActionArg button member to define the type of the switch that has been performed (I've made this not to add an extra member to the class, but this can be changed if you want the code to be more clean).
Then the activated BamfLauncherIcon redirects this information to the PluginAdapter's FocusWindowGroup that now when called with the FocusVisibility::OnlyVisibleOnTop visibility option, just brings to focus the first window that is on top of the stack (for the given application).

A manual test is included.

To post a comment you must log in.
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

163 + /* Instead of defining a new type of ActionArg we only use the "button"
164 + * ActionArg value to indicate to the view if we're performing a quick
165 + * switch or not. */
166 + unsigned int is_quick = (view_window_ && view_window_->IsVisible()) ? 0 : 1;
167 +
168 if (model_->detail_selection)
169 {
170 - selection->Activate(ActionArg(ActionArg::SWITCHER, 0, model_->DetailSelectionWindow ()));
171 + selection->Activate(ActionArg(ActionArg::SWITCHER, is_quick, model_->DetailSelectionWindow ()));
172 }
173 else
174 {
175 if (selection->GetQuirk (AbstractLauncherIcon::QUIRK_ACTIVE) &&
176 !model_->DetailXids().empty ())
177 {
178 - selection->Activate(ActionArg (ActionArg::SWITCHER, 0, model_->DetailXids()[0]));
179 + selection->Activate(ActionArg (ActionArg::SWITCHER, is_quick, model_->DetailXids()[0]));
180 }
181 else
182 {
183 - selection->Activate(ActionArg(ActionArg::SWITCHER, 0));
184 + selection->Activate(ActionArg(ActionArg::SWITCHER, is_quick));
185 }
186 }

is_quick is confusing here.

I say drop the boolean parameter and have

enum class RaiseBehaviour
{
    RaiseActive,
    RaiseAll
}

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

Thanks for the review, however I don't know if this is still wanted.
I need to ask design.

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

Any updates?

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

I had a talk with design, but I don't get exactly what they want on this side...
I think I can delay it to after the feature freeze.

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