Skip to content

Instantly share code, notes, and snippets.

@purpleidea
Created August 26, 2021 03:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save purpleidea/74354dd7fa5afd5005e2525618cea47e to your computer and use it in GitHub Desktop.
Save purpleidea/74354dd7fa5afd5005e2525618cea47e to your computer and use it in GitHub Desktop.
horrible-gnome-alt-tab-off-by-one-regression
Finally reproduced a horrible GNOME shell regression that's been plaguing me and a bunch of friends for a while now.
Step 1)
Open up gedit. Put it on workspace 1 (for example, doesn't matter)
Step 2)
Open up firefox or some other app and put it on workspace 2. Also open up calculator on the same workspace.
Step 3)
Hit some shortcut to open up a new gedit window.
For example, in GNOME keyboard shortcut settings, I have: a "Launch gedit" command which runs `gedit` and is mapped to Control-Alt-g.
Run the shortcut.
Step 4)
Sometime ago, instead of launching new windows in sensible places, this started putting windows wherever was easier programmatically I guess.
So what happens is a new tab appears in gedit. On workspace 1.
This is annoying because you expect it to pop up in front of you. That's a partial bug, but not the most serious one.
It's partial because you might imagine some app which can only have one instance, and in that case what should happen? Should it move the whole window or leave it there and open a new tab.
Step 5)
Press alt-tab to switch between firefox and calculator. Don't first go and see the new gedit tab. You'll notice that instead of alt-tab, you need to press alt-tab-tab, to cycle. This is because it thinks there's a new window, but it can't see it.
If you go and visit the gedit window and focus it, then this will be fixed. But alt-tab will be off-by-one until then.
Finally, I figured out what this bug was and how to reproduce! Now who can fix it?
Note, it also happens if you restore firefox with many windows. If you don't visit each window (put it in focus) at least once, then the off-by-one-issue will also happen.
Happy Hacking!
James
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment