Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 of 6 tasks
gudvinr opened this issue Jan 3, 2023 · 9 comments
Closed
1 of 6 tasks

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

gudvinr opened this issue Jan 3, 2023 · 9 comments

Comments

@gudvinr
Copy link

gudvinr commented Jan 3, 2023

Relevant components

  • Standalone tray application (based on Qt Widgets)
  • Plasmoid/applet for Plasma desktop
  • Dolphin integration
  • Command line tool (syncthingctl)
  • Integrated Syncthing instance (libsyncthing)
  • Backend libraries

Environment and versions

  • Versions of syncthingtray, qtutilities and c++utilities: 1.3.2, 6.10.0, 5.20.0
  • Qt version: 5.15.7
  • C++ compiler (name and version): gcc 12.2.0
  • C++ standard library (name and version): whatever comes with gcc 12.2.0 I guess
  • Operating system (name and version): Arch Linux

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.

@gudvinr gudvinr added the bug label Jan 3, 2023
@Martchus Martchus changed the title Popup window opens in the middle of a screen Popup window opens in the middle of a screen on Wayland Jan 3, 2023
@Martchus
Copy link
Owner

Martchus commented Jan 3, 2023

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 #157 (comment) 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 #157 (comment). 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).

@Martchus Martchus closed this as completed Jan 3, 2023
@gudvinr
Copy link
Author

gudvinr commented Jan 3, 2023

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
Copy link
Owner

Martchus commented Jan 3, 2023

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
Copy link
Owner

Martchus commented Sep 28, 2023

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
Copy link
Author

gudvinr commented Sep 28, 2023

ProtonMail/proton-bridge#273

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

@Martchus
Copy link
Owner

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
Copy link
Owner

Martchus commented Oct 9, 2023

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

@handsomexdd1024
Copy link

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
Copy link
Owner

Martchus commented Jan 7, 2024

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants