Code review comment for lp://qastaging/~3v1n0/unity/quick-alt+tab-fixes.stable

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

« Back to merge proposal