When cosmic-workspaces is shown, render only layer-shell surfaces

This allows `cosmic-workspaces` to rely on cosmic-comp for rendering the
background, and just have transparency. This should be a more reliable
and performant way of doing things, at least for now.

Instead of adding another opaque bool argument, this defines an
`ElementFilter` enum, which makes calls more readable.

Window surfaces are still included in screencopy, as needed for the
workspace previews.
This commit is contained in:
Ian Douglas Scott 2024-07-09 20:46:41 -07:00 committed by Victoria Brekenfeld
parent 31358d1993
commit 355b142c52
3 changed files with 83 additions and 60 deletions

View file

@ -36,7 +36,7 @@ use crate::{
backend::render::{
cursor,
element::{AsGlowRenderer, CosmicElement, DamageElement, FromGlesError},
render_workspace, CursorMode, CLEAR_COLOR,
render_workspace, CursorMode, ElementFilter, CLEAR_COLOR,
},
shell::{CosmicMappedRenderElement, CosmicSurface, WorkspaceRenderElement},
state::{BackendData, Common, State},
@ -287,7 +287,7 @@ pub fn render_workspace_to_buffer(
None,
handle,
cursor_mode,
true,
ElementFilter::ExcludeWorkspaceOverview,
)
.map(|res| res.0)
} else {
@ -316,7 +316,7 @@ pub fn render_workspace_to_buffer(
None,
handle,
cursor_mode,
true,
ElementFilter::ExcludeWorkspaceOverview,
)
.map(|res| res.0)
}