Struct FloatingPlacement
pub struct FloatingPlacement { /* private fields */ }Expand description
Placement + drag state shared by call, navigation, browser PiP and
arbitrary captured regions.
Implementations§
§impl FloatingPlacement
impl FloatingPlacement
pub fn is_beyond_detach_boundary(pointer: Point, app: Rect) -> bool
pub fn is_beyond_detach_boundary(pointer: Point, app: Rect) -> bool
Whether an attached surface has crossed the shared detach boundary.
Hosts can use this before constructing a retained surface so the
pre-creation gesture follows the same threshold as Self::update_drag.
pub fn attached(preferred_size: Size) -> FloatingPlacement
pub fn attachment(&self) -> Attachment
pub fn is_dragging(&self) -> bool
pub fn is_desktop_adopted(&self) -> bool
pub fn is_desktop_covered(&self) -> bool
pub fn is_return_pending(&self) -> bool
pub fn request_app_return(&mut self)
pub fn request_app_return(&mut self)
Ask the host to return an adopted surface without painting a second
source copy before its Suspended acknowledgement.
pub fn set_preferred_size(&mut self, size: Size)
pub fn settle_detached_to_preferred_size(&mut self, size: Size)
pub fn settle_detached_to_preferred_size(&mut self, size: Size)
Opt this placement into source-sized transfer followed by a compact desktop settle. The transfer stays full-sized through Prepare and the first adopted frame; only a released, adopted surface may resize.
pub fn set_attached_region(&mut self, region: Option<Rect>)
pub fn set_attached_region(&mut self, region: Option<Rect>)
Bind placement to the exact current app-local region of an inline element. This is lifecycle geometry, not an independent layout system.
pub fn set_attached_chrome(&mut self, chrome: [f64; 4])
pub fn set_attached_chrome(&mut self, chrome: [f64; 4])
Declare app-owned decoration around the placement’s content rect as
[left, top, right, bottom] logical pixels.
pub fn set_safe_insets(&mut self, insets: [f64; 4])
pub fn set_safe_insets(&mut self, insets: [f64; 4])
Keep the attached surface clear of bands of the app as [left, top, right, bottom] logical pixels: its home sits inside them and a drag
inside the app does not slide it under them. A host with a header
row passes [0.0, header_height, 0.0, 0.0]. Separate from
Self::set_attached_chrome, which is the surface’s own decoration.
pub fn restore_local_offset(&mut self, offset: Vec2)
pub fn restore_local_offset(&mut self, offset: Vec2)
Restore only app-local presentation; never restore desktop surface authority.
pub fn reset_attached(&mut self)
pub fn reattach_to_app(&mut self, app: Rect, desktop: Rect)
pub fn reattach_to_app(&mut self, app: Rect, desktop: Rect)
Host-declined/programmatic shell → app return. The surface keeps its current desktop rect on the first frame and eases back to the app home, so an unavailable native-surface path never makes it vanish or jump.
pub fn detach_to_desktop(&mut self, rect: Rect)
pub fn detach_to_desktop(&mut self, rect: Rect)
Programmatic counterpart to crossing the app edge (for a “Float” menu action). The supplied rect is already in desktop coordinates.
pub fn prepare_desktop_rect(&mut self, rect: Rect)
pub fn prepare_desktop_rect(&mut self, rect: Rect)
Apply the compositor’s clamped transfer geometry before the native surface’s first draw, without claiming that pixels are visible yet.
pub fn prepare_desktop_rect_with_offset(
&mut self,
rect: Rect,
coordinate_offset: Vec2,
)
pub fn prepare_desktop_rect_with_offset( &mut self, rect: Rect, coordinate_offset: Vec2, )
Prepare desktop geometry while rebasing a still-held pointer grab from app-local into desktop coordinates. The correction term keeps the prepared (possibly compositor-clamped) rect exact on this frame and on the first native pointer event.
pub fn set_desktop_transfer_covered(&mut self, covered: bool)
pub fn set_desktop_transfer_covered(&mut self, covered: bool)
Tell placement whether the shell can already cover the old app-local pixels during native-surface startup.
pub fn confirm_desktop_adoption(&mut self)
pub fn confirm_desktop_adoption(&mut self)
Confirm that the native surface has committed a visible buffer. This deliberately does not replay the acknowledgement’s geometry: while the surface was preparing, pointer motion may already have advanced beyond that earlier rectangle.
pub fn confirm_desktop_adoption_within(&mut self, desktop: Rect)
pub fn confirm_desktop_adoption_within(&mut self, desktop: Rect)
Confirm adoption and, for an opted-in released surface, begin its
compact desktop settle inside desktop.
pub fn confirm_app_adoption(&mut self, app: Rect)
pub fn confirm_app_adoption(&mut self, app: Rect)
Complete the shell → app half of the ownership handshake. The shell has hidden the native/proxy surface, so the attached copy may now be included in the next primary frame.
pub fn is_handoff_animating(&self) -> bool
pub fn presentation_transform(
&self,
transform: Affine,
rect: Rect,
reduce_motion: bool,
) -> Affine
pub fn presentation_transform( &self, transform: Affine, rect: Rect, reduce_motion: bool, ) -> Affine
A tiny, render-only stretch along the drag direction when ownership changes. Geometry and hit testing stay on the exact drag rect, so the handoff cannot jump; reduced-motion disables the flourish entirely.
pub fn rect(&self, app: Rect, desktop: Rect) -> Rect
pub fn rect(&self, app: Rect, desktop: Rect) -> Rect
Resolve the live rect. Attached overlays follow app; detached ones
retain screen coordinates and only clamp to the desktop.
pub fn begin_drag(&mut self, pointer: Point, app: Rect, desktop: Rect)
pub fn update_drag(
&mut self,
pointer: Point,
app: Rect,
desktop: Rect,
) -> Handoff
pub fn update_drag( &mut self, pointer: Point, app: Rect, desktop: Rect, ) -> Handoff
Detaches after crossing the app by a deliberate 28px, and reattaches when the pointer returns well inside it. The asymmetric thresholds stop the surface flickering between owners along the border.
pub fn end_drag(&mut self, desktop: Rect)
Trait Implementations§
§impl Clone for FloatingPlacement
impl Clone for FloatingPlacement
§fn clone(&self) -> FloatingPlacement
fn clone(&self) -> FloatingPlacement
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !Freeze for FloatingPlacement
impl !RefUnwindSafe for FloatingPlacement
impl Send for FloatingPlacement
impl !Sync for FloatingPlacement
impl Unpin for FloatingPlacement
impl UnsafeUnpin for FloatingPlacement
impl UnwindSafe for FloatingPlacement
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more