-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
replace x11 socket with fallback-x11 #24
base: master
Are you sure you want to change the base?
Conversation
Started test build 67276 |
Build 67276 successful
|
Thanks for doing the testing.
I think the issue in DavidoTek/ProtonUp-Qt#77 was that older version of GNOME/Qt tried to use X11/XWayland even when Wayland was available.
In a GNOME 44.4 Wayland session, when running
So with Which desktop environment did you use? |
I spent a lot of time testing to try and figure out what happened, but it turns out you're correct, forcing X11 seems to cause the error you're showing of no backend being available. Sorry for the confusion! For what it's worth, I'm using KDE Plasma Wayland 5.27.8. I did a quick look around and I wonder if perhaps this is expected behaviour? The error is caused by a missing library, likely in this case a missing X11 library, and this may be intentional in the Flatpak. This is only a guess, but I wonder what this would mean for toolkits with no Wayland support (such as old GTK2 applications, or Tkinter). I have no idea how Flatpak would be able to "cut off" X11 support. But maybe we're on the wrong track with this being a regression? I found this post on the Qt forums from 2020 which seems to back up the idea that this is related to a missing library -- Of course in that post it was entirely unrelated to Flatpak, but it does back up the idea in my mind that Flatpak is preventing proper access to X11/Xwayland. In another, unrelated project, I found this discussion post. In it, the error message was slightly different: Finally, I tried running ProtonUp-Qt Flatpak with the following two environment variables:
And the results were interesting. Mainly, the last few lines:
I'm not well-versed in the lower level end of display managers to really comment on what's going on, but it really sounds like to me from all of this that Flatpak is explicitly blocking X11 backends on Wayland. If this really is what Flatpak is doing, the question becomes, how safe is this? As you mentioned:
I am not sure how likely such a scenario is, and I'm not confident enough to say that it's even unlikely, because truthfully I don't know. I use KDE and use Qt applications on a daily basis, and I haven't come across a case like this, and since we're running in a Flatpak container we should be able to assume that the runtime will function the same across distributions. The failure to load the X11 release on Wayland could be intentional. I suppose the real thing that would help put this to bed, is to test other Qt Flatpaks with this option, and see if they fall over... |
I think that is the case. The Flatpak Permissions Reference Page states following:
Flatpak uses a sandbox. Something like Firejail. I'm not sure what sandbox they are using in the background or if they have their own implementation. It is possible to block access to unix sockets (what x11 is using) and to the file system. That is also why xdg portals exist for example.
It kinda sounds like it is successfully loading the shared library but it will fail to execute without x11 and thus cannot be loaded.
Yeah, I guess we could check how other applications solve the issue. Older version of Qt defaulted to using X11 with GNOME even when Wayland was available, this is what caused the issue. It was however possible to force Qt to use Wayland anyway when it is available. Newer versions of Qt should not have this problem.
If there was a way to do this from inside the Flatpak, it would definitvly be a security vunerability in the sandbox. Spoofing from the "outside" should be possible, but that isn't applicable here. What we should probably do first is to check what other apps are doing about it. If there isn't any completely different solution out there to what we discussed above, we should then check if there is any case where Qt would use X11 even if Wayland is available. If there is no such case, we can replace In case there is any relevant case where Qt uses X11 over Wayland, we should delay the merger of this PR. By relevant I mean on a system that gamers are likely to use. Not some edge-case like Ubuntu 14.04 running Unity. They can still revert to using the AppImage.
There seem to be quite a few apps using Others were doing the same: flathub/org.plomgrading.PlomClient#94
Haven't found anything with a quick google search.... |
Resolves DavidoTek/ProtonUp-Qt#284.
Flathub now lists security/permission related information about Flatpaks. ProtonUp-Qt is flagged as "potentially unsafe" and one of the reasons for this is "using a legacy windowing system". This is caused by ProtonUp-Qt enabling the
x11
socket by default, instead of usingfallback-x11
.ProtonUp-Qt has a lot of things flagging it at time of writing, most of which we can't do much about: accessing specific files for installing compatibility tools to specific folders, "acquire arbitrary permissions" which is caused by some specific file permissions, and accessing devices for gamepad support. This legacy windowing system warning, however, is something we can hopefully resolve, provided issues related to Qt are fixed.
Previously, this had some issues due to a regression with Qt6, and was removed (0a4fd4e). We can use this PR to test. I tested myself with
fallback-x11
enabled andx11
disabled using Flatseal to do so, and tested the native Wayland support and forcing X11 support withQT_QPA_PLATFORM="xcb"
. Everything appeared to work fine in testing. I had this enabled for a while and actually completely forgot again, and it has worked with my general usage of ProtonUp-Qt that I didn't even realise this option was enabled. I confirmed when X11 was in use withxeyes
and also I could tell because Xwayland applications are blurry on my scaled display, whereas Wayland applications are crisp.Testing was conducted with ProtonUp-Qt Flatpak from Flathub, and primarily tested with the PySide6 6.5.2 bump, which fixed a all of window artifacting problems on scaled displays, so I would hope that if any issues were still present with older PySide6 versions, that they would now be fixed.