Subject: Bug#763609: gnome-shell: keyboard layout switching ignored after unplug/plug USB keyboard

From: Dmitry Borodaenko <[email-masked]>
Date: Tue, 13 Oct 2020 10:31:36 -0700

[cc to most recent uploaders to flag that this 6 years old bug is back]

This started happening to me after upgrade to gnome-shell 3.38.1. The
behavior I see is that SUPER-space on my laptop's keyboard still works
as expected, at the same time SUPER-space on my USB keyboard (connected
via USB hub in my monitor) works exactly as described by Ondřej:
keyboard switcher appears and they keyboard language indicator changes,
but the keyboard layout remains unchanged.

Mentions of keyboard, warnings, and errors in my journalctl before I
plug in the keyboard:

Oct 13 10:08:03 x1 systemd[1109]: Starting GNOME keyboard configuration service...
Oct 13 10:08:03 x1 systemd[1109]: Starting GNOME keyboard shortcuts service...
Oct 13 10:08:03 x1 systemd[1109]: app-gnome-user\x2ddirs\x2dupdate\x2dgtk-1422.scope: Failed to add PIDs to scope's control group: No such process
Oct 13 10:08:03 x1 systemd[1109]: app-gnome-user\x2ddirs\x2dupdate\x2dgtk-1422.scope: Failed with result 'resources'.
Oct 13 10:08:03 x1 systemd[1109]: Failed to start Application launched by gnome-session-binary.
Oct 13 10:08:03 x1 gsd-usb-protect[1411]: Failed to fetch USBGuard parameters: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.usbguard1 was not provided by any .service files
Oct 13 10:08:03 x1 systemd[1109]: Started GNOME keyboard shortcuts service.
Oct 13 10:08:03 x1 systemd[1109]: Reached target GNOME keyboard shortcuts target.
Oct 13 10:08:03 x1 systemd[1109]: Started GNOME keyboard configuration service.
Oct 13 10:08:03 x1 systemd[1109]: Reached target GNOME keyboard configuration target.
Oct 13 10:08:03 x1 gnome-shell[826]: Failed to set CRTC gamma: drmModeCrtcSetGamma on CRTC 51 failed: Permission denied
Oct 13 10:08:03 x1 gsd-media-keys[1400]: Failed to grab accelerator for keybinding settings:rfkill
Oct 13 10:08:03 x1 gsd-media-keys[1400]: Failed to grab accelerator for keybinding settings:playback-repeat
Oct 13 10:08:03 x1 gsd-media-keys[1400]: Failed to grab accelerator for keybinding settings:rotate-video-lock
Oct 13 10:08:03 x1 gsd-media-keys[1400]: Failed to grab accelerator for keybinding settings:playback-random
Oct 13 10:08:03 x1 gsd-media-keys[1400]: Failed to grab accelerator for keybinding settings:hibernate
Oct 13 10:08:03 x1 colord[742]: failed to get session [pid 1393]: No data available
Oct 13 10:08:03 x1 gnome-shell[826]: Failed to set CRTC gamma: drmModeCrtcSetGamma on CRTC 51 failed: Permission denied
Oct 13 10:08:04 x1 gnome-shell[826]: Connection to xwayland lost
Oct 13 10:08:04 x1 gdm-launch-environment][768]: pam_unix(gdm-launch-environment:session): session closed for user Debian-gdm
Oct 13 10:08:04 x1 gdm-launch-environment][768]: pam_systemd(gdm-launch-environment:session): Failed to release session: Interrupted system call
Oct 13 10:08:04 x1 systemd-logind[710]: Session c1 logged out. Waiting for processes to exit.
Oct 13 10:08:04 x1 gsd-color[1393]: failed to connect to device: Failed to connect to missing device /org/freedesktop/ColorManager/devices/xrandr_LG_Display_Debian_gdm_117
Oct 13 10:08:10 x1 gnome-shell[1298]: Could not create transient scope for PID 1553: GDBus.Error:org.freedesktop.DBus.Error.UnixProcessIdUnknown: Process with ID 1553 does not exist.
Oct 13 10:08:10 x1 gnome-shell[1298]: Could not create transient scope for PID 1554: GDBus.Error:org.freedesktop.DBus.Error.UnixProcessIdUnknown: Process with ID 1554 does not exist.
Oct 13 10:08:16 x1 gnome-shell[1298]: Could not create transient scope for PID 1558: GDBus.Error:org.freedesktop.DBus.Error.UnixProcessIdUnknown: Process with ID 1558 does not exist.

Log of all journalctl messages after turning on my monitor is attached,
too long to include inline.

-- 
Dmitry Borodaenko