-
-
Notifications
You must be signed in to change notification settings - Fork 382
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
fix: improve scope handling #1189
base: master
Are you sure you want to change the base?
Conversation
@@ -288,6 +288,9 @@ fn build_children_special_widget( | |||
gtk_container: >k::Container, | |||
custom_widget_invocation: Rc<CustomWidgetInvocation>, | |||
) -> Result<()> { | |||
// open a new scope for the children | |||
// TODO this might be unnecessary, evaluate whether we can just use the calling_scope | |||
let scope = tree.register_new_scope("children".into(), Some(calling_scope), calling_scope, HashMap::new())?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initial idea: register a new scope for the children, the name might need adjusting
i've pretty much copied this from the build_loop_special_widget
function
currently, all children are in the same scope. |
Very nice to see such a quick response :). I finally had time to test this MR. This breaks at least the following case:
Trying to open
Without the changes in this MR, the window opens and displays "foo". |
@rtoijala thank you so much for your testing!
please try to break things again, and thanks again for your cooperation! |
i'll have to see whether i can investigate #675 as well |
Description
i hate state.
this pr aims to close #992 and close #794
there are architectural issues which cause the behavior described in the issue
basically, the
CustomWidgetInvocation.scope
field is only set once and then used for the scopes of children widgets. since it is never updated, it will never change, but this is needed when variables update.Additional Notes
this should be tested well to prevent introducing a regression here.
if you are reading this, please test this with your configs and report whether the changes broke anything or if everything still works
Checklist
i don't think this is noteworthy enough
cargo fmt
to automatically format all code before committing