Toplevel events name the window, apps hear the pointer hover a surface and where their blurred cards were laid out, and rows can align to the bottom
CI / build + test (push) Canceled after 0s
CI / cargo audit (push) Canceled after 0s

A shell could not tell the windows of an app apart, follow the mouse over one of its overlays, or tell its compositor where the translucent cards of a surface ended up. crustace's floating dock needs all three, to activate and close single windows, to magnify the icons under the pointer and to have forge blur behind its pill and its Quick Settings cards.
`ToplevelEvent::Opened` carries the handle's `identifier`, the compositor's token for that one window, and its `title`, both from `ForeignToplevelInfo`; `toplevel_opened` builds the event for the new and the updated handle. Matches on `Opened { id, app_id }` have to add the fields or `..`.
`App::on_pointer_hover( SurfaceTarget, Option<( x, y )> )` is called on every mouse motion over a surface, in its physical pixels, and with `None` from the pointer's `leave`, which ltk did not handle before. `SurfaceFocus::target` gives the `SurfaceTarget` of a focus.
`Container::blur_behind()` marks a container whose rect and largest corner radius, capped at half its shorter side, the layout pass records in surface coordinates through the `DrawCtx::origin` offset of the sub-canvases, clipped by the viewports it sits in. `commit_draw_ctx` keeps them in `FrameState`, and after a frame where they changed `draw_frame` hands them to `App::on_blur_regions( SurfaceTarget, &[ ( Rect, f32 ) ] )`, for the main surface and each overlay.
`Row::align_bottom()` pins the children to the bottom edge, so taller siblings grow upward. `docs/architecture.md` lists `on_pointer_hover` among the input hooks.
Not done. `on_blur_regions`, `blur_behind` and `align_bottom` are not in the documentation, and there are no tests for them. The regions are reported after the frame is committed, so a compositor that receives them over IPC is one frame behind a surface whose cards move.
This commit is contained in:
2026-10-15 14:49:25 +02:00
parent 35ab8ac2b0
commit 3edd822918
13 changed files with 105 additions and 15 deletions
+13
View File
@@ -98,6 +98,8 @@ pub struct Container<Msg: Clone>
/// toasts, status banners and OSDs that need to be read on
/// appearance even when the user has not navigated to them.
pub( crate ) a11y_live: bool,
/// Reported to [`crate::App::on_blur_regions`] so the compositor can blur what lies behind it.
pub( crate ) blur_behind: bool,
}
impl<Msg: Clone> Container<Msg>
@@ -118,9 +120,19 @@ impl<Msg: Clone> Container<Msg>
border: None,
max_width: None,
a11y_live: false,
blur_behind: false,
}
}
/// Report this container's rect and corner radius through
/// [`crate::App::on_blur_regions`], for a shell whose compositor blurs
/// what lies behind its translucent cards.
pub fn blur_behind( mut self ) -> Self
{
self.blur_behind = true;
self
}
pub fn live_region( mut self, live: bool ) -> Self
{
self.a11y_live = live;
@@ -306,6 +318,7 @@ impl<Msg: Clone> Container<Msg>
border: self.border,
max_width: self.max_width,
a11y_live: self.a11y_live,
blur_behind: self.blur_behind,
}
}
}