3

xdg-desktop-portal-gnome strikes again!

 1 month ago
source link: https://www.lorenzobettini.it/2024/03/xdg-desktop-portal-gnome-strikes-again/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

xdg-desktop-portal-gnome strikes again!

I haven’t used Fedora for a few years but wanted to try it again (Fedora 39).

I was immediately hit by a problem, which is not due to Fedora itself, I seem to understand.

I’ll use this example project (taken from my TDD book): https://github.com/LorenzoBettini/demo-attsw. It is a simple Java Swing application where UI tests are written with AssertJ Swing. I run “mvn verify,” and most of the UI tests fail (when the AssertJ Swing bot tries to interact with the application window, it mostly gets the position wrong). Most of all, and this is the cause of the failure, I get this dialog popping up from Gnome “Allow remote interaction”:

allow-remote-interaction.png?resize=622%2C422&ssl=1

Despite I click allow and share, the tests are still failing with the same behavior.

The problem of this dialog popping up, not related to UI tests, is already reported on the Fedora forum: https://discussion.fedoraproject.org/t/f39-opens-a-window-with-remote-desktop-allow-remote-interaction/100228. And the forum points in the right direction: the problem is related to xdg-desktop-portal-gnome! (https://gitlab.gnome.org/GNOME/xdg-desktop-portal-gnome/-/issues/114) This portal has already created several problems in the past, slowing down several applications. I hadn’t realized this was installed automatically in Fedora. By the way, xdg-desktop-portal-gtk is also installed, so I tried to remove the gnome version:

sudo rpm --nodeps -e xdg-desktop-portal-gnome

By the way, removing the package using “dnf” does not work because it complains that this is a requirement of “gnome-shell” (“Problem: The operation would result in removing the following protected packages: gnome-shell”).

After the removal, the dialog no longer popped up, and my UI tests are back to green! 🙂

Another solution to the problem, if you don’t want to remove the gnome portal package, is to log in to the X11 session instead of Wayland. But I prefer the more radical solution. 😉

Like this:

Related


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK