Skip to content
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

Render only layer shell surfaces when cosmic-workspaces is open, and add a SplitRenderElements #609

Merged
merged 6 commits into from
Jul 15, 2024
12 changes: 9 additions & 3 deletions src/backend/kms/surface/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
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::*,
utils::{prelude::*, quirks::workspace_overview_is_open},
wayland::{
handlers::screencopy::{submit_buffer, FrameHolder, SessionData},
protocols::screencopy::{
Expand Down Expand Up @@ -869,6 +869,12 @@ impl SurfaceThreadState {

std::mem::drop(shell);

let element_filter = if workspace_overview_is_open(output) {
ElementFilter::LayerShellOnly
} else {
ElementFilter::All
};

workspace_elements(
Some(&render_node),
&mut renderer,
Expand All @@ -878,7 +884,7 @@ impl SurfaceThreadState {
previous_workspace,
workspace,
CursorMode::All,
false,
element_filter,
#[cfg(not(feature = "debug"))]
None,
#[cfg(feature = "debug")]
Expand Down
Loading