mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-17 23:02:31 +00:00
The stale-pointer trial asserts the group's region mark; DIAG prints for the native stepped resize (FW-280)
This commit is contained in:
@@ -480,6 +480,10 @@ impl BodyHooks<'_> {
|
||||
/// are never its.
|
||||
pub(super) fn window_os<C: Container>(&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::<Vec<_>>()
|
||||
);
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -985,6 +985,8 @@ impl<P: Clone + Eq + Hash + Debug + Send + Sync + 'static> 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<P: Clone + Eq + Hash + Debug + Send + Sync + 'static> 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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user