Today's update of mutter breaks simulating key presses with xdotool

I have an installation of Fedora 39 (Workstation Edition) running here on my gaming machine, which works beautifully - most of the times. However, today’s update of the packages mutter and mutter-common broke the ability to simulate key presses using xdotool for me. Instead of sending the key presses to a window, a new window with the title “Remote Display” opens.

I’m running Gnome in a Wayland session with all updates installed. The versions of the relevant packages are as follows:

mutter: 45.2
mutter-common: 45.2
xdotool: 3.20211022.1

Steps to reproduce the problem (the key, in my example F7, doesn’t make any difference):

xdotool key F7

After pressing Enter, the window shown below in the screenshot pops up:

As a workaround, I decided to downgrade both packages mutter and mutter-common and added them to dnf’s excludepkgs list, which obviously isn’t a proper solution, but at least it works for now.

Did anyone encounter the problem as well? Would it be better to report the bug for Fedora or should I try to reproduce the behaviour on another distro and report the issue directly to the Gnome team?

If you need more information, just feel free to ask. I can test things out in a virtual machine, since the issue can be reproduced pretty easily. Thanks in advance.

Please just file a bug with upstream. The GNOME maintainers ignore bugs filed in the Red Hat Bugzilla as a matter of course, so it’s not useful to file bugs there.

As an aside, I’m not sure xdotool is supposed to work on Wayland. You should be using ydotool instead, which supports X11 and Wayland environments.

2 Likes

It was actually working before. I needed xdotool support to use that neat little program which offered me the possibility to use push-to-talk with the Discord client. As of today, it’s not working anymore, which is expected if xdotool can’t do its thing.

I will do that after some more testing. Thank you for the link.

That popup is from xdg-desktop-portal-gnome. Xwayland now implements XTEST using libei and the Remote Desktop portal. xdotool uses XTEST to send a keypress to the current window.

There don’t seem to be any relevant code changes in mutter 45.2. I think it’s just the rebuild that did it. The new build detected support for the -enable-ei-portal in Xwayland and enabled passing it. 45.1 had been built against an older version of Xwayland which didn’t support that flag.

So, I think this is basically the intended behavior, unfortunately.

Yes, this seems as intended. There were a couple of portal related changes which - as annoying as “broken” setups are - were all changes in the direction of better isolation, using portals properly.

@mendres82 If you allow access once, does your tool work then (without asking again)? That would be the ideal scenario - protecting against key injection but allowing intended use caes. The discord flatpak might need some permission tweaking for this.

Unfortunately, no. After allowing access, the window does not pop up again, but neither are the key presses sent to Discord. For the moment, I switched back to running a X11-session, because holding back updates seems like a nasty workaround to me.