fix: Add Element::kind method to CosmicElement

The default implementation always returned `Kind::Unspecified`. Instead,
we should pass this method through to the wrapped element.

This fixes the use of cursor planes. Now trace logs show Smithay
assigning an element to the cursor plane, and tools like `drm_info` show
the cursor plane with an `FB_ID` attached.
This commit is contained in:
Ian Douglas Scott 2024-04-16 15:34:25 -07:00 committed by Victoria Brekenfeld
parent 17ddc7ce24
commit 916b7729a5

View file

@ -5,7 +5,7 @@ use smithay::{
element::{
surface::WaylandSurfaceRenderElement,
utils::{Relocate, RelocateRenderElement},
Element, Id, RenderElement, UnderlyingStorage,
Element, Id, Kind, RenderElement, UnderlyingStorage,
},
glow::{GlowFrame, GlowRenderer},
utils::{CommitCounter, DamageSet},
@ -151,6 +151,18 @@ where
CosmicElement::Egui(elem) => elem.alpha(),
}
}
fn kind(&self) -> Kind {
match self {
CosmicElement::Workspace(elem) => elem.kind(),
CosmicElement::Cursor(elem) => elem.kind(),
CosmicElement::Dnd(elem) => elem.kind(),
CosmicElement::MoveGrab(elem) => elem.kind(),
CosmicElement::AdditionalDamage(elem) => elem.kind(),
#[cfg(feature = "debug")]
CosmicElement::Egui(elem) => elem.kind(),
}
}
}
impl RenderElement<GlowRenderer> for CosmicElement<GlowRenderer> {