[win32] Always reset cached current DPIChangeEvent #2626
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR ensures to always reset the currently cached DPIChangeEvent of a Control in any case. Otherwise spawning dpi change events for multiple Controls that are related via parent->child hierarchy could lead to a currentDpiChangeEvent of the parent being canceled by the creation of the event of the child.
So, as as example: there is Composite A and B and A is the parent of B. Now an asynchronous DPI change event for A is created because A is added to a new parent, now the same is done for B while the first event is already propagated the cached event for B could be already there and will be canceled when adding the second event which will cancel further processing. Therefor it is important wo always nullify
Control#currentDpiChangeEventafter the event for a Control is processed and not only when it is the finalControlThis fixes the effect in #2608 (comment).
It can be reproduced in the runtime for me, by moving it to the secondary monitor - primary and secondary must have different zooms of course.