flathub / com.vscodium.codium

https://flathub.org/apps/details/com.vscodium.codium
95 stars 20 forks source link

X11 applications in Wayland cannot be run in VSCodium #317

Closed NetDwarf closed 3 months ago

NetDwarf commented 6 months ago

I just upgraded and X11 (GUI) applications (Avalonia UI specifically) fail to start with the following error:

Unhandled exception. System.Exception: XOpenDisplay failed

The error happens under Wayland, when starting an X11 application in VSCodium. It was introduced with #300 and is fixed by this.

The issue is mostly the assumption in #300 that nosocket=waylaynd is not needed and the wording in the README:

If you have problems to start this flatpak under X11 please run one of these two commands and try again

As it happens under Wayland as well.

noonsleeper commented 6 months ago

Hi @NetDwarf, can you elaborate more about your problem?

NetDwarf commented 6 months ago

Hi @NetDwarf, can you elaborate more about your problem?

I am not sure what to elaborate on. I am in Wayland and compile/open an Avalonia GUI application (X11). This fails since #300 (VSCodium running on Wayland by default instead of X11). It's not unexpected, but the README should be updated accordingly to warn Wayland users.

noonsleeper commented 6 months ago

300 is about nosocket=x11 that was rejected by the flathub admins not about wayland.

Maybe will be good if you add some steps to reproduce this issue.

NetDwarf commented 6 months ago

I am wrong. It was #298 . To reproduce:

1.) Run Wayland (Gnome in my case) 2.) Download VSCodium 3.) Start an X11 application from within VSCodium

Result: App crashes, because of no display.

Again, this is expected, but the README should reflect that.

noonsleeper commented 6 months ago

@NetDwarf, now is more clear. Can you make that changes on the README and make a PR?

NetDwarf commented 6 months ago

It seems there is actually a direct mitigation without user interaction. Disabling fallback-x11 actually fixes the problem as in #322

noonsleeper commented 3 months ago

Hi @NetDwarf, there is no intention to roll back to X11, but like I mention you can add to the README.md your case and how you can make it work.

NetDwarf commented 3 months ago

The fix makes it possible to run X11 applications inside a Wayland session.

More precisely to run a compiled GUI X11 application inside VSCodium under Wayland. So it does not roll back to X11. It just makes it compatible with X11 applications running in Wayland.

noonsleeper commented 3 months ago

When I was trying to revert permissions from socket=wayland,fallback-x11 to socket=X11,wayland (the latter set) flathub's admins doesn't allow me to do that, they ask me to return to X11 only or stay on wayland,fallback-X11 then we can't go back to the later set of permissions, but you can add in the README.md file a little explanation and the instructions to revert the current default set of permissions to socket=wayland,X11 for any user that have the same problem. What do you think?

NetDwarf commented 3 months ago

When I was trying to revert permissions from socket=wayland,fallback-x11 to socket=X11,wayland (the latter set) flathub's admins doesn't allow me to do that, they ask me to return to X11 only or stay on wayland,fallback-X11 then we can't go back to the later set of permissions, but you can add in the README.md file a little explanation and the instructions to revert the current default set of permissions to socket=wayland,X11 for any user that have the same problem. What do you think?

If the actual fix cannot be incorporated the course of action is to add it to the README, so it's logical and also likely going to be the quickest/easiest way to resolve this issue.

It's still not entirely clear to me why this is not possible tho, as many applications on Flathub run with this permissions out of the box. Some examples:

PS.: The PR is currently changed to README workaround. If the actual fix is somehow possible, it can be easily reverted to the old PR.

noonsleeper commented 3 months ago

It's still not entirely clear to me why this is not possible tho, as many applications on Flathub run with this permissions out of the box.

Because they did not change these permissions recently, then they don't have to pass the new review system, see https://docs.flathub.org/blog/improved-build-validation/

NetDwarf commented 3 months ago

It's still not entirely clear to me why this is not possible tho, as many applications on Flathub run with this permissions out of the box.

Because they did not change these permissions recently, then they don't have to pass the new review system, see https://docs.flathub.org/blog/improved-build-validation/

Thanks for the link.

I am going to close this issue then since there is no further resolution from what I can tell.