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 697480 - All windows of an app are displayed with Alt+tab
All windows of an app are displayed with Alt+tab
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: app-switcher
3.8.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 697971 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-04-07 10:44 UTC by damienrg
Modified: 2017-06-05 20:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (535 bytes, patch)
2013-04-07 10:44 UTC, damienrg
rejected Details | Review
AppSwitcherPopup: Activate only the selected window if any (1.14 KB, patch)
2013-04-07 14:49 UTC, Rui Matos
committed Details | Review
only raise first window with alt tab (870 bytes, patch)
2017-05-25 17:06 UTC, David Jordan
rejected Details | Review

Description damienrg 2013-04-07 10:44:36 UTC
Created attachment 240877 [details] [review]
patch

Hi,
Step to reproduce:
- open 2 or more instance (= windows) of an application (e.g.: gnome-terminal)
- open an instance of an application (e.g: your internet browser)
- do alt+tab and select an instance of the previously launched application (e.g: gnome-terminal) with the help of arrow keys
- all instance of the selected application are displayed

Expected behavior:
Only the selected instance of the application should be displayed. This is what is done when selected an instance of an application with mouse.
Comment 1 Rui Matos 2013-04-07 14:49:13 UTC
Review of attachment 240877 [details] [review]:

Thanks for the patch. It doesn't really work but clearly points the problem. I'll attach a working version.
Comment 2 Rui Matos 2013-04-07 14:49:52 UTC
Created attachment 240887 [details] [review]
AppSwitcherPopup: Activate only the selected window if any

If there's an explicitly selected window thumbnail we should bring up
only that particular window instead of all the application's windows.
Comment 3 Jasper St. Pierre (not reading bugmail) 2013-04-07 14:50:54 UTC
Review of attachment 240887 [details] [review]:

