[Bug]: plasma wayland sys tray popup window in wrong position
⚠️ Before submitting, please verify the following: ⚠️
- [X] This is a bug, not a question or a configuration issue.
- [X] This issue is not already reported on Github (I've searched it).
- [X] Nextcloud Server and Desktop Client are up to date. See Server Maintenance and Release Schedule and Desktop Releases for supported versions.
- [X] I agree to follow Nextcloud's Code of Conduct
Bug description
When clicking the system tray icon for the desktop client in plasma wayland it pops up in the middle of the screen rather than over the system tray icon. ...
Steps to reproduce
- I'm using opensuse Tumbleweed with Plasma 6 wayland I also have 3 monitors, but panel is only on 1 display
- click the nextcloud desktop client system tray icon
- popup window opens in middle of screen ...
Expected behavior
Should open above system tray icon ...
Which files are affected by this bug
no files are affected
Operating system
Linux
Which version of the operating system you are running.
opensuse Tumbleweed
Package
Other
Nextcloud Server version
na
Nextcloud Desktop Client version
3.12.3
Is this bug present after an update or on a fresh install?
Fresh desktop client install
Are you using the Nextcloud Server Encryption module?
Encryption is Enabled
Are you using an external user-backend?
- [X] Default internal user-backend
- [ ] LDAP/ Active Directory
- [ ] SSO - SAML
- [ ] Other
Nextcloud Server logs
n/a
Additional info
Operating System: openSUSE Tumbleweed 20240524 KDE Plasma Version: 6.0.4 KDE Frameworks Version: 6.2.0 Qt Version: 6.7.0 Kernel Version: 6.9.1-1-default (64-bit) Graphics Platform: Wayland Processors: 32 × AMD Ryzen 9 7950X3D 16-Core Processor Memory: 30.5 GiB of RAM Graphics Processor: NVIDIA GeForce RTX 4090/PCIe/SSE2 Manufacturer: Gigabyte Technology Co., Ltd. Product Name: X670E AORUS PRO X System Version: -CF
I have the same problem using EndeavourOS (which uses KDE+Wayland). I previously used Manjaro (KDE) which used X11 and the problem didn't happen there, so this issue seems to be specific to systems using Wayland.
Monitor configuration: 1x 3840x2160 @ 125%DPI @ 60Hz Nextcloud Desktop Client version: 3.13.0
Operating System: EndeavourOS KDE Plasma Version: 6.0.5 KDE Frameworks Version: 6.2.0 Qt Version: 6.7.1 Kernel Version: 6.9.3-arch1-1 (64-bit) Graphics Platform: Wayland Processors: 32 × AMD Ryzen Threadripper PRO 5955WX 16-Cores Memory: 125,6 GiB of RAM Graphics Processor: NVIDIA GeForce RTX 3080 Ti/PCIe/SSE2 Manufacturer: ASUS
Related: #6776
Same with Linux Mint XFCE 22 and 3.14.1 client.
I'm using Linux Mint Cinnamon:
System:
Kernel: 6.8.0-47-generic arch: x86_64 bits: 64
Desktop: Cinnamon v: 6.2.9 Distro: Linux Mint 22 Wilma
Machine:
Type: Desktop System: ASUS product: All Series v: N/A
serial:
And see this as well. If I click on the NextCloud systray icon the window pops up in the top left of my enormous 43" 4K monitor, and if I right-click the popup menu likewise pops up in the far top left, and if I click Settings on that again same deal. Under X11 these all pop up right beside the systray button as expected.
Can confirm this with KDE Neon 6.2 and 3.15.0 client.
Nextcloud developers, it might be a good idea to join the discussion of the new tray specs
https://gitlab.freedesktop.org/xdg/xdg-specs/-/issues/84 https://gitlab.freedesktop.org/xdg/xdg-specs/-/merge_requests/54 https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/355
Same issue on KDE 6 Wayland on Opensuse Tumbleweed. Tried both the flatpak and the yast one click install version. Anyone got a fix?
Positioning on Wayland is tricky, let alone figuring out *where* it should be positioned (somewhat near the tray icon ideally -- on Linux/X11 we used the global cursor position on the screen for that, which is not a thing Wayland supports unfortunately)
That being said, it is somewhat possible, but it's super specific to the currently running compositor/desktop environment. for Plasma desktops a combination of DBus calls and some Plasma scripting lets me figure out where to position the window on the screen, and using KWayland (which as far as I can tell is mostly specific to KWin/Plasma as well) I can move that window surface anywhere I want to...
Same problem on archlinux. Unfortunately the window closes as soon as it loses focus, so i can't use the window picker to get the window class to set up a custom kwin rule as a workaround either.
i wrote a small kwin script to log any windows opening and closing and got the window class that way: com.nextcloud.desktopclient.nextcloud
Here's a window rule which should fix this:
[Nextcloud tray positioning]
Description=Nextcloud Tray Positioning
position=1077,323
positionrule=2
title=Nextcloud
titlematch=1
wmclass=com.nextcloud.desktopclient.nextcloud
wmclassmatch=2
Just save this as a .kwinrule file and import it in System Settings. (You might need to adjust the position according to your display.)
Nextcloud developers, it might be a good idea to join the discussion of the new tray specs
https://gitlab.freedesktop.org/xdg/xdg-specs/-/issues/84 https://gitlab.freedesktop.org/xdg/xdg-specs/-/merge_requests/54 https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/355
The current model of systrays that NextCloud works on is not currently compatible with the Wayland model, and its not suitable for Linux mobile phones. I believe that it's unlikely for any proposals for this to be adopted in Wayland.
Currently in the Wayland space, the new background apps model based on XDG Background portal are more appealing for adoption
Read: https://gitlab.freedesktop.org/xdg/xdg-specs/-/issues/84
It would be great if Netcloud can adapt to this new model of defining a state and actions to be displayed by the desktop bar when running in the background (no need for a GUI here, the desktop is responsible for displaying those), and to have a separate real normal desktop window for managing settings and showing detailed informations. The current systray widget model will always give a bad UX, whether it was by showing arbitrary foreign widgets from the desktop bar, or have a confusing effect in the mobile phone space.
I still notice this issue on 3.17.2. I know it'd require extra dev time, but a plasmoid in the system tray for Plasma would be a great alternative to view sync status/notifications. (Not sure where the search function would be in this version - but that could be integrated into KRunner instead.)
I wanted to report an more or less easy fix on Arch, KDE Plasma 6.5, Wayland. All the Rule Settings did not work well for me.
I installed in the "Window Behaviour" a KWin Script. (by the way this plugin is awesome) https://store.kde.org/p/2324743
Then open the Nextcloud tray Popup Window and go into the "Settings" menu, which you can reposition. Position the Nextcloud Settings Window in the position which you want to have the Nextcloud Popup appear and then close the settings window. Now the Nextcloud popup will appear at the same position.