-
-
Notifications
You must be signed in to change notification settings - Fork 305
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
Wayland support #958
Comments
Hey, previous Qt Wayland maintainer here. Since a lot of potentially different issues were closed and linked to this one, I'll try to summarize what I know. Most of the segfault reports linked to this one seems to be due to X11 code for the hotkey manager being called directly on linux without checking whether wayland or x11 was used. It was recently fixed in #804 . So these crashes should not be an issue anymore. If you have problems after that patch, it's probably a good idea to send logs with
Set in the environment, which should hopefully give a lot more information about what went wrong. Also note that many X features do not have a direct replacement in wayland, two of which are important for apps like Albert: 1. Registering global key listeners is not possible on WaylandAllowing apps without window focus to listen to key strokes is considered insecure on Wayland. This is in order to have the possibility to sandbox apps that you don't trust completely. I.e. similar to what android does. Unfortunately there is (as far as I know) no standard way for apps to request this sort of permission. This means that each compositor handles global shortcut key configuration in their own way, and you need to check how it's done on your compositor and make it run TL;DR: Global key shortcuts are configured in the compositor on Wayland. 2. Positioning a window on the screen is not allowed in xdg-shell (the desktop wayland protocol).Qt has APIs for positioning a window, i.e. As for albert, I guess the issue is that you probably want the window to be handled somewhat specially and always appear in the same position (i.e. centered), which may not be what the compositor has in mind for it. i.e. it may just put the window somewhere where there is free space. Or tile it, or whatever. Solving this is not currently possible without resorting to some kind of hack, like asking to be maximized and draw a mostly transparent window with albert centered in the middle, and you're still not guaranteed the compositor will honor your request to be maximized. There was some effort done in trying to solve these kinds of issues properly by creating an alternative wayland shell protocol, https://github.com/swaywm/wlr-protocols/blob/master/unstable/wlr-layer-shell-unstable-v1.xml that did allow some of these things. It's implemented in Sway, and even some prototyping was done to support it through Qt. If memory serves me, some of the other launcher apps (not Qt-based, though) use this shell to work properly on sway. Another way would be to try to write an extension for xdg-shell to add absolute window positioning. This would likely be easier to implement and get merged into Qt, but getting it into wayland protocols will probably be a lot harder. TL;DR: Wayland is the only desktop that doesn't allow apps to set their own screen position, which means neither Qt nor albert has any control over where the albert window appears. The pragmatic solutionMost wayland compositors support X11 apps through XWayland. If you launch albert with If someone wants to work on this, I would recommend asking the sway developers (they've been involved in lots of great other standardization work for the desktop, like middle-mouse pasting and server-side window decorations) what they think and if there's anything you can do to help standardization and adoption of the protocols needed to get albert working properly on Wayland. |
@johanhelsing excellent summary. I may take wisdom to a different project. Thank you. One question:
Why should "compositor to decide how to arrange windows."? The logic here is avoiding me. You have many use cases where you want to have windows in certain places like monitoring, logs, mails, launcher, etc. Why those applications can not sent hints that the user wants to have it there? The compositor should, if possible, listen to the wishes of the user. |
I can only speculate, personally I think a soft hint would have been great, but these are some possible reasons:
Tiny disclaimer: I haven't worked with Wayland or Qt for a couple of years, so some of this might have changed recently. I suspect the extension standardization process is a lot easier now than it used to be for instance. |
For anyone coming here because they tried out Wayland (KDE Plasma in my case) and suddenly their beloved Albert did not seem to work anymore, @ManuelSchneid3r has explained how shortcuts are handled very differently in this comment. I want to add that the way you do this in KDE Plasma is simply to go into the settings -> Shortcuts -> Add Application -> Here, you type the command "albert toggle" and click "Ok" -> Now a new entry appeared in the "Applications" section under Shortcuts. Click on it -> Custom shortcut -> Press the key you want to use to open Albert -> Hit apply and you're good. Now you can use Albert as expected. The only little problem I have with the latest version 0.19.2 is that the search bar that opens is slightly off-center on subsequent toggles and often times it doesn't show up on the correct monitor. If it helps, I have two monitors connected and it tends to prefer showing up on my second (non-primary) monitor, even if I click and have my cursor on the primary monitor. So it's not quite perfect as of now, but damn I'm happy to keep enjoying Albert. What a great application! |
I'm on Ubuntu 23.04 and I experienced an issue regarding albert not recognizing keyboard inputs when I open albert with a shortcut. What fixed it for me was to change the exec command in the |
This introduces several other issues. wayland QPA is not supported atm. https://packages.ubuntu.com/search?suite=lunar-updates&keywords=gnome yields gnome 44 which introduces this bug: #1231 See also https://gitlab.gnome.org/GNOME/mutter/-/issues/2690 |
The above mentioned mutter bug seems to be fixed from what I can tell. Does that mean Albert should work fine on wayland when used as described by christoph2497? |
Why not use the Global Shortcut's Portal. It's kind of the only way to actually register a hotkey on Linux and it works on X11 and Wayland. |
Nobody implemented it yet. |
+1 for the support of layer shell under wayland; with the help of layer-shell-qt maybe? |
This is a parent issue to agglomerate all the wayland issues.
Wayland and Qt Wayland are far from mature. I know Wayland is quite popular and I'd like to support it but working with it is simply a pain and incredibly (and I mean incredibly, honestly other platforms just work out of the box) time consuming. Thats why I decided to not support Wayland officially.
The minimum OOTB experience I expect to consider supporting Wayland again is (at least):
The text was updated successfully, but these errors were encountered: