Martchus / syncthingtray

Tray application and Dolphin/Plasma integration for Syncthing
https://martchus.github.io/syncthingtray/
Other
1.54k stars 43 forks source link

Popup window opens in the middle of a screen on Wayland #170

Closed gudvinr closed 1 year ago

gudvinr commented 1 year ago

Relevant components

Environment and versions

Bug description I use tray version of syncthingtray under KDE Plasma 5.26.4 (Wayland).
When I click on tray icon, popup window appears in the middle of a screen.

Steps to reproduce

  1. Start tray app
  2. Click on tray icon

Expected behavior Popup window appears around tray area

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

Martchus commented 1 year ago

The lack of an API to allow applications to position themselves via absolute coordinates is not a bug but a "feature" of Wayland. There is no hope to circumvent this limitation anytime soon.

Note that I've already been trying to workaround the problem, see https://github.com/Martchus/syncthingtray/issues/157#issuecomment-1328249723 and subsequent comments. It is basically not possible/wanted.

So I must close this issue. I personally also find it quite sad to see the GNU/Linux desktop declining with Wayland, see https://github.com/Martchus/syncthingtray/issues/157#issuecomment-1331911395. However, there's nothing I can do about it within the scope of this project.

Note that adding support for a previously unsupported platform like Wayland would be a feature request as I would mainly be adding something new.

By the way, under Plasma you could workaround the problem easily by using the Plasmoid. Otherwise, hacks like https://github.com/Martchus/syncthingtray#workaround-positioning-issues-under-wayland might be possible on KWin as well (if you find such a hack, feel free to contribute to the README).

gudvinr commented 1 year ago

Okay. Thanks for explanation.

I was trying to set up window rule in KDE and noticed that window type is not popup but normal even though Popup is chosen in settings.

I am using debug console (qdbus org.kde.KWin /KWin org.kde.KWin.showDebugConsole) to see window type.

Martchus commented 1 year ago

I'm also seeing windowType = NET::Normal and popupWindow = false here regardless of the window type. Likely that's because the window is a top-level window.

Martchus commented 10 months ago

After 14 years we might eventually be able to fix this on Wayland after all: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/247

It is still a draft and maybe won't be accepted. Even if it will be accepted it will likely take a long time until there's support for it in Qt. So I'm keeping this issue closed for now.

Of course there's always the possibility to explore yet another hack: Just create a transparent fullscreen window, position the popup "relative" to that window and then close the fullscreen window again. It is a very silly approach but might work.

gudvinr commented 10 months ago

https://github.com/ProtonMail/proton-bridge/issues/273

I reported similar issue for other Qt app on wayland, there could be something useful there

Martchus commented 10 months ago

I had a brief look but it is hard to tell. It looks like a notification window was problematic here. So probably they have just switched to D-Bus-based notifications. That's something Syncthing Tray already does so there's no room for improvement here.

Martchus commented 9 months ago

Looks like 247 won't be approved. Maybe https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/249 will be instead.

handsomexdd1024 commented 6 months ago

I must say I observed a strange behaviour: With syncthing tray settings window opened, tray popup will show at the corner; closing the settings window and clicking tray icon again and popup window still appears in the centre.

Martchus commented 6 months ago

Really, just use the Plasmoid under Wayland.

I really cannot support every Wayland competitor, especially since Wayland decides to be the one special platform not supporting absolute positioning and reading mouse coordinates.

You can just let it show in a regular window or let it show the web UI directly for the "minimalist" experience Wayland's streamlining is supposedly trying to enforce here. (With Wayland, GNU/Linux is not a platform of freedom of choice anymore - at least when it comes to graphical applications and what they can do. The APIs are way more limiting than the ones of e.g. Windows.)