Random loss of keyboard input on random applications

I’m running 24.04.1 gnome on one machine with an AMD graphics card and 24.10 gnome on another machine with an AMD Ryzen CPU with integrated graphics and I cannot type anything into random applications after the computer has been running for a while. Keyboard input just stops but I can still interact with the mouse in the application. Reboot solves the issue.

Apps that do this so far:
Signal (electron)
Standard Notes (snap)
Stock ubuntu Terminal
OnlyOffice (snap)
Brave (.deb)

This is happening on two different machines with two completely different keyboards. Both machines are running Wayland.

Do you think this an AMD graphics issues? What about Wayland?

This is difficult to understand because the application type doesn’t matter. Any ideas how to fix this?

1 Like

Have you tried in a X11 session, I’ve seen where a X session is involved, but nothing yet for wayland.
Link https://askubuntu.com/questions/1522560/ubuntu-24-04-with-keyboard-input-lag.

Could you try a X session for a time to see if it is a wayland issue?

I also have AMD CPU but with nVidia graphics.

I’ve tried using X11 and I think the problem goes away but it’s hard to tell because sometimes it takes a while and is so random.

If it is a Wayland issue, is the only option to use X11 for now? I hate to do that because of the advantages Wayland brings.

You could file a bug against it, but after a long period of time to see if it actually is wayland related.

@tonystark glad to see you made it to Discourse.

1 Like

I don’t know if we’ve worked out the scope of the problem yet.

Input stops within those applications - but does it work overall for GNOME while still in the application that has lost input? Does Alt+F4 close the application? Does the super key open the gnome overview / Super+A / Super+S open a list of applications?

Assuming since you said Reboot solves the issue; that when the issue occurs it suddenly occurs for all those apps?

Next thing to try would be to see if restarting gnome-shell or the input method under wayland allows input to return without restarting the application.

The keyboard still works in GNOME overall and in other applications so it is isolated to a single application.

Alt+F4 closes the application and the super keys all work as expected.

The issue suddenly occurs with one of the apps I listed but not all of them at the same time. It is random which one has the issue.

How would I do that when this happens? It would be great not to have to reboot.

Under X11 you used to be able to do it with Alt+F2 or typing gnome-shell --replace into a terminal. It seems this functionality is different with Wayland given it’s not a client & server model like it used to be

For debugging only you can open a nested copy of gnome-shell within the current shell with
$ dbus-run-session -- gnome-shell --nested --wayland

To restart the Display Manager in addition to the shell (found this while searching) you can run

#
systemctl restart systemd-logind

I’ve traditionally done
# service gdm3 restart # or gdm
Which I think is now just a link to systemd’s:
# systemctl restart gdm

If you’re having issues with not being able to type into gnome-terminal, you could try select text and then middle click (scrollwheel) to paste (with a trailing linebreak to substitute hitting enter; passwords make this more problematic); alternatively login via a TTY by hitting Ctrl+Alt+F3 ; F5; F6 etc. (I can’t remember Ubuntu’s defaults for DM and DE; mine are currently F1 and F2 so those are reserved)