Delay (re-)creation of the mask image, uncouple from shadow image #1035
+74
−30
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.
Move the creation / binding of mask images into the critical section. Delay binding and release with
WINDOW_FLAGS_MASK_STALE
(part ofWINDOW_FLAGS_IMAGES_STALE
) analog to the handling of shadow images.No longer bind the mask image when creating the shadow as the mask might not have changed and therefore not been released before. (Previously, the mask might have been already created in
paint_all_new
)Bind the mask before binding the shadow, so we can use it for shadow creating. Only bind when corner-radius is set or the window is shaped.
should fix: #1029
This fixes the assertion failure in
win_bind_mask()
to protect against leaking a mask image.paint_all_new()
will create and bind a (new) mask image.paint_all_new()
)Can be reproduced with:
Currently, no automated test can be written for this case, because the dummy backend does not support creating the shadow image from a mask image and therefore will never go through the affected code path.