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”:

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:

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. 😉

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.