jbuchermn / newm

Wayland compositor
MIT License
958 stars 31 forks source link

Syncthingtray window is immediately closed #153

Closed AlexD97 closed 1 year ago

AlexD97 commented 1 year ago

When clicking on the tray button of syncthingtray the window is opened and closed immediately. I also tried to add a rule with 'float': True but this does not help.

jbuchermn commented 1 year ago

Can you add a log when this happens?

AlexD97 commented 1 year ago

Here it is:

newm_log.txt

jbuchermn commented 1 year ago

I can't reproduce this as I'm not using syncthingtray and it appears to want some configuration to start up.

How did you configure the 'float': True rule? Can you paste the config? Does this only happen when starting this app fro, I presume, waybar? Or also when starting it from the terminal?

AlexD97 commented 1 year ago

Sorry, I could have looked into the GitHub Issues of syncthingtray: https://github.com/Martchus/syncthingtray/issues/157

The problem is that if the window/popup loses focus (which is immediately true if focus_follows_mouse is true) the window closes. It would be easy to make a workaround if it was possible to place (floating) windows relative to the cursor position.

jbuchermn commented 1 year ago

Can you confirm, that this is actually the issue? I.e. does it work when you disable focus_follows_mouse?

AlexD97 commented 1 year ago

It kinda works then. I need to double click on the icon (when clicking just once the window is still immediately closed).

jbuchermn commented 1 year ago

Interesting, maybe there's something else going wrong..

Double-clicking with focus_follows_mouse doesn't work at all?

AlexD97 commented 1 year ago

Double-clicking with focus_follows_mouse is working, too. In both cases however, this is a bit unreliable, sometimes I need triple-clicking. One can see that on the first click the window is opened and immediately closed, then on the second click it stays open (normally).

Martchus commented 1 year ago

I hope you've seen the workaround mentioned in the README: https://github.com/Martchus/syncthingtray#workaround-positioning-issues-under-wayland

Note that implementing this to work correctly under Wayland is unlikely to happen anytime soon. I must say my experience with Wayland as developer and user is a rather sad story so far (see https://github.com/Martchus/syncthingtray/issues/157#issuecomment-1328359307 and https://gitlab.freedesktop.org/xdg/xdg-specs/-/merge_requests/54#note_1664168). If anybody has ideas for improvement you're welcome.

AlexD97 commented 1 year ago

Thanks for the answer, @Martchus . Unfortunately I can't find the option to open in window mode in the appearance tab.

Martchus commented 1 year ago

Unfortunately I can't find the option to open in window mode in the appearance tab.

Settings -> Tray -> Appearance -> Window type -> Normal window

AlexD97 commented 1 year ago

Unfortunately I can't find the option to open in window mode in the appearance tab.

Settings -> Tray -> Appearance -> Window type -> Normal window

I don't have that option, see also the image: 20221209_17h31m36s_grim

Martchus commented 1 year ago

Looks like you're not using the latest release yet.

AlexD97 commented 1 year ago

I use version 1.3.0. Did you add this in 1.3.1?

Martchus commented 1 year ago

Yes, I added it in 1.3.1. I've also recently fixed drawing the background to be drawn like on a normal window. That fix has not been released yet.

By the way, it also looks like themed icons are not configured correctly in your Qt installation as only fallback icons are shown.

AlexD97 commented 1 year ago

Yes, I added it in 1.3.1. I've also recently fixed drawing the background to be drawn like on a normal window. That fix has not been released yet.

By the way, it also looks like themed icons are not configured correctly in your Qt installation as only fallback icons are shown.

Thanks. So for me the issue is gone with the window mode.

Martchus commented 1 year ago

Good that this is sufficient for you because due to the mentioned limitations you won't get a "tray window" (a small window spawning close to the tray icon) anyways. I'd just like to end with that note so nobody thinks that the normal behavior is actually fixed on Wayland.