mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-24 02:01:18 +07:00
layout: Reset unfullscreen view offset when starting interactive resize
This commit is contained in:
+11
-2
@@ -3284,10 +3284,11 @@ impl<W: LayoutElement> ScrollingSpace<W> {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let col = self
|
let (col_idx, col) = self
|
||||||
.columns
|
.columns
|
||||||
.iter_mut()
|
.iter_mut()
|
||||||
.find(|col| col.contains(&window))
|
.enumerate()
|
||||||
|
.find(|(_, col)| col.contains(&window))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
if col.is_fullscreen {
|
if col.is_fullscreen {
|
||||||
@@ -3311,6 +3312,14 @@ impl<W: LayoutElement> ScrollingSpace<W> {
|
|||||||
|
|
||||||
self.view_offset.stop_anim_and_gesture();
|
self.view_offset.stop_anim_and_gesture();
|
||||||
|
|
||||||
|
// If this is the active column, clear the stored unfullscreen view offset in case one of
|
||||||
|
// the tiles in the column is still pending unfullscreen. Normally it is cleared and
|
||||||
|
// applied in update_window(), but we skip that during interactive resize because the view
|
||||||
|
// is frozen.
|
||||||
|
if col_idx == self.active_column_idx {
|
||||||
|
self.view_offset_before_fullscreen = None;
|
||||||
|
}
|
||||||
|
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3313,6 +3313,28 @@ fn move_unfocused_pending_unfullscreen_window_out_of_active_column() {
|
|||||||
check_ops(&ops);
|
check_ops(&ops);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn interactive_resize_on_pending_unfullscreen_column() {
|
||||||
|
let ops = [
|
||||||
|
Op::AddWindow {
|
||||||
|
params: TestWindowParams::new(2),
|
||||||
|
},
|
||||||
|
Op::FullscreenWindow(2),
|
||||||
|
Op::Communicate(2),
|
||||||
|
Op::SetFullscreenWindow {
|
||||||
|
window: 2,
|
||||||
|
is_fullscreen: false,
|
||||||
|
},
|
||||||
|
Op::InteractiveResizeBegin {
|
||||||
|
window: 2,
|
||||||
|
edges: ResizeEdge::RIGHT,
|
||||||
|
},
|
||||||
|
Op::Communicate(2),
|
||||||
|
];
|
||||||
|
|
||||||
|
check_ops(&ops);
|
||||||
|
}
|
||||||
|
|
||||||
fn parent_id_causes_loop(layout: &Layout<TestWindow>, id: usize, mut parent_id: usize) -> bool {
|
fn parent_id_causes_loop(layout: &Layout<TestWindow>, id: usize, mut parent_id: usize) -> bool {
|
||||||
if parent_id == id {
|
if parent_id == id {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user