From 83ec36953611ab11dd36c3c3632db7bd3fea9b82 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Fri, 13 Jun 2025 08:52:09 +0300 Subject: layout/scrolling: Take unfullscreen view offset unconditionally It might get set and unset all while the view is frozen with a gesture. --- src/layout/tests.rs | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) (limited to 'src/layout/tests.rs') diff --git a/src/layout/tests.rs b/src/layout/tests.rs index acfced00..524ade8b 100644 --- a/src/layout/tests.rs +++ b/src/layout/tests.rs @@ -3471,6 +3471,69 @@ fn interactive_move_unfullscreen_to_floating_stops_dnd_scroll() { check_ops(&ops); } +#[test] +fn unfullscreen_view_offset_not_reset_during_dnd_gesture() { + let ops = [ + Op::AddOutput(1), + Op::AddWindow { + params: TestWindowParams::new(3), + }, + Op::FullscreenWindow(3), + Op::Communicate(3), + Op::DndUpdate { + output_idx: 1, + px: 0.0, + py: 0.0, + }, + Op::FullscreenWindow(3), + Op::Communicate(3), + ]; + + check_ops(&ops); +} + +#[test] +fn unfullscreen_view_offset_not_reset_during_gesture() { + let ops = [ + Op::AddOutput(1), + Op::AddWindow { + params: TestWindowParams::new(3), + }, + Op::FullscreenWindow(3), + Op::Communicate(3), + Op::ViewOffsetGestureBegin { + output_idx: 1, + workspace_idx: None, + is_touchpad: false, + }, + Op::FullscreenWindow(3), + Op::Communicate(3), + ]; + + check_ops(&ops); +} + +#[test] +fn unfullscreen_view_offset_not_reset_during_ongoing_gesture() { + let ops = [ + Op::AddOutput(1), + Op::AddWindow { + params: TestWindowParams::new(3), + }, + Op::ViewOffsetGestureBegin { + output_idx: 1, + workspace_idx: None, + is_touchpad: false, + }, + Op::FullscreenWindow(3), + Op::Communicate(3), + Op::FullscreenWindow(3), + Op::Communicate(3), + ]; + + check_ops(&ops); +} + fn parent_id_causes_loop(layout: &Layout, id: usize, mut parent_id: usize) -> bool { if parent_id == id { return true; -- cgit