shell/elements: Don't clip maximized windows/stacks

This commit is contained in:
Victoria Brekenfeld 2025-12-09 13:31:18 +01:00 committed by Victoria Brekenfeld
parent 59fd732982
commit e887e185a7
2 changed files with 21 additions and 9 deletions

View file

@ -676,6 +676,10 @@ impl CosmicStack {
let appearance = p.appearance_conf.lock().unwrap();
let tiled = p.tiled.load(Ordering::Acquire);
if windows[active].is_maximized(false) {
return None;
}
let round = appearance.clip_tiled_windows || !tiled;
if tiled && !appearance.shadow_tiled_windows {
return None;
@ -735,16 +739,15 @@ impl CosmicStack {
&self.0, renderer, stack_loc, scale, alpha,
);
if !self.0.with_program(|p| p.tiled.load(Ordering::Acquire)) {}
elements.extend(self.0.with_program(|p| {
let windows = p.windows.lock().unwrap();
let active = p.active.load(Ordering::SeqCst);
let theme = p.theme.lock().unwrap();
let appearance = p.appearance_conf.lock().unwrap();
let tiled = p.tiled.load(Ordering::Acquire);
let maximized = windows[active].is_maximized(false);
let round = appearance.clip_tiled_windows || !tiled;
let round = (appearance.clip_tiled_windows || !tiled) && !maximized;
let radii = round.then(|| {
theme
.cosmic()
@ -928,7 +931,9 @@ impl CosmicStack {
let active_window = &p.windows.lock().unwrap()[p.active.load(Ordering::SeqCst)];
let is_tiled = p.tiled.load(Ordering::Acquire);
let appearance = p.appearance_conf.lock().unwrap();
let round = appearance.clip_tiled_windows || !is_tiled;
let maximized = active_window.is_maximized(false);
let round = (appearance.clip_tiled_windows || !is_tiled) && !maximized;
let radii = p
.theme
.lock()

View file

@ -366,6 +366,10 @@ impl CosmicWindow {
let activated = p.window.is_activated(false);
let appearance = p.appearance_conf.lock().unwrap();
if p.window.is_maximized(false) {
return None;
}
let clip = (!is_tiled && appearance.clip_floating_windows)
|| (is_tiled && appearance.clip_tiled_windows);
let should_draw_shadow = if is_tiled {
@ -432,10 +436,11 @@ impl CosmicWindow {
R::TextureId: Send + Clone + 'static,
C: From<CosmicWindowRenderElement<R>>,
{
let (has_ssd, is_tiled, mut radii, appearance) = self.0.with_program(|p| {
let (has_ssd, is_tiled, is_maximized, mut radii, appearance) = self.0.with_program(|p| {
(
p.has_ssd(false),
p.is_tiled(),
p.window.is_maximized(false),
p.theme
.lock()
.unwrap()
@ -446,8 +451,9 @@ impl CosmicWindow {
*p.appearance_conf.lock().unwrap(),
)
});
let clip = (!is_tiled && appearance.clip_floating_windows)
|| (is_tiled && appearance.clip_tiled_windows);
let clip = ((!is_tiled && appearance.clip_floating_windows)
|| (is_tiled && appearance.clip_tiled_windows))
&& !is_maximized;
if has_ssd && !clip {
// bottom corners
radii[1] = 0;
@ -602,8 +608,9 @@ impl CosmicWindow {
let is_tiled = p.is_tiled();
let appearance = p.appearance_conf.lock().unwrap();
let round = (!is_tiled && appearance.clip_floating_windows)
|| (is_tiled && appearance.clip_tiled_windows);
let round = ((!is_tiled && appearance.clip_floating_windows)
|| (is_tiled && appearance.clip_tiled_windows))
&& !p.window.is_maximized(false);
let radii = p
.theme
.lock()