OK.
Comment 4 damienrg 2013-04-07 17:11:18 UTC
I forgot to mention the following problem:
if we do a fast alt-tab (ie just want to switch back to the previous application) all windows of the application are displayed.
I think that gnome-shell should handle this case and display only the previous window.
Comment 5 Rui Matos 2013-04-07 19:14:04 UTC
(In reply to comment #4)
> I forgot to mention the following problem:
> if we do a fast alt-tab (ie just want to switch back to the previous
> application) all windows of the application are displayed.
> I think that gnome-shell should handle this case and display only the previous
> window.

Would it work in one way before a timeout and differently afterwards?
That sounds very confusing.

I think you probably want the window switcher instead.

Attachment 240887 [details] pushed as 2499f2e - AppSwitcherPopup: Activate only the selected window if any
Comment 6 damienrg 2013-04-08 07:22:03 UTC
(In reply to comment #5)
> Would it work in one way before a timeout and differently afterwards?
> That sounds very confusing.
Yes, but I find the current behavior confusing too.

> I think you probably want the window switcher instead.
Not really, I really like how alt+tab is handle in gnome-shell. I just have 2 use case:
- quickly switch between 2 apps
- switch to a selected app
Of course, I could use 2 shortcuts to do that but in this case I think only one shortcut is better not only for me but for users too.

Another solution is to lose the functionality of displaying all windows of an application. This will address the following questionable behavior:
- open an application on workspace 1 (window 1)
- open another instance of the same application on workspace 2 (window 2)
- open a different application on workspace 1 (window 3)
- open a different application on workspace 2 (window 4)
So you have :
- in workspace 1 the window 3 above window 1
- in workspace 2 the window 4 above window 2
If you go to workspace 1 and do a alt+tab to switch to window 1 you will end-up with:
- in workspace 1 the window 1 above window 3 (ok no problem)
- in workspace 2 the window 2 above window 4 (questionable)

Maybe, we should stop pollute this bug report and continue this discussion on the list?
Comment 7 Allan Day 2013-08-16 17:26:55 UTC
*** Bug 697971 has been marked as a duplicate of this bug. ***
Comment 8 David Jordan 2017-05-25 17:06:30 UTC
Created attachment 352588 [details] [review]
only raise first window with alt tab

Alt+Tab still raises all windows of an app unless the user specifically picks a window.  Switching between two windows in different apps (say a terminal and a text editor or web browser) is probably a significantly more frequent usage for Alt+Tab than switching to an application as a whole.

This could be a regression since the previous patches on this bug were accepted.  After looking at these patches and how various extensions attempt to solve the issue of Alt+Tab raising all windows (and break other things in the process), I created the following patch that creates the expected behavior without introducing other bugs (at least in my user testing at the office).
Comment 9 Florian Müllner 2017-05-25 17:57:12 UTC
Comment on attachment 352588 [details] [review]
only raise first window with alt tab

(In reply to David Jordan from comment #8)
> Alt+Tab still raises all windows of an app unless the user specifically
> picks a window. 

Yes. The application switcher is meant to activate the application as a whole, which means raising all the windows. You may agree with that design, but that behavior is fully intentional.

I really think what you want is:
 $ gsettings set org.gnome.desktop.wm.keybindings set switch-applications '[]'
 $ gsettings set org.gnome.desktop.wm.keybindings set switch-windows '["<Alt>Tab"]'
Comment 10 David Jordan 2017-05-25 18:40:24 UTC
(In reply to Florian Müllner from comment #9)
> Comment on attachment 352588 [details] [review] [review]
> only raise first window with alt tab
> 
> (In reply to David Jordan from comment #8)
> > Alt+Tab still raises all windows of an app unless the user specifically
> > picks a window. 
> 
> Yes. The application switcher is meant to activate the application as a
> whole, which means raising all the windows. You may agree with that design,
> but that behavior is fully intentional.
> 
> I really think what you want is:
>  $ gsettings set org.gnome.desktop.wm.keybindings set switch-applications
> '[]'
>  $ gsettings set org.gnome.desktop.wm.keybindings set switch-windows
> '["<Alt>Tab"]'

It may be intentional, but with the current behavior it's actually not possible to switch to (just) one window of another application without resorting to the arrow keys.  Alt+~ only toggles between windows of the same application.

The grouping by application is useful, and I'd rather adjust it to be more usable than simply send our users back to the old-style window switcher.

Please take this as a good faith attempt to understand the design rationale, 
but can you think of why a user would want to switch to activate the application as a whole.  So far this behavior has seemed to be more confusing/annoying than helpful in my testing, but I would like to understand it better before making decisions.
Comment 11 damienrg 2017-06-05 20:07:10 UTC
(In reply to David Jordan from comment #8)
> Created attachment 352588 [details] [review] [review]
> only raise first window with alt tab
> 
> Alt+Tab still raises all windows of an app unless the user specifically
> picks a window.  Switching between two windows in different apps (say a
> terminal and a text editor or web browser) is probably a significantly more
> frequent usage for Alt+Tab than switching to an application as a whole.
> 
> This could be a regression since the previous patches on this bug were
> accepted.  After looking at these patches and how various extensions attempt
> to solve the issue of Alt+Tab raising all windows (and break other things in
> the process), I created the following patch that creates the expected
> behavior without introducing other bugs (at least in my user testing at the
> office).

This bug report has a misleading title and contains one bug and a questionable behavior:
1. the initial report was: when the user selects a specific instance of an application all windows of the application are raised.
The expected behavior is: only raise the selected application.
This bug was fixed by the patch provided by Rui Matos.
2. I also reported that when doing a "fast" alt+tab it should not bring all windows put only the previous one (ie the behavior you want).
No patch was submitted for this problem because the behavior of the application switcher in 2013 and today is intentional (see comment #5 and comment #9).
I tried a timer approach and as far as I remember it was not conclusive so I made the suggestion in comment #6. I wanted to continue the discussion on the list but I got no answer.

To sum-up, if you want to go further I think you should in order of preference:
- create a gnome extension with the desired behavior
- create a new bug report but I think it will be marked as "not a bug"

I also change the status of this bug to fixed as I think this bug report should only address 1.