Input focus go to wrong window after switching input-method
Affected version
Ubuntu 22.04.1 LTS
gnome-shell 42.5
libmutter 42.5
Wayland session
Bug summary
with 'raise-on-click' set to false, when switching input-method, focus goes to the top-most window, which is not necessarily the focused window before switching.
detailed Environment & Configuration
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy
$ uname -a
Linux hostname 5.15.0-53-generic #59-Ubuntu SMP Mon Oct 17 18:53:30 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
$ apt show gnome-shell
Package: gnome-shell
Version: 42.5-0ubuntu1
$ apt show libmutter-10-0
Package: libmutter-10-0
Version: 42.5-0ubuntu1
$ echo $WAYLAND_DISPLAY
wayland-0
$ tail -n 2 ~/.profile
export MUTTER_VERBOSE=1
export MUTTER_USE_LOGFILE=1
$ gsettings set org.gnome.desktop.wm.preferences raise-on-click false
$ gsettings set org.gnome.desktop.wm.preferences auto-raise false
$ gsettings set org.gnome.desktop.wm.preferences focus-mode click
$ gsettings set org.gnome.desktop.wm.preferences focus-new-windows strict
in Language support -> Keyboard input method system select IBus.
in System Settings -> Keyboard -> Input Sources install another input-method (like Intelligent Pinyin 1.12.1).
Steps to reproduce
- configure window-manager & input-method as above.
- login to desktop.
- launch application terminal and gedit.
- arrange window so that terminal is above and cover gedit while gedit have input focus.
- press super+space to switch input-method.
What happened
the input-method overlay window shows normally, but input focus goes to the front-most window (terminal in this case) after the overlay window disappears.
What did you expect to happen
input focus should go back to last-focused window (gedit in this case) after the overlay window disappears. This behavior is observed on Ubuntu 20.04 with libmutter-6-0 on Xorg session.
Relevant logs, screenshots, screencasts etc.
See attached log file.
journalctl -b --utc --no-hostname | grep gnome-shell > mutter-switch-input-method-wrong-focus.log