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