ransome1 / sleek

todo.txt manager for Linux, Windows and MacOS, free and open-source (FOSS)
https://github.com/ransome1/sleek/wiki
MIT License
1.37k stars 105 forks source link

[Flatpak][Wayland] Crashes on startup #561

Closed ianbetteridge closed 11 months ago

ianbetteridge commented 11 months ago

Bug Report

IMPORTANT: Please follow this template strictly when reporting bugs. Providing detailed and accurate information helps the development team to understand and address the issue effectively.

**App Version: 2.0.1

Platform: Linux - Fedora 39 beta

Installation Method: Flatpak

Bug Description: Crashes on startup. When started from the terminal it gives this info back:

[2 zypak-helper] Wait found events, but sd-event found none [2:1101/183524.267929: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 config.ts: sleek userdata is located at: /home/ian/.var/app/com.github.ransome1.sleek/config/sleek/userData (node:2) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 change listeners added to [EventEmitter]. Use emitter.setMaxListeners() to increase limit (Use sleek --trace-warnings ... to show where the warning was created) [2:1101/183524.411341:ERROR:ozone_platform_x11.cc(240)] Missing X server or $DISPLAY [2:1101/183524.411348:ERROR:env.cc(255)] The platform failed to initialize. Exiting. The futex facility returned an unexpected error code.

SimonAulet commented 11 months ago

Same here, with same output from terminal running Ubuntu 22.04 (Wayland)

ransome1 commented 11 months ago

Thanks for reporting this, guys. The 2.0.1 release uses Wayland as a socket but has an X11 fallback. In theory this should not have happened :/ I'll look it into it as soon as I can.

ransome1 commented 11 months ago

@ianbetteridge are you using Wayland as well?

Could you both please double check what this command returns on your side? echo $XDG_SESSION_TYPE

ianbetteridge commented 11 months ago

@ransome1 Yep, wayland session. One additional interesting thing, though: I uninstalled the Flatpak version, and then installed Snap and the Snap version. And it works! It gave an error to start with (really sorry, I didn't screen grab it) but it appears to all be functional and everything works.

One thing about it though: I think it's falling back to Xwayland - not sure if that's expected or not? I have experimental fractional scaling turned on, and fonts in Sleek are just that little bit fuzzy, which tends to indicate it's using xwayland. But I could be totally wrong! :)

Happy to try uninstalling and reinstalling if you need some extra data.

ransome1 commented 11 months ago

@ianbetteridge the problem is that I know Linux only by its shell and have no experiences with Desktop Environments or Display server (or whatever Wayland and X11 are).

In 2.0.0 I declared the X11 socket in Flatpak manifest. This lead Flathub to show a huge warning on sleeks page about sleek being insecure, because it is using an old Display Manager, which I believe must have been a reference to X11. So I followed the instructions on Flatpaks documentation and switched to Wayland, but also defined the fallback-x11 socket to be available.

Unfortunately this leads to the issue at hand, which I don't understand, since you guys are using Wayland. The Flatpak should in theory be working flawlessly.

And the Flatpak doesn't seem to be generally broken. Some other Flatpak users are actually using sleek: https://github.com/ransome1/sleek/discussions/562#discussioncomment-7451838

I'm not sure how to proceed here tbh. Maybe I will get in touch with the Flathub guys, they are usually super helpful.

ransome1 commented 11 months ago

I talked to the Flatpak guys and they promptly helped out. Apparently Electron apps (Idk if in general or just the Flatpaks) won't work well with Wayland. Thus for now I need to rebuild it with X11 only support :(

I assume we will need to wait until Wayland and Electron are becoming more compatible.

I am happy to hear, that the Snap at least works for you. I can only assume, that the error you've seen is one known bug. It occurs on Linux only, when you unmaximize the application, after it was maximized. Can you try to do that and give me some feedback, if this is the error you saw earlier?

ianbetteridge commented 11 months ago

If you rebuild with X11 that should be fine - it will run under Wayland anyway, just using the Xwayland system (which lets X apps run under Wayland). Will have a poke around and see if I can replicate the Snap errors I saw.

ransome1 commented 11 months ago

Also the latest Snap and Flatpak include a fix in case it was the unmaximise window bug