Key presses are no longer sent to window when deleting a notification that appears using the keyboard
Affected version
Fedora 36 GNOME 42 under Wayland (not tested under XOrg but maybe it's broken there too)
Bug summary
When no pointing input device (mouse or touchpad) is plugged in or enabled (in the case of the touchpad), if one gets a notification that shows up, then opens the notification area (Ctrl+M) and delete the notification with the Delete key, then no key presses are sent to the window that was previously focused.
Steps to reproduce
- Plug out all your input devices, and disable your touchpad with the appropriate function key (on my keyboard it's Fn+F9 to disable it). It is mandatory for the bug to appear it seems.
- Open a terminal window
- run the command "sleep 1; notify-send foobar", type some random character while waiting for the notification
- once it shows up press Ctrl+M to open the notifications popup then delete the notification with the Delete key, then Escape to close the popup.
- now try typing things again in the terminal
- if you can type things, then come back again to step 3 until you're no longer able to type anymore. TBH I think I'm missing one of the necessary conditions to make it 100% easily reproducable, but sometimes it breaks.
Once you've managed to reproduce the bug, you'll be able to use the keyboard only for the GNOME Shell stuff: you can move within the top bar if you open again the notifications popup, or you can move around in the activities overview. To get back control of your keyboard, simply change workspace (and come back to the previous one) using e.g. Super+PageDown. Note that just changing window on the same workspace does not fix the issue.
I know this will be difficult to reproduce as I myself have trouble reproducing it, but it is doable. I'm only using the keyboard nowadays (as long as I don't have to use a website that doesn't work properly with the keyboard), which is why I encountered this issue that only seem to happen with no mouse/touchpad attached.
What happened
Key presses are no longer sent to the window.
What did you expect to happen
Key presses are sent to the window.
Relevant logs, screenshots, screencasts etc.
There is no crash, and I can't see any log message that appears when the bug happens. The only logs I have do not happen at the same time, so it's very likely some other bug or issue altogether:
gnome-shell[1733]: Window manager warning: W173 appears to be one of the offending windows with a timestamp of 19631540. Working around...
gnome-shell[1733]: Window manager warning: last_user_time (19631545) is greater than comparison timestamp (19631540). This most likely represents a buggy client sending inaccurate timestamps in messages such as _NET_ACTIVE_WINDOW. Trying to work around...
gnome-shell[1733]: Window manager warning: W173 appears to be one of the offending windows with a timestamp of 19631545. Working around...
gnome-shell[1733]: Object .Gjs_ui_messageTray_Notification (0x55b558c89640), has been already disposed — impossible to emit any signal on it. This might be caused by the object having been destroyed from C code using something such as destroy(), dispose(), or remove() vfuncs.
gnome-shell[1733]: == Stack trace for context 0x55b550d16620 ==
gnome-shell[1733]: #0 55b558b1b048 i resource:///org/gnome/shell/ui/messageTray.js:493 (3649f2f54830 @ 69)
gnome-shell[1733]: #1 55b558b1afa0 i resource:///org/gnome/shell/ui/messageTray.js:489 (3649f2f547e0 @ 56)
gnome-shell[1733]: #2 55b558b1af18 i resource:///org/gnome/shell/ui/calendar.js:784 (3649f2f59970 @ 22)
gnome-shell[1733]: == Stack trace for context 0x55b550d16620 ==
gnome-shell[1733]: #0 55b558b1b048 i resource:///org/gnome/shell/ui/messageTray.js:494 (3649f2f54830 @ 84)
gnome-shell[1733]: #1 55b558b1afa0 i resource:///org/gnome/shell/ui/messageTray.js:489 (3649f2f547e0 @ 56)
gnome-shell[1733]: #2 55b558b1af18 i resource:///org/gnome/shell/ui/calendar.js:784 (3649f2f59970 @ 22)
gnome-shell[1733]: Object .Gjs_ui_messageTray_Notification (0x55b558c89640), has been already disposed — impossible to access it. This might be caused by the object having been destroyed from C code using something such as destroy(), dispose(), or remove() vfuncs.
The bug is quite tedious and (seemingly) unreliable to reproducable, but I did manage to get a screencast: no-key-press-notification-focus
Here's an explanation of what I'm doing or is happening in the screencast (since key presses and the mouse aren't visible):
- at the beginning I disable the touchpad (since the screencast UI is not keyboard accessible)
- then after typing the command and some random letters (I don't think that's something actually needed to reproduce the bug, but it's hard enough already to reproduce it…), the notification pops up, I press Ctrl+M then Delete then Escape to close the notifications popover.
- at that point I start again writing things in the terminal, but no key presses are sent to it at all. This is why you can see a few seconds where nothing happens.
- afterwards I re-enable the touchpad (which by itself does not fix the issue), but after clicking once in the window, I can type again.