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:
parent
31358d1993
commit
355b142c52
3 changed files with 83 additions and 60 deletions
|
|
@ -3,13 +3,15 @@
|
|||
use crate::{
|
||||
backend::render::{
|
||||
element::{CosmicElement, DamageElement},
|
||||
init_shaders, workspace_elements, CursorMode, GlMultiRenderer, CLEAR_COLOR,
|
||||
init_shaders, workspace_elements, CursorMode, ElementFilter, GlMultiRenderer, CLEAR_COLOR,
|
||||
},
|
||||
shell::Shell,
|
||||
state::SurfaceDmabufFeedback,
|
||||
utils::prelude::*,
|
||||
wayland::{
|
||||
handlers::screencopy::{submit_buffer, FrameHolder, SessionData},
|
||||
handlers::screencopy::{
|
||||
submit_buffer, FrameHolder, SessionData, WORKSPACE_OVERVIEW_NAMESPACE,
|
||||
},
|
||||
protocols::screencopy::{
|
||||
FailureReason, Frame as ScreencopyFrame, Session as ScreencopySession,
|
||||
},
|
||||
|
|
@ -46,7 +48,7 @@ use smithay::{
|
|||
Bind, ImportDma, Offscreen, Renderer, Texture,
|
||||
},
|
||||
},
|
||||
desktop::utils::OutputPresentationFeedback,
|
||||
desktop::{layer_map_for_output, utils::OutputPresentationFeedback},
|
||||
output::{Output, OutputNoMode},
|
||||
reexports::{
|
||||
calloop::{
|
||||
|
|
@ -869,6 +871,15 @@ impl SurfaceThreadState {
|
|||
|
||||
std::mem::drop(shell);
|
||||
|
||||
let element_filter = if layer_map_for_output(output)
|
||||
.layers()
|
||||
.any(|s| s.namespace() == WORKSPACE_OVERVIEW_NAMESPACE)
|
||||
{
|
||||
ElementFilter::LayerShellOnly
|
||||
} else {
|
||||
ElementFilter::All
|
||||
};
|
||||
|
||||
workspace_elements(
|
||||
Some(&render_node),
|
||||
&mut renderer,
|
||||
|
|
@ -878,7 +889,7 @@ impl SurfaceThreadState {
|
|||
previous_workspace,
|
||||
workspace,
|
||||
CursorMode::All,
|
||||
false,
|
||||
element_filter,
|
||||
#[cfg(not(feature = "debug"))]
|
||||
None,
|
||||
#[cfg(feature = "debug")]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue