diff --git a/crates/ui-contract/src/contract/body/window.rs b/crates/ui-contract/src/contract/body/window.rs index ffe88ce16..2505a3263 100644 --- a/crates/ui-contract/src/contract/body/window.rs +++ b/crates/ui-contract/src/contract/body/window.rs @@ -480,6 +480,10 @@ impl BodyHooks<'_> { /// are never its. pub(super) fn window_os(&mut self, viewport: ViewportId, props: &ContainerProps, cx: &mut Cx<'_, C>) { let by_caller = overlay_of(props).is_some_and(|overlay| overlay.resize.by_caller); + // DIAG FW-280 + if by_caller { + eprintln!("DIAG FW-280 window_os: viewport={viewport:?}"); + } if by_caller { let limits = overlay_of(props).map(|overlay| Limits::new(overlay, window_min(props, cx.style.metrics().min_size))); if let Some(limits) = limits { @@ -524,6 +528,12 @@ impl BodyHooks<'_> { let (dx, dy, _) = GRIPS[sizing.grip]; limits.resized(sizing.start, dx, dy, desktop - sizing.pressed) }; + // DIAG FW-280 + eprintln!( + "DIAG FW-280 window_resize: sizing={:?} phases={:?} outer={outer:?}", + self.mode.sizing.map(|sizing| (sizing.grip, sizing.start, sizing.at)), + (0..GRIPS.len()).map(|index| phase(index).map(|phase| format!("{phase:?}"))).collect::>() + ); let Some(mut sizing) = self.mode.sizing else { let started = (0..GRIPS.len()).find_map(|index| match phase(index)? { PressPhase::DragStart { start, pos, .. } => Some((index, start.origin, pos)), @@ -722,6 +732,10 @@ impl BodyHooks<'_> { Mount::Window { resize } => (resize.edges, handle / 2.0), _ => (ResizeEdges::NONE, 0.0), }; + // DIAG FW-280 + if overlay_of(props).is_some_and(|overlay| overlay.resize.by_caller) { + eprintln!("DIAG FW-280 move_parts: os={os:?} edges={edges:?} grips={} rect={rect:?} handle={handle} held={held:?}", stands.grips); + } if edges == ResizeEdges::NONE || !stands.grips { return; } diff --git a/crates/ui-patterns/src/patterns/dock/area.rs b/crates/ui-patterns/src/patterns/dock/area.rs index 7d27eb17c..0dd974fe5 100644 --- a/crates/ui-patterns/src/patterns/dock/area.rs +++ b/crates/ui-patterns/src/patterns/dock/area.rs @@ -985,6 +985,8 @@ impl Pass<'_, P> { } else { grid.steps_within(change.rect.width()) }; + // DIAG FW-280 + eprintln!("DIAG FW-280 stepped_resize: change={change:?} fitted={fitted:?} steps={steps} to={to}"); if to != steps { self.report.actions.push(Action::set_column_steps(first.clone(), to)); } @@ -1237,6 +1239,10 @@ impl Pass<'_, P> { cross_window::accept_cross_window(&ctx); self.report.actions.push(dropped.action); } + // DIAG FW-280 + if output.placed.is_some() { + eprintln!("DIAG FW-280 windows: placed={:?} fitted={:?} native={}", output.placed, shape.fitted, opening.spec.is_some()); + } // A resize of a window whose column has steps: the steps it sets, and the window's rect at them. let resized = output .placed diff --git a/crates/ui-patterns/tests/it/docking/native.rs b/crates/ui-patterns/tests/it/docking/native.rs index a2e7b6d73..9d97a05ed 100644 --- a/crates/ui-patterns/tests/it/docking/native.rs +++ b/crates/ui-patterns/tests/it/docking/native.rs @@ -381,7 +381,12 @@ fn a_palette_drag_resolves_the_main_windows_drops_at_the_system_pointer_not_wher docked |= docks_window(&dock.frame(vec![]).0); } let mark = drag::mark(&dock.windows.ctx); - assert!(matches!(mark, Some(DropMark::Into(_))), "the middle of the group under the system pointer is marked: {mark:?}"); + // The group fills the main window: a drop in its middle joins it, so the mark is the whole group. + let group = Rect::from_min_size(Pos2::ZERO, MAIN_AT.size()); + assert!( + matches!(mark, Some(DropMark::Region { area, .. }) if area == group), + "the middle of the group under the system pointer is marked, the whole group: {mark:?}" + ); system.set_primary_held(Some(false)); for _ in 0..3 { docked |= docks_window(&dock.frame(vec![]).0);