mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
layout: Fix DnD scroll not stopping when interactive moving unfullscreen to floating
This commit is contained in:
+8
-2
@@ -4225,8 +4225,14 @@ impl<W: LayoutElement> Layout<W> {
|
|||||||
is_floating = unfullscreen_to_floating;
|
is_floating = unfullscreen_to_floating;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Animate to semitransparent.
|
if is_floating {
|
||||||
if !is_floating {
|
// Unlock the view in case we locked it moving a fullscreen window that is
|
||||||
|
// going to unfullscreen to floating.
|
||||||
|
for ws in self.workspaces_mut() {
|
||||||
|
ws.dnd_scroll_gesture_end();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Animate to semitransparent.
|
||||||
tile.animate_alpha(
|
tile.animate_alpha(
|
||||||
1.,
|
1.,
|
||||||
INTERACTIVE_MOVE_ALPHA,
|
INTERACTIVE_MOVE_ALPHA,
|
||||||
|
|||||||
@@ -3354,6 +3354,44 @@ fn interactive_resize_on_pending_unfullscreen_column() {
|
|||||||
check_ops(&ops);
|
check_ops(&ops);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn interactive_move_unfullscreen_to_floating_stops_dnd_scroll() {
|
||||||
|
let ops = [
|
||||||
|
Op::AddOutput(3),
|
||||||
|
Op::AddWindow {
|
||||||
|
params: TestWindowParams {
|
||||||
|
is_floating: true,
|
||||||
|
..TestWindowParams::new(4)
|
||||||
|
},
|
||||||
|
},
|
||||||
|
// This moves the window to tiling.
|
||||||
|
Op::SetFullscreenWindow {
|
||||||
|
window: 4,
|
||||||
|
is_fullscreen: true,
|
||||||
|
},
|
||||||
|
// This starts a DnD scroll since we're dragging a tiled window.
|
||||||
|
Op::InteractiveMoveBegin {
|
||||||
|
window: 4,
|
||||||
|
output_idx: 3,
|
||||||
|
px: 0.0,
|
||||||
|
py: 0.0,
|
||||||
|
},
|
||||||
|
// This will cause the window to unfullscreen to floating, and should stop the DnD scroll
|
||||||
|
// since we're no longer dragging a tiled window, but rather a floating one.
|
||||||
|
Op::InteractiveMoveUpdate {
|
||||||
|
window: 4,
|
||||||
|
dx: 0.0,
|
||||||
|
dy: 15035.31210741684,
|
||||||
|
output_idx: 3,
|
||||||
|
px: 0.0,
|
||||||
|
py: 0.0,
|
||||||
|
},
|
||||||
|
Op::InteractiveMoveEnd { window: 4 },
|
||||||
|
];
|
||||||
|
|
||||||
|
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