tsujan / FeatherNotes

Lightweight Qt Notes-Manager for Linux
GNU General Public License v3.0
109 stars 22 forks source link

Tray Icon Not Working On "Wayland" #280

Closed DanteIgashu closed 2 years ago

DanteIgashu commented 2 years ago

Hi! : D

System Info:

KDE Plasma Version: 5.25.5 KDE Frameworks Version: 5.97.0 QT Version: 5.15.6 Kernel Version: 5.19.7-arch-1(64-bit) Graphics Platform: Wayland

Expected Behavior: See the "Add to systray" and "Start iconified to tray" functions working as normal

The Bug: The app opens and shows "System tray is not available. Please disable tray in Preferences" at the bottom of the window, and once you close the app it doesn't go to system tray, it just closes the app.

Additional Info: Those functions work just fine under X11 The problem started after updating the system like a week before I posted this post (sorry but I don't remember when nor what got updated that could be causing this problem)

Do you need a log file? If so, where and/or how do I get it?...

THANKS in advance! :D

tsujan commented 2 years ago

Yes, I've seen that. It's an issue/regression in Plasma 5.25.5: the tray is started too late in Plasma-Wayland. You can check that by starting FeatherNotes from the main menu.

You could make a bash script that starts FeatherNotes with a long enough delay — by using sleep in it — and add it to startup.

tsujan commented 2 years ago

BTW, I'm using FeatherNotes under Wayfire + Waybar (the first is a Wayland compositor and the second provides a tray under it). There's no issue with the tray here.

Wayfire also allows the user to assign fixed positions to apps of his choice. Since no app can set its position under Wayland, that's an advantage. I don't remember if Plasma-Wayland could do it too.

DanteIgashu commented 2 years ago

Thanks for the help! :D

The sleep command worked just fine by adding it to the "feathernotes.desktop" file to "autostart" the app, the one located at "/home/user/.config/autostart/. I just had to change this line from this:

Exec=feathernotes %f

to:

Exec=bash -c "sleep 60 && feathernotes %f"

the "60" practically meaning "delay the launch of the app by 60 seconds after login", and it solved the problem. Here's this info in case someone finds it useful.

It seems to be a problem related to slow machines that take a long time to load a session on KDE Plasma, but I don't really know why, it was working fine until a couple of weeks ago.

tsujan commented 2 years ago

It seems to be a problem related to slow machines that take a long time to load a session on KDE Plasma

No. My computer isn't slow, and yet I've seen the same thing randomly and only with Plasma-Wayland 5.25. Moreover, the problem doesn't exist in Plasma-X11 or Plasma-Wayland < 5.25.

FeatherNotes waits 20 seconds for the tray before assuming that it doesn't exit. A tray that isn't available in 20 seconds after the login has a serious problem.