After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 667552 - Switching between applications (Alt-tab) bug with a modal window
Switching between applications (Alt-tab) bug with a modal window
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
3.2.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2012-01-09 13:52 UTC by rom
Modified: 2013-05-29 23:44 UTC
See Also:
GNOME target: ---
GNOME version: 3.1/3.2


Attachments
altTab: take into account all windows when computing app icon ordering (951 bytes, patch)
2012-03-12 22:36 UTC, Stefano Facchini
committed Details | Review
Add META_TAB_LIST_NORMAL_ALL to MetaTabList enum (2.58 KB, patch)
2012-03-12 22:36 UTC, Stefano Facchini
needs-work Details | Review
Add META_TAB_LIST_NORMAL_ALL to MetaTabList enum (2.65 KB, patch)
2012-03-18 12:42 UTC, Stefano Facchini
needs-work Details | Review
Add META_TAB_LIST_NORMAL_ALL to MetaTabList enum (2.34 KB, patch)
2012-03-18 14:03 UTC, Stefano Facchini
committed Details | Review

Description rom 2012-01-09 13:52:26 UTC
- Open a Terminal
- Open Firefox
- Go to menu File > Save page as… : it opens a modal window
- Let this modal window open and press Alt-tab : the Terminal has the focus
- Alt-tab again : Firefox (and its modal window) has the focus
- [Alt-tab again : **BUG** it stays always on Firefox

In the application list of alt-tab menu, Firefox is at the second position, instead of first. So when you alt-tab, you go to the second position, which is… Firefox.
Comment 1 Emmanuele Bassi (:ebassi) 2012-01-09 14:02:37 UTC
re-assigning to gnome-shell.
Comment 2 André Klapper 2012-01-09 14:33:29 UTC
rom: Is this about 3.2?
Comment 3 rom 2012-01-09 15:08:54 UTC
I think yes.

I use Debian sid, and Terminal is 3.2.1, Evolution is 3.2.2, eog is 3.2.2, Nautilus is 3.2.1, gedit is 3.2.6…

How to know the gnome-shell version ?
Comment 4 Milan Bouchet-Valat 2012-01-09 16:27:49 UTC
Confirmed on Fedora 16 too. It works even with several windows instead of the terminal, but the bug isn't always the same. If you play with it for some time, you'll end up with Firefox being the second or third app in Alt+Tab (with 3 windows); the common fact is that the order isn't updated when switching to Firefox.
Comment 5 Stefano Facchini 2012-03-12 22:35:40 UTC
The problem lies in the fact that app ordering in the alt-tab popup is obtained looking only at "normal" windows, so that interactions with a skip-taskbar window are not taken into account:

[...]
        let windows = display.get_tab_list(Meta.TabList.NORMAL, screen,
                                           screen.get_active_workspace());
[...]
(in altTab.js#143)

A possible fix, implemented in next patches, is introducing in Mutter a new value META_TAB_LIST_NORMAL_ALL in MetaTabList enum, corresponding to all windows for which META_WINDOW_IN_NORMAL_TAB_CHAIN_TYPE(window) is true (thus including skip-taskbar).

Another solution could be changing the last-used timestamp for the parent window when interacting with the modal dialog, but I don't think it's a good idea.
Comment 6 Stefano Facchini 2012-03-12 22:36:08 UTC
Created attachment 209548 [details] [review]
altTab: take into account all windows when computing app icon ordering
Comment 7 Stefano Facchini 2012-03-12 22:36:47 UTC
Created attachment 209549 [details] [review]
Add META_TAB_LIST_NORMAL_ALL to MetaTabList enum

This is a new value, not associated with any keybindings, useful
when the WM needs to order the applications by last-interaction,
taking into account all windows.


--

Mutter patch
Comment 8 Jasper St. Pierre (not reading bugmail) 2012-03-12 23:01:46 UTC
(In reply to comment #5)
> The problem lies in the fact that app ordering in the alt-tab popup is obtained
> looking only at "normal" windows, so that interactions with a skip-taskbar
> window are not taken into account:
> 
> [...]
>         let windows = display.get_tab_list(Meta.TabList.NORMAL, screen,
>                                            screen.get_active_workspace());
> [...]
> (in altTab.js#143)
>

The correct fix IMO is to move app tracking into mutter (or into a library that mutter uses), but this is fine for now.
Comment 9 Jasper St. Pierre (not reading bugmail) 2012-03-18 01:18:18 UTC
Review of attachment 209548 [details] [review]:

I forgot to mark this ACN.
Comment 10 Jasper St. Pierre (not reading bugmail) 2012-03-18 01:19:07 UTC
Review of attachment 209549 [details] [review]:

::: src/core/keybindings.c
@@ +3027,3 @@
       return META_GRAB_OP_KEYBOARD_TABBING_GROUP;
+    case META_TAB_LIST_NORMAL_ALL:
+      /* This is actually never reached and it's here

Use g_assert_not_reached(), then.

::: src/meta/display.h
@@ +35,3 @@
   META_TAB_LIST_DOCKS,
+  META_TAB_LIST_GROUP,
+  META_TAB_LIST_NORMAL_ALL,

No comma.
Comment 11 Stefano Facchini 2012-03-18 12:42:31 UTC
Created attachment 210045 [details] [review]
Add META_TAB_LIST_NORMAL_ALL to MetaTabList enum

This is a new value, not associated with any keybindings, useful
when the WM needs to order the applications by last-interaction,
taking into account all windows.
Comment 12 Jasper St. Pierre (not reading bugmail) 2012-03-18 13:24:59 UTC
Review of attachment 210045 [details] [review]:

::: src/core/keybindings.c
@@ +3024,3 @@
+         just to silence a compiler warning */
+      g_assert_not_reached ();
+      return META_GRAB_OP_NONE;

I was thinking something more of the lines of:

    default:
      break;

and letting the g_assert_not_reached(); below handle it.
Comment 13 Stefano Facchini 2012-03-18 14:03:44 UTC
(In reply to comment #12)
> Review of attachment 210045 [details] [review]:
> 
> ::: src/core/keybindings.c
> @@ +3024,3 @@
> +         just to silence a compiler warning */
> +      g_assert_not_reached ();
> +      return META_GRAB_OP_NONE;
> 
> I was thinking something more of the lines of:
> 
>     default:
>       break;
> 
> and letting the g_assert_not_reached(); below handle it.

yeah, sorry for sloppiness, I replied almost blindly here
Comment 14 Stefano Facchini 2012-03-18 14:03:59 UTC
Created attachment 210051 [details] [review]
Add META_TAB_LIST_NORMAL_ALL to MetaTabList enum

This is a new value, not associated with any keybindings, useful
when the WM needs to order the applications by last-interaction,
taking into account all windows.
Comment 15 Jasper St. Pierre (not reading bugmail) 2012-03-18 14:05:41 UTC
Review of attachment 210051 [details] [review]:

Yes.
Comment 16 Stefano Facchini 2012-03-18 14:09:04 UTC
Comment on attachment 209548 [details] [review]
altTab: take into account all windows when computing app icon ordering

Attachment 209548 [details] pushed as 066d446 - altTab: take into account all windows when computing app icon ordering
Comment 17 Stefano Facchini 2012-03-18 14:10:17 UTC
Comment on attachment 210051 [details] [review]
Add META_TAB_LIST_NORMAL_ALL to MetaTabList enum

Attachment 210051 [details] pushed as 8fb361c - Add META_TAB_LIST_NORMAL_ALL to MetaTabList enum
Comment 18 Florian Müllner 2013-05-29 23:44:18 UTC
Oops, we forgot to close this when the patches were committed