shell/elements: Don't clip maximized windows/stacks
This commit is contained in:
parent
59fd732982
commit
e887e185a7
2 changed files with 21 additions and 9 deletions
|
|
@ -676,6 +676,10 @@ impl CosmicStack {
|
||||||
let appearance = p.appearance_conf.lock().unwrap();
|
let appearance = p.appearance_conf.lock().unwrap();
|
||||||
let tiled = p.tiled.load(Ordering::Acquire);
|
let tiled = p.tiled.load(Ordering::Acquire);
|
||||||
|
|
||||||
|
if windows[active].is_maximized(false) {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
|
||||||
let round = appearance.clip_tiled_windows || !tiled;
|
let round = appearance.clip_tiled_windows || !tiled;
|
||||||
if tiled && !appearance.shadow_tiled_windows {
|
if tiled && !appearance.shadow_tiled_windows {
|
||||||
return None;
|
return None;
|
||||||
|
|
@ -735,16 +739,15 @@ impl CosmicStack {
|
||||||
&self.0, renderer, stack_loc, scale, alpha,
|
&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| {
|
elements.extend(self.0.with_program(|p| {
|
||||||
let windows = p.windows.lock().unwrap();
|
let windows = p.windows.lock().unwrap();
|
||||||
let active = p.active.load(Ordering::SeqCst);
|
let active = p.active.load(Ordering::SeqCst);
|
||||||
let theme = p.theme.lock().unwrap();
|
let theme = p.theme.lock().unwrap();
|
||||||
let appearance = p.appearance_conf.lock().unwrap();
|
let appearance = p.appearance_conf.lock().unwrap();
|
||||||
let tiled = p.tiled.load(Ordering::Acquire);
|
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(|| {
|
let radii = round.then(|| {
|
||||||
theme
|
theme
|
||||||
.cosmic()
|
.cosmic()
|
||||||
|
|
@ -928,7 +931,9 @@ impl CosmicStack {
|
||||||
let active_window = &p.windows.lock().unwrap()[p.active.load(Ordering::SeqCst)];
|
let active_window = &p.windows.lock().unwrap()[p.active.load(Ordering::SeqCst)];
|
||||||
let is_tiled = p.tiled.load(Ordering::Acquire);
|
let is_tiled = p.tiled.load(Ordering::Acquire);
|
||||||
let appearance = p.appearance_conf.lock().unwrap();
|
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
|
let radii = p
|
||||||
.theme
|
.theme
|
||||||
.lock()
|
.lock()
|
||||||
|
|
|
||||||
|
|
@ -366,6 +366,10 @@ impl CosmicWindow {
|
||||||
let activated = p.window.is_activated(false);
|
let activated = p.window.is_activated(false);
|
||||||
let appearance = p.appearance_conf.lock().unwrap();
|
let appearance = p.appearance_conf.lock().unwrap();
|
||||||
|
|
||||||
|
if p.window.is_maximized(false) {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
|
||||||
let clip = (!is_tiled && appearance.clip_floating_windows)
|
let clip = (!is_tiled && appearance.clip_floating_windows)
|
||||||
|| (is_tiled && appearance.clip_tiled_windows);
|
|| (is_tiled && appearance.clip_tiled_windows);
|
||||||
let should_draw_shadow = if is_tiled {
|
let should_draw_shadow = if is_tiled {
|
||||||
|
|
@ -432,10 +436,11 @@ impl CosmicWindow {
|
||||||
R::TextureId: Send + Clone + 'static,
|
R::TextureId: Send + Clone + 'static,
|
||||||
C: From<CosmicWindowRenderElement<R>>,
|
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.has_ssd(false),
|
||||||
p.is_tiled(),
|
p.is_tiled(),
|
||||||
|
p.window.is_maximized(false),
|
||||||
p.theme
|
p.theme
|
||||||
.lock()
|
.lock()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
|
|
@ -446,8 +451,9 @@ impl CosmicWindow {
|
||||||
*p.appearance_conf.lock().unwrap(),
|
*p.appearance_conf.lock().unwrap(),
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
let clip = (!is_tiled && appearance.clip_floating_windows)
|
let clip = ((!is_tiled && appearance.clip_floating_windows)
|
||||||
|| (is_tiled && appearance.clip_tiled_windows);
|
|| (is_tiled && appearance.clip_tiled_windows))
|
||||||
|
&& !is_maximized;
|
||||||
if has_ssd && !clip {
|
if has_ssd && !clip {
|
||||||
// bottom corners
|
// bottom corners
|
||||||
radii[1] = 0;
|
radii[1] = 0;
|
||||||
|
|
@ -602,8 +608,9 @@ impl CosmicWindow {
|
||||||
let is_tiled = p.is_tiled();
|
let is_tiled = p.is_tiled();
|
||||||
let appearance = p.appearance_conf.lock().unwrap();
|
let appearance = p.appearance_conf.lock().unwrap();
|
||||||
|
|
||||||
let round = (!is_tiled && appearance.clip_floating_windows)
|
let round = ((!is_tiled && appearance.clip_floating_windows)
|
||||||
|| (is_tiled && appearance.clip_tiled_windows);
|
|| (is_tiled && appearance.clip_tiled_windows))
|
||||||
|
&& !p.window.is_maximized(false);
|
||||||
let radii = p
|
let radii = p
|
||||||
.theme
|
.theme
|
||||||
.lock()
|
.lock()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue