mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
layout/scrolling: Preserve gesture anim in dnd_scroll_gesture_end()
Fixes interactive move unmaximize/unfullscreen into floating skipping the view offset anim.
This commit is contained in:
@@ -3492,7 +3492,15 @@ impl<W: LayoutElement> ScrollingSpace<W> {
|
||||
if gesture.dnd_last_event_time.is_some() && gesture.tracker.pos() == 0. {
|
||||
// DnD didn't scroll anything, so preserve the current view position (rather than
|
||||
// snapping the window).
|
||||
self.view_offset = ViewOffset::Static(gesture.delta_from_tracker);
|
||||
|
||||
// If there's an ongoing animation within the gesture (e.g. from a window being removed
|
||||
// during DnD), preserve it.
|
||||
if let Some(mut anim) = gesture.animation.take() {
|
||||
anim.offset(gesture.current_view_offset);
|
||||
self.view_offset = ViewOffset::Animation(anim);
|
||||
} else {
|
||||
self.view_offset = ViewOffset::Static(gesture.delta_from_tracker);
|
||||
}
|
||||
|
||||
if !self.columns.is_empty() {
|
||||
// Just in case, make sure the active window remains on screen.
|
||||
|
||||
Reference in New Issue
Block a user