This is a bug in GNOME shell (Ubuntu bug 1998017). It has been fixed upstream, but the fix hasn't made its way into Ubuntu yet.
As a workaround, I was starting virt-manager from the command line using X instead of Wayland (WAYLAND_DISPLAY= virt-manager
).
But just today, I discovered that you can actually patch this yourself fairly easily since it's a javascript file. Basically, it boiled down to this:
mkdir -p ~/.gnome-shell-custom-overlays/ui
echo 'export G_RESOURCE_OVERLAYS="/org/gnome/shell=$HOME/.gnome-shell-custom-overlays"' >> ~/.profile
gresource extract /usr/lib/gnome-shell/libgnome-shell.so /org/gnome/shell/ui/inhibitShortcutsDialog.js > ~/.gnome-shell-custom-overlays/ui/inhibitShortcutsDialog.js
$EDITOR ~/.gnome-shell-custom-overlays/ui/inhibitShortcutsDialog.js # manually patch
You can see the patch to apply here. In theory I would think you can log out and back in to see the results, but I went ahead and rebooted just to be sure. I've only been running with this patch for a few hours, but so far so good.
I plan to comment out the line in .profile
any time GNOME Shell is updated. Then repeat steps 3 and 4. If the patch is still needed, uncomment the line in .profile
to continue using the patch. If it's no longer needed, then clean everything up and return to the Ubuntu version without the patch.