flathub / chat.delta.desktop

https://flathub.org/apps/details/chat.delta.desktop
12 stars 7 forks source link

chat.delta.desktop.yml: enable wayland, fallback-x11 #124

Closed Mikaela closed 9 months ago

Mikaela commented 10 months ago

Resolves: deltachat/deltachat-desktop#2800

flathubbot commented 10 months ago

Started test build 92965

flathubbot commented 10 months ago

Build 92965 failed

muelli commented 10 months ago

If the wayland socket is exposed, then, I believe, the x11 needs to become x11-fallback.

system socket is a bad idea in general. And in this case probably too. At the very least, I want a comment on the line giving the access to be added explaining or referencing why it's necessary. Best with a reference to a bug to track the progress towards removing that requirement.

flathubbot commented 10 months ago

Started test build 92966

Mikaela commented 10 months ago

If the wayland socket is exposed, then, I believe, the x11 needs to become x11-fallback.

This seems to be enough in my local testing without system bus.

Mikaela commented 10 months ago

I don't know if this is a wider issue, but with these changes I am unable to start DeltaChat without the wayland flags.

└┌(%:~)┌- LANG=en flatpak run chat.delta.desktop
[2:0112/105709.097068:ERROR:bus.cc(399)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
Logfile: /home/aminda/.var/app/chat.delta.desktop/config/DeltaChat/logs/2024-01-12-10-57-09.log
LaunchProcess: failed to execvp:
xdg-settings
LaunchProcess: failed to execvp:
xdg-settings
LaunchProcess: failed to execvp:
xdg-settings
LaunchProcess: failed to execvp:
xdg-settings
LaunchProcess: failed to execvp:
xdg-settings
LaunchProcess: failed to execvp:
xdg-settings
[2:0112/105709.543506:ERROR:ozone_platform_x11.cc(241)] Missing X server or $DISPLAY
[2:0112/105709.543529:ERROR:env.cc(255)] The platform failed to initialize.  Exiting.
└┌(%:~)┌- cat .local/share/flatpak/overrides/chat.delta.desktop 
[Context]
sockets=fallback-x11;wayland
muelli commented 10 months ago

I have vague memory of the app not being wayland-ready. It would probably require the non-sandboxed version to determine whether it should on pure Wayland.

flathubbot commented 10 months ago

Build 92966 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/75648/chat.delta.desktop.flatpakref
flathubbot commented 10 months ago

Started test build 92967

flathubbot commented 10 months ago

Build 92967 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/75649/chat.delta.desktop.flatpakref
Simon-Laux commented 10 months ago

Maybe look into how other electron apps do wayland in flatpak? Maybe we need to start electron with some extra arguments or sth like that? I doubt that this can be solved in the desktop repo, as flatpak does not use electron-builder in the packaging process (as far as I remember?)

flathubbot commented 9 months ago

Started test build 99670

Mikaela commented 9 months ago

As far as I can tell, this should just work. My previous comment was wrong as fallback-x11 only allows x11 to be used when wayland is unavailable and I cannot test that as I cannot make wayland unavailable.

The environment variable comes from https://www.electronjs.org/docs/latest/api/environment-variables#electron_ozone_platform_hint-linux

flathubbot commented 9 months ago

Build 99670 failed

flathubbot commented 9 months ago

Started test build 99697

flathubbot commented 9 months ago

Build 99697 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/82490/chat.delta.desktop.flatpakref
Simon-Laux commented 9 months ago

Just to confirm, this will also still work on x11? (Because I'm currently only testing on wayland myself)

Mikaela commented 9 months ago

Theoretically yes as long as you aren't logged into a wayland session, but I am unable to test as I don't keep x11 around.

Mikaela commented 9 months ago

GitHub Android refuses to reply to the review, but

and it's the default value, no? So I would be curious to learn why setting it is necessary.

No, the default value is x11.

muelli commented 9 months ago

No, the default value is x11.

ah, thanks! Sorry, I somehow misread the documentation there.

Simon-Laux commented 9 months ago

I tried it in my new beta branch #125.

works now when starting normally and with LC_ALL=C flatpak run chat.delta.desktop --enable-features=UseOzonePlatform,WaylandWindowDecorations,WebRTCPipeWireCapturer --ozone-platform=wayland (tested on fedora silver blue this time)

But now the whole app is blurry, this reminds me of running the flatpak on linux phones like the pine phone there it also was strangely blurry. do you have any ideas? can you also test the branch and see if it is blurry for you too?

Edit: the blur seems to be related to display scaling, when I set my system scaling to 100% there is no blurriness, but with other settings like 200% looks blurred. -> but other electron flatpak apps like vscodium have this problem too so maybe not a blocker

Simon-Laux commented 9 months ago

The blurriness seems to be this upstream chromium bug: https://issuetracker.google.com/issues/40267260 I happens on other electron apps and also on chromium itself when started with the --ozone-platform=wayland flag, it does not happen when started with --ozone-platform=x11

Update:

--disable-features=WaylandFractionalScaleV1 solves the blurriness, but now my mouse cursor is very small

maybe the code of https://gist.github.com/polter-rnd/2ec43fa03f67ca7c899b9742f93d020d#file-wayland-launch-sh-L27 could give a clue for a workaround to make the mouse bigger again?

Simon-Laux commented 9 months ago

https://github.com/flathub/chat.delta.desktop/pull/125 contains the changes of this pr and is ready for review now.

I decided for disabling WaylandFractionalScaleV1, as I believe a small mouse pointer is the lesser evil compared to a blurry interface.