wayland: use ext-background-effect if available#4496
wayland: use ext-background-effect if available#4496HigherOrderLogic wants to merge 1 commit intorust-windowing:masterfrom
ext-background-effect if available#4496Conversation
377fce3 to
f9a25e9
Compare
| /// - **Android / iOS / X11 / Web / Windows:** Unsupported. | ||
| /// - **Wayland:** Only works with org_kde_kwin_blur_manager protocol. | ||
| /// - **Wayland:** Only works with `org_kde_kwin_blur_manager` and | ||
| /// `ext_background_effect_manager_v1` protocol. |
There was a problem hiding this comment.
This would be an extreme nitpick but should this comment say "or", so it's clear that blur works with either the KDE or the generic protocol? Instead of sounding like it might require both
037d750 to
9ebad19
Compare
| #[derive(Debug)] | ||
| pub enum BlurSurface { | ||
| Ext(WlSurface, ExtBackgroundEffectSurfaceV1), | ||
| Kwin(OrgKdeKwinBlur), | ||
| } | ||
|
|
||
| impl BlurSurface { | ||
| pub fn commit(&self) { | ||
| match self { | ||
| BlurSurface::Ext(s, _) => s.commit(), | ||
| BlurSurface::Kwin(s) => s.commit(), | ||
| } | ||
| } | ||
| } | ||
|
|
||
| impl Drop for BlurSurface { | ||
| fn drop(&mut self) { |
There was a problem hiding this comment.
Move all of that somewhere else, like types/blur.
| self.blur_manager.as_ref().unwrap().unset(self.window.wl_surface()); | ||
| self.blur.take().unwrap().release(); | ||
| self.blur_manager.as_mut().unwrap().unset(self.window.wl_surface()); | ||
| drop(self.blur.take().unwrap()); |
There was a problem hiding this comment.
| drop(self.blur.take().unwrap()); | |
| self.blur = None; |
| size: LogicalSize<u32>, | ||
| ) -> ExtBackgroundEffectSurfaceV1 { | ||
| let region = Region::new(compositor_state.deref()).unwrap(); | ||
| region.add(0, 0, size.width as i32, size.height as i32); |
There was a problem hiding this comment.
Can we just follow KDE blur impl? It's the same protocol, so not sure why it has to be different to what we have. Not sure about region though, but usually i32::MAX does the job because it's clipped.
There was a problem hiding this comment.
It's the same protocol, so not sure why it has to be different to what we have.
I asked Yalter about this and he said that the surface object when created has no effect, so the client have to call set_blur_region to ask the compositor to blur the surface. I'll try to see if i32::MAX works here.
Add
ext-background-effect-v1backend for blur windows on Wayland. Tested with niri-wm/niri#3483.changelogmodule if knowledge of this change could be valuable to users