Merge lp:~abreu-alexandre/unity/webapps-switcher-icons-not-at-back into lp:unity

Proposed by Alexandre Abreu
Status: Work in progress
Proposed branch: lp:~abreu-alexandre/unity/webapps-switcher-icons-not-at-back
Merge into: lp:unity
Diff against target: 13 lines (+0/-3)
1 file modified
launcher/ApplicationLauncherIcon.cpp (+0/-3)
To merge this branch: bzr merge lp:~abreu-alexandre/unity/webapps-switcher-icons-not-at-back
Reviewer Review Type Date Requested Status
Christopher Townsend Needs Fixing
Review via email: mp+149862@code.launchpad.net

Description of the change

Remove the limitation for webapps icons to be pushed at the back. The limitation is a bit arbitrary in the first place and conflicts with chromeless webapps "mode".

To post a comment you must log in.
Revision history for this message
Christopher Townsend (townsend) wrote :

My fix for bug #1070715 assumes webapps will always be at the end of the switcher list. I wonder what the behavior will be with this MP???

Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

> My fix for bug #1070715 assumes webapps will always be at the end of the
> switcher list. I wonder what the behavior will be with this MP???

I'll have a look & see if the two actually conflict ...

Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

> My fix for bug #1070715 assumes webapps will always be at the end of the
> switcher list. I wonder what the behavior will be with this MP???

It will not conflict with this change, it will pick the latest "active" application found no matter what (when two "applications" are found active). The difference with this MR is that the active icon would not always be the browser icon, but could be the webapp icon itself. The MR for bug #1070715 still stands: when 2 active icons are found, only the first one is really considered as active.

Revision history for this message
Christopher Townsend (townsend) wrote :

Thanks for checking to make sure it doesn't conflict with my recent fix:)

I agree that always putting any webapps icons to the back of the switcher list seems arbitrary, but I wonder why it was done in the first place. Marco merged this here: http://bazaar.launchpad.net/~unity-team/unity/trunk/revision/3092.2.14, so I wonder if his decision was arbitrary or if there was a real reason for doing this. His commit message is not clear about why he did this.

I'd feel better if I know the answer to this before approving this MP, otherwise this looks good.

Revision history for this message
Christopher Townsend (townsend) wrote :

I tried the MP and it doesn't work correctly for Alt+Tabbing.

For example, I open the Amazon webapp and then open a terminal window. I then click on the Amazon icon in Launcher to focus Amazon. When I hit Alt+Tab, I should go to the terminal window, but instead, it stays on the Amazon page.

Also, the fix for bug #1070715 is regressed as well as when hitting Alt+Tab in the scenario given in the bug stays on the Amazon page instead of switching back to the other Firefox window.

review: Needs Fixing
Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

> I tried the MP and it doesn't work correctly for Alt+Tabbing.
>
> For example, I open the Amazon webapp and then open a terminal window. I then
> click on the Amazon icon in Launcher to focus Amazon. When I hit Alt+Tab, I
> should go to the terminal window, but instead, it stays on the Amazon page.
>
> Also, the fix for bug #1070715 is regressed as well as when hitting Alt+Tab in
> the scenario given in the bug stays on the Amazon page instead of switching
> back to the other Firefox window.

Right, reviewing it ...

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

Mh, in any case we'd need tests for this change... However, do we have a design review for this?

Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

> Mh, in any case we'd need tests for this change... However, do we have a
> design review for this?

The change is not good anyway, trying to work things out (if I can given the schedule); the issue is that there are implicit constraints that make window id's/xids (thru the window manager) the "reifying" factor in many underlying elements in the Launcher. The switcher icons are "stacked" according to the appicons of the latest "application group" the latest activated xids belong to. It does not fit the world of webapps, where xids can be shared but the activation part of each app is not related to the latest "raised" xid, but the latest raised "application" per-se ...

The change requires a bit more refactoring (that can be risky) to make webapps fit, ... atm it might only be a "nice to have",

Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

> I tried the MP and it doesn't work correctly for Alt+Tabbing.
>
> For example, I open the Amazon webapp and then open a terminal window. I then
> click on the Amazon icon in Launcher to focus Amazon. When I hit Alt+Tab, I
> should go to the terminal window, but instead, it stays on the Amazon page.

Just to clarify:

it stays on the Amazon icon because it shares the xid w/ the underlying browser which
was (non deterministically) determined (during the switcher model ordering) to be the last
app raised (which is somewhat the case given the current policies in that regard). So what happens
is that it switches (in a way) from the browser to the following switcher icon which is the webapp
(which shares the same xid hence the order). The behavior basically is that the browser and underlying
webapps (in the same window) do "stay together" in a way,

>
> Also, the fix for bug #1070715 is regressed as well as when hitting Alt+Tab in
> the scenario given in the bug stays on the Amazon page instead of switching
> back to the other Firefox window.

See above,

Unmerged revisions

3167. By Alexandre Abreu

Webapps: remove limitations that webapps switcher icons are always in the back

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/ApplicationLauncherIcon.cpp'
2--- launcher/ApplicationLauncherIcon.cpp 2013-02-15 16:42:12 +0000
3+++ launcher/ApplicationLauncherIcon.cpp 2013-02-21 15:42:28 +0000
4@@ -1188,9 +1188,6 @@
5 unsigned long long ApplicationLauncherIcon::SwitcherPriority()
6 {
7 unsigned long long result = 0;
8- // Webapps always go at the back.
9- if (app_->type() == "webapp")
10- return result;
11
12 for (auto& window : app_->GetWindows())
13 {