8

I generally use a quick flick of the mouse to switch focus between windows on different monitors. I generally keep the same application on a particular monitor so know where it 'lives'. I usually use the Keyboard Alt+Tab to cycle between windows that are covered by others, so from that POV it's quite confusing when Alt+Tab causes windows on the other monitor to the one I'm looking at get cycled.

Is there any way to limit the list of Alt+Tab windows only to the current monitor that has focus?

I'm on GNOME, not Compiz, on Ubuntu 19.04

3
  • Scripting - would be a piece of cake. You would miss the animation though, is that an issue? Would require an additional shortcut (or replacing the current). Jul 11, 2019 at 11:26
  • Wait, forgot I already wrote it... Jul 11, 2019 at 11:33
  • Hi EoghanM, just curious, but did you notice the answer? Do you manage? Jul 15, 2019 at 10:22

2 Answers 2

2

Short answer

This snippet was written on request for Ubuntu Budgie, but should work on anything but Wayland. It switches between windows on current workspace & monitor, and, depending on the possible argument, either between all windows or between windows of the active application.
It doesn't show any animations though, it just cycles through windows.

Setup instructions are in the link.

Disclaimer: I am the author

6
  • This is great, thanks and works as described! I'm gonna try it out for a while before accepting; it feels weird currently as I'm definitely accustomed to the window preview functionality. BTW to set an ALT-TAB shortcut in Gnome Settings you first have to remove ALT-TAB from the current shortcut (otherwise it just executes an alt-tab!)
    – EoghanM
    Jul 19, 2019 at 8:42
  • I'm getting the following warning on the console FYI ./nopreviews.py:36: DeprecationWarning: Gdk.Window.get_pointer is deprecated return Gdk.get_default_root_window().get_pointer()[1:3]
    – EoghanM
    Jul 19, 2019 at 8:43
  • Hmmm, actually I'm realising that this behaviour is very different from the previous as it cycles through all windows. The basic 'quick' usage of Alt-Tab is used to toggle between 2 windows i.e. between current window and last opened window. The default version with previews only enters the 'cycle' mode when you keep ALT held down (and further allows you to go backwards if you hold down SHIFT).
    – EoghanM
    Jul 19, 2019 at 8:49
  • Ah, right I can easily make it switch according window stack (previous active first) would that help? Jul 19, 2019 at 8:56
  • I actually think the whole ALT-TAB paradigm is broken. It was a blind inheritance from MSWindows and I've got a feeling it violates some core principals of UI design! I've tried something else; I've bound your script to ALT+2 and made another version of your script which goes in the reverse direction (wins[1] - 1 instead of wins[1] + 1) which I've bound to ALT+1. So now I have more direct control of the cycling back or forward. Gonna try this out for a while.
    – EoghanM
    Jul 19, 2019 at 9:13
2

You can use either the Current screen only on window switcher extension or the Alt-Tab for Dual Monitor extension. They both work similarly and cycle windows on the current monitor (the one with the mouse) only.

Although it is mentioned in the GNOME Shell extensions webpage that they support GNOME Shell versions up to 3.32, they both work fine for versions at least up to 3.36 (that's what I've tested).

Also see this question for how to install GNOME Shell extensions: How do I install and manage GNOME Shell extensions?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .