element: Clip to tile size if available instead of element geometry
This commit is contained in:
parent
8f7dc7f00c
commit
e4e7567174
6 changed files with 31 additions and 0 deletions
|
|
@ -596,6 +596,7 @@ impl CosmicMapped {
|
|||
&self,
|
||||
renderer: &mut R,
|
||||
location: smithay::utils::Point<i32, smithay::utils::Physical>,
|
||||
max_size: Option<smithay::utils::Size<i32, smithay::utils::Logical>>,
|
||||
output_scale: smithay::utils::Scale<f64>,
|
||||
scale: f64,
|
||||
alpha: f32,
|
||||
|
|
@ -615,6 +616,7 @@ impl CosmicMapped {
|
|||
.shadow_render_element::<R, CosmicMappedRenderElement<R>>(
|
||||
renderer,
|
||||
location,
|
||||
max_size,
|
||||
output_scale,
|
||||
scale,
|
||||
alpha,
|
||||
|
|
@ -624,6 +626,7 @@ impl CosmicMapped {
|
|||
.shadow_render_element::<R, CosmicMappedRenderElement<R>>(
|
||||
renderer,
|
||||
location,
|
||||
max_size,
|
||||
output_scale,
|
||||
scale,
|
||||
alpha,
|
||||
|
|
@ -637,6 +640,7 @@ impl CosmicMapped {
|
|||
&self,
|
||||
renderer: &mut R,
|
||||
location: smithay::utils::Point<i32, smithay::utils::Physical>,
|
||||
max_size: Option<smithay::utils::Size<i32, smithay::utils::Logical>>,
|
||||
scale: smithay::utils::Scale<f64>,
|
||||
alpha: f32,
|
||||
scanout_override: Option<bool>,
|
||||
|
|
@ -826,6 +830,7 @@ impl CosmicMapped {
|
|||
CosmicMappedInternal::Stack(s) => s.render_elements::<R, CosmicMappedRenderElement<R>>(
|
||||
renderer,
|
||||
location,
|
||||
max_size,
|
||||
scale,
|
||||
alpha,
|
||||
scanout_override,
|
||||
|
|
@ -834,6 +839,7 @@ impl CosmicMapped {
|
|||
.render_elements::<R, CosmicMappedRenderElement<R>>(
|
||||
renderer,
|
||||
location,
|
||||
max_size,
|
||||
scale,
|
||||
alpha,
|
||||
scanout_override,
|
||||
|
|
|
|||
|
|
@ -660,6 +660,7 @@ impl CosmicStack {
|
|||
&self,
|
||||
renderer: &mut R,
|
||||
location: Point<i32, Physical>,
|
||||
max_size: Option<Size<i32, Logical>>,
|
||||
output_scale: Scale<f64>,
|
||||
scale: f64,
|
||||
alpha: f32,
|
||||
|
|
@ -697,6 +698,10 @@ impl CosmicStack {
|
|||
|
||||
let mut geo = SpaceElement::geometry(&windows[active]).to_f64();
|
||||
geo.size.h += TAB_HEIGHT as f64;
|
||||
if let Some(max_size) = max_size {
|
||||
geo.size = geo.size.clamp(Size::default(), max_size.to_f64());
|
||||
}
|
||||
|
||||
geo = geo.upscale(scale);
|
||||
geo.loc += location.to_f64().to_logical(output_scale);
|
||||
|
||||
|
|
@ -722,6 +727,7 @@ impl CosmicStack {
|
|||
&self,
|
||||
renderer: &mut R,
|
||||
location: Point<i32, Physical>,
|
||||
max_size: Option<Size<i32, Logical>>,
|
||||
scale: Scale<f64>,
|
||||
alpha: f32,
|
||||
scanout_override: Option<bool>,
|
||||
|
|
@ -769,6 +775,9 @@ impl CosmicStack {
|
|||
let mut geo = SpaceElement::geometry(&windows[active]).to_f64();
|
||||
geo.loc += location.to_f64().to_logical(scale);
|
||||
geo.size.h += TAB_HEIGHT as f64;
|
||||
if let Some(max_size) = max_size {
|
||||
geo.size = geo.size.clamp(Size::default(), max_size.to_f64());
|
||||
}
|
||||
|
||||
let window_key =
|
||||
CosmicMappedKey(CosmicMappedKeyInner::Stack(Arc::downgrade(&self.0.0)));
|
||||
|
|
|
|||
|
|
@ -358,6 +358,7 @@ impl CosmicWindow {
|
|||
&self,
|
||||
renderer: &mut R,
|
||||
location: Point<i32, Physical>,
|
||||
max_size: Option<Size<i32, Logical>>,
|
||||
output_scale: Scale<f64>,
|
||||
scale: f64,
|
||||
alpha: f32,
|
||||
|
|
@ -411,6 +412,9 @@ impl CosmicWindow {
|
|||
}
|
||||
geo = geo.upscale(scale);
|
||||
geo.loc += location.to_f64().to_logical(output_scale);
|
||||
if let Some(max_size) = max_size {
|
||||
geo.size = geo.size.clamp(Size::default(), max_size.to_f64());
|
||||
}
|
||||
|
||||
let window_key =
|
||||
CosmicMappedKey(CosmicMappedKeyInner::Window(Arc::downgrade(&self.0.0)));
|
||||
|
|
@ -434,6 +438,7 @@ impl CosmicWindow {
|
|||
&self,
|
||||
renderer: &mut R,
|
||||
location: Point<i32, Physical>,
|
||||
max_size: Option<Size<i32, Logical>>,
|
||||
scale: Scale<f64>,
|
||||
alpha: f32,
|
||||
scanout_override: Option<bool>,
|
||||
|
|
@ -490,6 +495,9 @@ impl CosmicWindow {
|
|||
if has_ssd {
|
||||
geo.size.h += SSD_HEIGHT as f64;
|
||||
}
|
||||
if let Some(max_size) = max_size {
|
||||
geo.size = geo.size.clamp(Size::default(), max_size.to_f64());
|
||||
}
|
||||
|
||||
if (has_ssd || clip) && !is_maximized {
|
||||
let window_key =
|
||||
|
|
|
|||
|
|
@ -194,6 +194,7 @@ impl MoveGrabState {
|
|||
renderer,
|
||||
(render_location - self.window.geometry().loc)
|
||||
.to_physical_precise_round(output_scale),
|
||||
None,
|
||||
output_scale,
|
||||
alpha,
|
||||
Some(false),
|
||||
|
|
@ -210,6 +211,7 @@ impl MoveGrabState {
|
|||
let shadow_element = self.window.shadow_render_element(
|
||||
renderer,
|
||||
(render_location - self.window.geometry().loc).to_physical_precise_round(output_scale),
|
||||
None,
|
||||
output_scale,
|
||||
scale,
|
||||
alpha,
|
||||
|
|
|
|||
|
|
@ -1506,6 +1506,7 @@ impl FloatingLayout {
|
|||
render_location
|
||||
.as_logical()
|
||||
.to_physical_precise_round(output_scale),
|
||||
None,
|
||||
output_scale.into(),
|
||||
alpha,
|
||||
None,
|
||||
|
|
@ -1516,6 +1517,7 @@ impl FloatingLayout {
|
|||
render_location
|
||||
.as_logical()
|
||||
.to_physical_precise_round(output_scale),
|
||||
None,
|
||||
output_scale.into(),
|
||||
1.,
|
||||
alpha,
|
||||
|
|
|
|||
|
|
@ -5026,6 +5026,7 @@ where
|
|||
shadow_elements.extend(mapped.shadow_render_element(
|
||||
renderer,
|
||||
geo.loc.as_logical().to_physical_precise_round(output_scale) - elem_geometry.loc,
|
||||
Some(geo.size.as_logical()),
|
||||
Scale::from(output_scale),
|
||||
1.,
|
||||
alpha,
|
||||
|
|
@ -5034,6 +5035,7 @@ where
|
|||
let window_elements = mapped.render_elements::<R, CosmicMappedRenderElement<R>>(
|
||||
renderer,
|
||||
geo.loc.as_logical().to_physical_precise_round(output_scale) - elem_geometry.loc,
|
||||
Some(geo.size.as_logical()),
|
||||
Scale::from(output_scale),
|
||||
alpha,
|
||||
None,
|
||||
|
|
@ -5565,6 +5567,7 @@ where
|
|||
renderer,
|
||||
geo.loc.as_logical().to_physical_precise_round(output_scale)
|
||||
- elem_geometry.loc,
|
||||
Some(geo.size.as_logical()),
|
||||
Scale::from(output_scale),
|
||||
scale.x.min(scale.y),
|
||||
alpha,
|
||||
|
|
@ -5574,6 +5577,7 @@ where
|
|||
//original_location,
|
||||
geo.loc.as_logical().to_physical_precise_round(output_scale)
|
||||
- elem_geometry.loc,
|
||||
Some(geo.size.as_logical()),
|
||||
Scale::from(output_scale),
|
||||
alpha,
|
||||
None,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue