-
Notifications
You must be signed in to change notification settings - Fork 29
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? #47
Comments
I'm sure there's much more to it than this, but it looks like |
So glad to hear that Wired is working on Wayland! Thanks for the report. I thought that notifications would need to be handled by the WM or something in Wayland, but this seems silly now thinking about how dbus works. Indeed winit does support Wayland, but we're using a few X11 things to make stuff work properly, which we'd have to find equivalents for on Wayland. The main ones I can think of are creating our cairo surface (I believe this was to support transparency): wired-notify/src/rendering/window.rs Lines 132 to 153 in 549e595
And setting the X11 window types (there must be alternatives for these): wired-notify/src/rendering/window.rs Lines 113 to 116 in 549e595
I'll get around to looking for how to get around those eventually. |
Ah, I hadn't even looked into transparency at all, but I assume others on wayland will probably want this :) The other thing I can think of is the idle-behaviour, I'm not sure if this is already being done in a systemd/logind/dbus way or if that's being done in an X11/XSS-specific way? 🤷 |
Idle behavior is currently done using XSS, bah! |
Is there any way to have monitor following in Wayland? |
Please note that 'it works on Wayland' is probably only because Xwayland is also running. If you start Sway with Transparency is trippy indeed, I suspect (based on what I've tried) that only either completely transparent or completely opaque is supported at the moment, using the Also I notice that notifications that are configured to anchor anywhere other than top-left, are first displayed TL before being moved somewhere else (at least, that's my assumption, I can only report a flash of the notification at TL). |
Yeah, XWayland is definitely doing some heavy lifting. I'm not quite in a position to properly support Wayland yet, as I think it would require a lot of research to get it there. I'm open to PRs getting us most of the way there or similar. Regarding the top left thing, this should be fixed on master (see #71). I've been slow at getting releases out, apologies. I'll try to release one tonight. |
No problem at all! I thought the 'top left thing' would also be caused by Wayland, didn't see that issue there, sorry for that. |
May I ask what the current state is? |
No progress. I'm not really working on this anytime soon. I'm open to any pull requests in this area. What are the actual issues at the moment? Monitor following doesn't work, and transparency? |
Yes, and it looks like one of the actual issues is that it runs on XWayland instead of native Wayland, because of the 2 pieces of code you posted above I believe. You might need to replace them with an X/Wayland agnostic call, maybe by using winit. |
I think our options are:
|
Thanks for the research! Option 1 is ideal, and I think it's doable. It definitely should be possible to get a cairo context from a wayland window -- well, it is possible since dunst does it. Cairo does seem to support EGL, I think it's just not documented well. I also can't find anything about it in the Assuming we can find a way to call
I'll update if I find anything more regarding cairo EGL. |
It looks like we could maybe also just use a regular cairo image surface and upload it to the window somehow (https://www.cairographics.org/OpenGL/). But this sounds like much more hassle than just having an actual surface. |
This could be promising (however C, not Rust): https://cairo.cairographics.narkive.com/sz0ZifFB/to-wayland |
This project intrigued me, especially after seeing that it’s flexible enough to display this #63 (comment). Unfortunately, no native Wayland support is a deal breaker. :( This is not a criticism, I just wanted to let you know that this feature is really wanted. |
Any updates on this? |
I was hoping the new release of cairo would unblock us in an obvious way, but it doesn't look like it:
That said, I'm not familiar enough with cairo to really know either way It does look like GTK itself wants to stop using cairo, which rules out a previous idea I had about us adopting GTK here as a path to getting a wayland-compatible cairo setup: https://blog.gtk.org/2023/09/19/paths-in-gtk/ |
hm.. would it be worth to maybe switch to another gui-framework like |
I think if we want to use wayland we should just bite the bullet and render to a surface in memory, then blit the result to whatever context wayland/x11 gives us. It's an extra copy, but it's probably worth it. I'm also unsure if transparency will work properly. Worth mentioning that there may be a way to draw to the wayland context directly like how we do now with xlib, if we wrote some bindings or something, but I'm not familiar enough with how things plug together here to make it work (if it can). |
Howdie, thanks so much for sharing your work here,
wired
is working terrifically for me! <3I thought I'd create a dedicated issue for this conversation ( although there are mentions #34 (comment) and #34 (comment) )
I've been using
wired
with bothsway
andriver
compositors (wayland) and I'd like to report that it's working very wellI do see fuzzy font issues when running it on a high-density display with scale=2.0 , which is typical when running an X11 application via
xwayland
within a wayland compositorThat said, for my use case, I read a notification quickly and then it goes away, I'm not reading this fuzzy text for very long so it doesn't seem super important to me
So, yeah, I thought maybe it would be good to track a decision/reports/progress on wayland, if only to address the fuzzy fonts at scale=2.0 (might become more of a problem as more distributions go wayland-by-default)
Thanks again!
Edit: adding this checklist (to help summarise items from comments)
minimum required to start without crashing and to display something
winit::event_loop::EventLoop::new()
instead ofwinit::event_loop::EventLoop::new_x11()
focus_follows: Mouse|Window
should only be interrogated when layouts specifymonitor: -1
(would help unblock some wayland use cases, and is a possible optimisation), see: fix: only get active monitor when necessary #89feature parity for wayland
focus_follows: Mouse
functionality depends onget_active_monitor_mouse()
, need to use equivalent Wayland protocols when necessaryfocus_follows: Window
functionality depends onget_active_monitor_keyboard()
, these need to use equivalent Wayland protocols when necessaryorg_kde_kwin_idle
wayland protocol for KDE (and compatible with wlroots e.g. sway)wired
over GNOME's built-in notifications)The text was updated successfully, but these errors were encountered: