ALT+TAB stops working after a while in Ubuntu 21.04

After upgrading to Ubuntu 21.04 "hirsute", changing of program windows with ALT+TAB stops working. After a while I am not able to jump between programs.

Also the red dots in the favorites bar which shows that a program is open/active are not vanishing after closing / shutting down the program any more, at least for Thunderbird.

~$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=21.04
DISTRIB_CODENAME=hirsute
DISTRIB_DESCRIPTION="Ubuntu 21.04"
~$ echo $XDG_CURRENT_DESKTOP
ubuntu:GNOME

Does anybody know how to get my workflow back?

Addition: it's not ALT+TAB which is not working. It is only "change windows". If I switch ALT+TAB to "change windows immediately" in the gnome settings for keyboard shortcuts, it works to change the windows directly. After a reboot and changing it back to "change windows" (with having a choice through all open programs) it works for a while then stops working again after some time. Strange...


Solution 1:

I was able to resolve the problem, yeah! :) I had exactly the same problem, i.e., both alt+tab not working and the red bullets at the thunderbird icon not disappearing.

Reading through that question I found out that it's related to Wayland not working correctly. Wayland is a display server protocol used by Ubuntu 21.04. Its predecessor used Xorg instead.

This is how you can confirm that Wayland is used -- and how you can change it. Note that my response is copied from the stackoverflow entry above, so please like that response as well if you found my response helpful!

  1. Type echo $XDG_SESSION_TYPE --> It will print Wayland (I suppose).
  2. Type sudo gedit /etc/gdm3/custom.conf --> You will find the entry #WaylandEnable=false, from which you will have to remove the comment symbol, i.e., remove the #. I assume that switches back to Xorg.
  3. Save, reboot, and enjoy alt+tab again! :)

(FYI: In my case, Ubuntu freezed altogether at some point, and it seems as if this is now resolved as well.)

Solution 2:

I've been running 21.04 for a couple of months now without issues, but just yesterday, the problem described here started to happen for me, too. Seems to be due to a recent update of something.

Solution 3:

I'm also affected by this, but this worked, by Jakob Lell:

"I'm also affected by this bug when using Thunderbird but I've found a workaround: Unpin Thunderbird (right click on the icon and "Remove from Favorites"). After that you can still start Thunderbird manually, it won't trigger this bug any more when it is just a normal application (and not a "favorite" application with a fixed place in the Dock)."