cryptomator / cryptomator

Multi-platform transparent client-side encryption of your files in the cloud
https://cryptomator.org
GNU General Public License v3.0
10.94k stars 961 forks source link

Cryptomator running with native wayland #985

Open FritzJo opened 4 years ago

FritzJo commented 4 years ago

Description

Hello everyone, I'm trying to get Cryptomator to work without X11 in my wayland (sway) session on Arch Linux. What i've tried so far:

I'm almost certain at this point that this is a problem with JavaFX rather than with Cryptomator, but i want to be sure. Is there anyone running this application exclusively with wayland and what are other options i could try?

System Setup

Steps to Reproduce

  1. Use Wayland without XWayland
  2. Build the latest version of Cryptomator from source
  3. Execute the launcher script

Expected Behavior

Application starts and GUI opens

Actual Behavior

Application throws an exception and terminates

Reproducibility

always

Additional Information

Log:

-> ./launcher-linux.sh

00:10:16.074 [main] DEBUG org.cryptomator.common.Environment - java.library.path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
00:10:16.082 [main] DEBUG org.cryptomator.common.Environment - user.language: en
00:10:16.082 [main] DEBUG org.cryptomator.common.Environment - user.region: null
00:10:16.082 [main] DEBUG org.cryptomator.common.Environment - logback.configurationFile: null
00:10:16.082 [maa00:10:16.074 [main] DEBUG org.cryptomator.common.Environment - java.library.path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
00:10:16.082 [main] DEBUG org.cryptomator.common.Environment - user.language: en
00:10:16.082 [main] DEBUG org.cryptomator.common.Environment - user.region: null
00:10:16.082 [main] DEBUG org.cryptomator.common.Environment - logback.configurationFile: null
00:10:16.082 [main] DEBUG org.cryptomator.common.Environment - cryptomator.settingsPath: ~/.config/Cryptomator/settings.json
00:10:16.082 [main] DEBUG org.cryptomator.common.Environment - cryptomator.ipcPortPath: ~/.config/Cryptomator/ipcPort.bin
00:10:16.082 [main] DEBUG org.cryptomator.common.Environ00:11:34.739 [main] DEBUG org.cryptomator.common.Environment - java.library.path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
00:11:34.744 [main] DEBUG org.cryptomator.common.Environment - user.language: en
00:11:34.744 [main] DEBUG org.cryptomator.common.Environment - user.region: null
00:11:34.744 [main] DEBUG org.cryptomator.common.Environment - logback.configurationFile: null
00:11:34.744 [main] DEBUG org.cryptomator.common.Environment - cryptomator.settingsPath: ~/.config/Cryptomator/settings.json
00:11:34.745 [main] DEBUG org.cryptomator.common.Environment - cryptomator.ipcPortPath: ~/.config/Cryptomator/ipcPort.bin
00:11:34.745 [main] DEBUG org.cryptomator.common.Environment - cryptomator.keychainPath: null
00:11:34.745 [main] DEBUG org.cryptomator.common.Environment - cryptomator.logDir: ~/.local/share/Cryptomator/logs
00:11:34.745 [main] DEBUG org.cryptomator.common.Environment - cryptomator.mountPointsDir: ~/.local/share/Cryptomator/mnt
00:11:34.903 [main] DEBUG org.cryptomator.common.settings.SettingsProvider - Attempting to load settings from /home/xxxx/.config/Cryptomator/settings.json
00:11:35.035 [main] INFO  org.cryptomator.launcher.Cryptomator - Starting Cryptomator 1.5.0-SNAPSHOT on Linux 5.2.18.a-2-hardened (amd64)
Exception in thread "main" java.awt.HeadlessException:
No X11 DISPLAY variable was set,
but this program performed an operation which requires it.
        at java.desktop/java.awt.Desktop.getDesktop(Desktop.java:301)
        at org.cryptomator.ui.launcher.UiLauncher.launch(UiLauncher.java:59)
        at org.cryptomator.launcher.Cryptomator.runGuiApplication(Cryptomator.java:94)
        at org.cryptomator.launcher.Cryptomator.run(Cryptomator.java:77)
        at org.cryptomator.launcher.Cryptomator.main(Cryptomator.java:50)
purejava commented 4 years ago

I think I do not understand what you mean by Use Wayland without XWayland. For me, choosing between XOrg and Wayland is choosing one of the options on my display manager:

Bildschirmfoto 2019-10-12 um 14 26 40

Doing this, I can run Cryptomator without issues on Wayland. Unless I am missing something here. The exception thrown in your case says that the DISPLAY environment variable is not set.

[ralph@fusion ~]$ printenv | grep DISPLAY
WAYLAND_DISPLAY=wayland-0
DISPLAY=:0
[ralph@fusion ~]$

Could you try the command printenv | grep DISPLAY on your installation and post the output here to see if it's set in your case please?

FritzJo commented 4 years ago

bash printenv | grep DISPLAY returns nothing.

i dont have the display variable set, because i don't have Xorg installed. if you choose a wayland session with Gnome, it automatically uses xorg for applications that don't support wayland yet (thats the magic of xwayland). But i'm using Sway as a window manager (like i3, but written for wayland) without Xorg and therefor i don't have access to xwayland as a compatibility layer.

All GTK and QT applications run without any issues, because those platforms already support wayland. Thats why i'm not sure, if this problem is actually a cryptomator problem.

overheadhunter commented 4 years ago

According to this mailing list, there is no direct wayland support. However, the answer is three years old...

infeo commented 4 years ago

@FritzJo If it is feasible, a workaround would be to activate xwayland. According to the documentation its just a config line away: xwayland enable

But since you stressed out that you do not have the compability layer installed...

FritzJo commented 4 years ago

Its definitely a feasible workaround. I just wanted to be sure, that there isn't any way to get Cryptomator running without the compability layer. So i guess I'll be using this solution for now. Thanks!

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

pinophyta commented 3 years ago

Is wayland support planned?

overheadhunter commented 3 years ago

If by "wayland support" you mean "wayland without xwayland", the answer is (as far as I can tell): No.

Quoting OpenJFX's project lead @kevinrushforth:

JavaFX does not currently support Wayland. Even when we do, it will be done using the X11 support in Wayland (XWayland). Supporting Wayland natively would be a very large effort, which is currently unplanned.

(Source: JDK-8232949)

overheadhunter commented 3 years ago

Maybe something is moving: https://twitter.com/openjdk/status/1412786940164902915

cnmicha commented 2 years ago

@overheadhunter Native Wayland support is especially a benefit for users who have multiple screens with different fractional scaling factors (e.g. one screen has 1.5, a second one 1.0), which is possible thanks to Wayland. (Windows supports this feature for years.)

Although the XWayland compatibility layer respects the scaling, it does this by "emulating" a lower resolution to the X application. UI elements get bigger, but due to the low resolution, everything looks very pixelated.

This is how Cryptomator looks with a 1.5 scaling factor:

image

(For sure I am aware that this feature is depending on the JavaFX team and not on you. I just wanted to present a clear benefit of Wayland compared to X11.)

BirdInFire commented 1 year ago

it's funny when X will be removed they will be the one in panic because nothing work.... like always

BirdInFire commented 1 year ago

no advance ?

overheadhunter commented 1 year ago

Locking this conversation to avoid such useless comments. We will update this, as soon as something changes upstream.

overheadhunter commented 1 year ago

There seems to be some progress:

https://wiki.openjdk.org/display/wakefield/