fix: tame animated resize scaling

This commit is contained in:
Samuel Onoja committed 2026-09-25 01:13:21 +01:00
1 parent f6dce3316a
commit bf4f5f77f7
6 files changed
+27 -22

No files matched your search

+3 -3
View File
@@ -194,14 +194,14 @@ impl PointerConstraintsHandler for Ferese {
};
if focused_surface == *surface {
let current = pointer.current_location();
let scale = self
let (scale_x, scale_y) = self
.window_under_visual(current)
.and_then(|window| self.visual_scale_for_window(&window))
.unwrap_or(1.0);
.unwrap_or((1.0, 1.0));
let current_surface_location = current - origin;
let offset = location - current_surface_location;
pointer.set_location(current + Point::from((offset.x * scale, offset.y * scale)));
pointer.set_location(current + Point::from((offset.x * scale_x, offset.y * scale_y)));
}
}
}
+5 -4
View File
@@ -174,10 +174,10 @@ impl Ferese {
let pointer = self.seat.get_pointer().expect("seat has a pointer");
let position = pointer.current_location();
let focus = self.surface_under(position);
let scale = self
let (scale_x, scale_y) = self
.window_under_visual(position)
.and_then(|window| self.visual_scale_for_window(&window))
.unwrap_or(1.0);
.unwrap_or((1.0, 1.0));
let delta = event.delta();
let delta_unaccel = event.delta_unaccel();
@@ -185,8 +185,9 @@ impl Ferese {
self,
focus,
&RelativeMotionEvent {
delta: (delta.x / scale, delta.y / scale).into(),
delta_unaccel: (delta_unaccel.x / scale, delta_unaccel.y / scale).into(),
delta: (delta.x / scale_x, delta.y / scale_y).into(),
delta_unaccel: (delta_unaccel.x / scale_x, delta_unaccel.y / scale_y)
.into(),
utime: (event.time_msec() as u64).saturating_mul(1_000),
},
);
+1 -1
View File
@@ -332,7 +332,7 @@ impl Ferese {
})
}
pub fn visual_scale_for_window(&self, window: &Window) -> Option<f64> {
pub fn visual_scale_for_window(&self, window: &Window) -> Option<(f64, f64)> {
let id = self.window_ids.get(window)?;
self.window_geometry.get(id)?.visual_scale()
}
+1 -1
View File
@@ -232,7 +232,7 @@ pub(crate) fn animated_window_elements(
constrain,
ConstrainBehavior {
reference: ConstrainReference::Geometry,
behavior: ConstrainScaleBehavior::Zoom,
behavior: ConstrainScaleBehavior::Stretch,
align: ConstrainAlign::TOP | ConstrainAlign::LEFT,
},
))