render: Respect scale for indicator thickness
This commit is contained in:
parent
d394240fe6
commit
380b00e083
4 changed files with 18 additions and 2 deletions
|
|
@ -155,6 +155,7 @@ impl IndicatorShader {
|
||||||
key: impl Into<Key>,
|
key: impl Into<Key>,
|
||||||
mut element_geo: Rectangle<i32, Logical>,
|
mut element_geo: Rectangle<i32, Logical>,
|
||||||
thickness: u8,
|
thickness: u8,
|
||||||
|
scale: f64,
|
||||||
alpha: f32,
|
alpha: f32,
|
||||||
) -> PixelShaderElement {
|
) -> PixelShaderElement {
|
||||||
let t = thickness as i32;
|
let t = thickness as i32;
|
||||||
|
|
@ -168,6 +169,7 @@ impl IndicatorShader {
|
||||||
thickness,
|
thickness,
|
||||||
thickness * 2,
|
thickness * 2,
|
||||||
alpha,
|
alpha,
|
||||||
|
scale,
|
||||||
FOCUS_INDICATOR_COLOR,
|
FOCUS_INDICATOR_COLOR,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
@ -179,8 +181,11 @@ impl IndicatorShader {
|
||||||
thickness: u8,
|
thickness: u8,
|
||||||
radius: u8,
|
radius: u8,
|
||||||
alpha: f32,
|
alpha: f32,
|
||||||
|
scale: f64,
|
||||||
color: [f32; 3],
|
color: [f32; 3],
|
||||||
) -> PixelShaderElement {
|
) -> PixelShaderElement {
|
||||||
|
let thickness = (thickness as f64 * scale).round() as u8;
|
||||||
|
|
||||||
let settings = IndicatorSettings {
|
let settings = IndicatorSettings {
|
||||||
thickness,
|
thickness,
|
||||||
radius,
|
radius,
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ use smithay::{
|
||||||
},
|
},
|
||||||
output::Output,
|
output::Output,
|
||||||
reexports::wayland_server::protocol::wl_surface::WlSurface,
|
reexports::wayland_server::protocol::wl_surface::WlSurface,
|
||||||
utils::{IsAlive, Logical, Point, Rectangle, Serial},
|
utils::{IsAlive, Logical, Point, Rectangle, Scale, Serial},
|
||||||
wayland::compositor::SurfaceData,
|
wayland::compositor::SurfaceData,
|
||||||
};
|
};
|
||||||
use std::{
|
use std::{
|
||||||
|
|
@ -83,7 +83,7 @@ impl MoveGrabState {
|
||||||
return Vec::new();
|
return Vec::new();
|
||||||
}
|
}
|
||||||
|
|
||||||
let output_scale = output.current_scale().fractional_scale().into();
|
let output_scale: Scale<f64> = output.current_scale().fractional_scale().into();
|
||||||
let scaling_offset =
|
let scaling_offset =
|
||||||
self.window_offset - self.window_offset.to_f64().upscale(scale).to_i32_round();
|
self.window_offset - self.window_offset.to_f64().upscale(scale).to_i32_round();
|
||||||
let render_location =
|
let render_location =
|
||||||
|
|
@ -104,6 +104,7 @@ impl MoveGrabState {
|
||||||
.to_i32_round(),
|
.to_i32_round(),
|
||||||
),
|
),
|
||||||
self.indicator_thickness,
|
self.indicator_thickness,
|
||||||
|
output_scale.x,
|
||||||
1.0,
|
1.0,
|
||||||
))
|
))
|
||||||
.into(),
|
.into(),
|
||||||
|
|
|
||||||
|
|
@ -517,6 +517,7 @@ impl FloatingLayout {
|
||||||
elem.clone(),
|
elem.clone(),
|
||||||
indicator_geometry,
|
indicator_geometry,
|
||||||
indicator_thickness,
|
indicator_thickness,
|
||||||
|
output_scale,
|
||||||
alpha,
|
alpha,
|
||||||
);
|
);
|
||||||
window_elements.push(element.into());
|
window_elements.push(element.into());
|
||||||
|
|
|
||||||
|
|
@ -2319,6 +2319,7 @@ impl TilingLayout {
|
||||||
None,
|
None,
|
||||||
1.0,
|
1.0,
|
||||||
overview.alpha().unwrap(),
|
overview.alpha().unwrap(),
|
||||||
|
1.0,
|
||||||
placeholder_id,
|
placeholder_id,
|
||||||
Some(None),
|
Some(None),
|
||||||
)
|
)
|
||||||
|
|
@ -2984,6 +2985,7 @@ impl TilingLayout {
|
||||||
// but for that we have to associate focus with a tree (and animate focus changes properly)
|
// but for that we have to associate focus with a tree (and animate focus changes properly)
|
||||||
1.0 - transition,
|
1.0 - transition,
|
||||||
transition,
|
transition,
|
||||||
|
output_scale,
|
||||||
&self.placeholder_id,
|
&self.placeholder_id,
|
||||||
is_mouse_tiling,
|
is_mouse_tiling,
|
||||||
)
|
)
|
||||||
|
|
@ -3017,6 +3019,7 @@ impl TilingLayout {
|
||||||
seat,
|
seat,
|
||||||
transition,
|
transition,
|
||||||
transition,
|
transition,
|
||||||
|
output_scale,
|
||||||
&self.placeholder_id,
|
&self.placeholder_id,
|
||||||
is_mouse_tiling,
|
is_mouse_tiling,
|
||||||
)
|
)
|
||||||
|
|
@ -3072,6 +3075,7 @@ fn geometries_for_groupview<'a, R>(
|
||||||
seat: Option<&Seat<State>>,
|
seat: Option<&Seat<State>>,
|
||||||
alpha: f32,
|
alpha: f32,
|
||||||
transition: f32,
|
transition: f32,
|
||||||
|
output_scale: f64,
|
||||||
placeholder_id: &Id,
|
placeholder_id: &Id,
|
||||||
mouse_tiling: Option<Option<&TargetZone>>,
|
mouse_tiling: Option<Option<&TargetZone>>,
|
||||||
) -> Option<(
|
) -> Option<(
|
||||||
|
|
@ -3238,6 +3242,7 @@ where
|
||||||
4,
|
4,
|
||||||
if render_active_child { 16 } else { 8 },
|
if render_active_child { 16 } else { 8 },
|
||||||
alpha * if render_potential_group { 0.40 } else { 1.0 },
|
alpha * if render_potential_group { 0.40 } else { 1.0 },
|
||||||
|
output_scale,
|
||||||
GROUP_COLOR,
|
GROUP_COLOR,
|
||||||
)
|
)
|
||||||
.into(),
|
.into(),
|
||||||
|
|
@ -3255,6 +3260,7 @@ where
|
||||||
4,
|
4,
|
||||||
8,
|
8,
|
||||||
alpha * 0.40,
|
alpha * 0.40,
|
||||||
|
output_scale,
|
||||||
GROUP_COLOR,
|
GROUP_COLOR,
|
||||||
)
|
)
|
||||||
.into(),
|
.into(),
|
||||||
|
|
@ -3321,6 +3327,7 @@ where
|
||||||
4,
|
4,
|
||||||
8,
|
8,
|
||||||
alpha * 0.15,
|
alpha * 0.15,
|
||||||
|
output_scale,
|
||||||
GROUP_COLOR,
|
GROUP_COLOR,
|
||||||
)
|
)
|
||||||
.into(),
|
.into(),
|
||||||
|
|
@ -3520,6 +3527,7 @@ where
|
||||||
4,
|
4,
|
||||||
8,
|
8,
|
||||||
alpha * 0.40,
|
alpha * 0.40,
|
||||||
|
output_scale,
|
||||||
GROUP_COLOR,
|
GROUP_COLOR,
|
||||||
)
|
)
|
||||||
.into(),
|
.into(),
|
||||||
|
|
@ -3913,6 +3921,7 @@ where
|
||||||
} else {
|
} else {
|
||||||
indicator_thickness
|
indicator_thickness
|
||||||
},
|
},
|
||||||
|
output_scale,
|
||||||
1.0,
|
1.0,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue