Skip to content

Commit

Permalink
screencopy: don't force opaque window backgrounds
Browse files Browse the repository at this point in the history
This meant that, for windows that were not fully opaque, there was no
way to capture their transparency.  No way to put a window with
transparency on top of a background in OBS, for example.
  • Loading branch information
alyssais authored and Drakulix committed Dec 2, 2024
1 parent a14d075 commit 69d251f
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/wayland/handlers/screencopy/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use smithay::{
gles::{GlesError, GlesRenderbuffer},
sync::SyncPoint,
utils::with_renderer_surface_state,
Bind, Blit, BufferType, ExportMem, ImportAll, ImportMem, Offscreen, Renderer,
Bind, Blit, BufferType, Color32F, ExportMem, ImportAll, ImportMem, Offscreen, Renderer,
},
},
desktop::space::SpaceElement,
Expand All @@ -36,7 +36,7 @@ use crate::{
backend::render::{
cursor,
element::{AsGlowRenderer, CosmicElement, DamageElement, FromGlesError},
render_workspace, CursorMode, ElementFilter, RendererRef, CLEAR_COLOR,
render_workspace, CursorMode, ElementFilter, RendererRef,
},
shell::{CosmicMappedRenderElement, CosmicSurface, WorkspaceRenderElement},
state::{Common, KmsNodes, State},
Expand Down Expand Up @@ -573,12 +573,7 @@ pub fn render_window_to_buffer(
renderer.bind(render_buffer).map_err(DTError::Rendering)?;
}

dt.render_output(
renderer,
age,
&elements,
CLEAR_COLOR, // TODO use a theme neutral color
)
dt.render_output(renderer, age, &elements, Color32F::TRANSPARENT)
}

let common = &mut state.common;
Expand Down

0 comments on commit 69d251f

Please sign in to comment.