diff --git a/crates/ui-panels/src/docking/native.rs b/crates/ui-panels/src/docking/native.rs index 2b2922e894..5cf998916b 100644 --- a/crates/ui-panels/src/docking/native.rs +++ b/crates/ui-panels/src/docking/native.rs @@ -113,6 +113,16 @@ pub fn opening
(ctx: &Context, config: &DockConfig, window: &Floating
, spec
Opening { rect: recorded.unwrap_or_else(|| restore(ctx, window)), spec: Some(spec_for(specs)), waits: false }
}
+/// Asks for the pass in which a group that waits to open its OS window ([`Opening::waits`]) opens it: the next one once
+/// the press that moved it has ended, or the one after a target in another window had its chance to take the drop.
+#[doc(hidden)]
+pub fn waited(ctx: &Context, opening: &Opening, output: &FloatingGroupOutput) {
+ let ended = output.placed.is_some_and(|change| matches!(change.phase, GesturePhase::Commit | GesturePhase::Cancel));
+ if opening.waits && (ended || pointer::pressed_part(ctx, output.response.id).is_none()) {
+ crate::runtime::frame::request_repaint(ctx);
+ }
+}
+
/// The action that records where the OS put the native window `window`, shown in `viewport`: its placement, as an
/// app window's is recorded, with the rect `kept` gives for the rect the OS shows the window at (outer top-left corner
/// and inner size, in desktop points), so a collapsed window keeps its expanded rect
diff --git a/crates/ui-patterns/src/patterns/dock/area.rs b/crates/ui-patterns/src/patterns/dock/area.rs
index 9809d8a1d6..7a5e6d2f31 100644
--- a/crates/ui-patterns/src/patterns/dock/area.rs
+++ b/crates/ui-patterns/src/patterns/dock/area.rs
@@ -26,7 +26,6 @@ use crate::runtime::derived::derived;
use crate::runtime::drag;
use crate::runtime::env::{Env, Label, RevealEdge, ShellCx, ShellEntry, in_room};
use crate::runtime::memory::Remember as _;
-use crate::runtime::pointer;
use crate::runtime::windows::{ResizeEdge, WindowHost};
use crate::sections::{HeaderAction, Panel};
use craft_behavior::dock::{
@@ -1830,6 +1829,7 @@ impl