panels-w5: review fixes (review-1)

This commit is contained in:
aiongg
2026-11-14 17:56:00 +00:00
parent 1e184a7787
commit 308bba9bf8
+3 -2
View File
@@ -277,11 +277,12 @@ pub(crate) fn input_hook(ctx: &Context, input: &mut RawInput) -> bool {
/// a modal in another viewport blocks it (the modal's window then comes forward with the window the user clicked).
pub(crate) fn begin(ctx: &Context) {
let viewport = pass::current_viewport(ctx);
let was_focused = PerViewport::<Record>::with(ctx, viewport, |record| record.facts.is_some_and(|facts| facts.focused));
// A viewport's first pass has no previous facts and is not a focus gain.
let had_focus_before = PerViewport::<Record>::with(ctx, viewport, |record| record.facts.map(|facts| facts.focused));
let facts = viewports::current(ctx);
refresh(ctx, viewport, facts);
reshow_cursor(ctx, viewport);
let gained_focus = facts.focused && !was_focused;
let gained_focus = facts.focused && had_focus_before == Some(false);
if (overlay::take_dropped_press(ctx, viewport) || gained_focus)
&& let Some(modal) = blocking_modal(ctx)
{