Skip to content

Update code which handles stashing #1150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 21, 2025
Merged

Update code which handles stashing #1150

merged 5 commits into from
Jul 21, 2025

Conversation

PoignardAzur
Copy link
Contributor

@PoignardAzur PoignardAzur commented Jul 11, 2025

Avoids the panic in #1119.

@@ -39,7 +44,7 @@ fn paint_widget(
widget_children: widget.children.reborrow_mut(),
debug_paint,
};
if ctx.widget_state.request_paint {
if ctx.widget_state.request_paint && !is_stashed {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe there should be a debug assert to ensure that we aren't seeing something happen where request_paint is true but it was stashed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that case is fine. For example, if you change a stashed widget's background color, it's going to request repaint, and the request will be ignored.

let transform = state.item.window_transform;
let scene = scenes.get(&id).unwrap();
let has_clip = state.item.clip_path.is_some();
if !is_stashed {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know ... it just feels like if the widget its stashed, maybe it shouldn't even be getting this far and wanting to do all of this work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the end the only work it does is resetting needs_paint flags.

@PoignardAzur
Copy link
Contributor Author

This will probably be rebased on top of #1179.

Copy link
Member

@DJMcNab DJMcNab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

state.children,
properties.children,
|widget, state, properties| {
clear_layout_flags(widget, state, properties);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be correct to debug_assert that state.item.is_stashed is true here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be correct, yeah.

@PoignardAzur PoignardAzur added this pull request to the merge queue Jul 21, 2025
Merged via the queue into main with commit 751c75e Jul 21, 2025
35 of 36 checks passed
@PoignardAzur PoignardAzur deleted the fix_stashed_flags branch July 21, 2025 16:09
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.

3 participants