Skip to content

#454: [rework-1] Wire toast rendering + click dispatch in GTK backend - #573

Merged
JDonaghy merged 1 commit into
developfrom
issue-454-wire-toast-rendering-click-dispatch-in-g
Jul 11, 2026
Merged

#454: [rework-1] Wire toast rendering + click dispatch in GTK backend#573
JDonaghy merged 1 commit into
developfrom
issue-454-wire-toast-rendering-click-dispatch-in-g

Conversation

@JDonaghy

Copy link
Copy Markdown
Owner

Closes #454

Automated merge from the coordinator for assignment af6455d1683c on issue #454.

Worker branch: issue-454-wire-toast-rendering-click-dispatch-in-gdevelop.

Mirrors the TUI toast wiring from #450: render `engine.toasts` via
`render::build_toast_stack` and dispatch clicks (dismiss ×, actions)
through `engine.handle_toast_hit` before any other click handler, so
a toast dismiss doesn't leak through to the editor underneath.

The original May-30 branch for this issue targeted `draw.rs::draw_editor`,
which was the live GTK paint path at the time. Since then the #540
Relm4→ShellApp migration made that function dead code (it has zero
callers and is `#[allow(dead_code)]` at the module level — see the
`#546` comment already in `render_content` documenting the same trap
for dialogs/context-menus). This wires the toast overlay into
`render_content` (the actual live `ShellApp::render_content` path)
instead: drawn last via `Backend::draw_toast_stack`, anchored to the
full window viewport like TUI's `frame.area()`, with the returned
`ToastStackLayout` cached on `engine.toast_layout` for hit-testing.

`handle_mouse_click_msg` gets the toast hit-test dispatch, same as
TUI's mouse.rs: hit_test → handle_toast_hit before scroll-surface/
other click handling, so a consumed click returns early.

Also fixes a pre-existing `clippy::collapsible_else_if` on
`Msg::WindowMaximize` (unrelated to toasts, but in the same file and
required for the mandatory `cargo clippy -- -D warnings` gate to pass
against current develop).

Verified empirically under Xvfb + xdotool: `:Toast <text>` renders
the toast bottom-right, and clicking its × dismisses it without
falling through to the explorer/editor underneath.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wire toast rendering + click dispatch in GTK backend

1 participant