-
-
Notifications
You must be signed in to change notification settings - Fork 589
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
Delay (re-)creation of the mask image, uncouple from shadow image #1035
base: next
Are you sure you want to change the base?
Conversation
Move the creation / binding of mask images into the critical section. Delay binding and release with `WINDOW_FLAGS_MASK_STALE` (part of `WINDOW_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. Bind the mask before binding the shadow. Only bind when corner-radius is set or the window is shaped. related: 9d7cbe4
Codecov Report
@@ Coverage Diff @@
## next #1035 +/- ##
==========================================
- Coverage 37.82% 37.74% -0.09%
==========================================
Files 48 48
Lines 10844 10862 +18
==========================================
- Hits 4102 4100 -2
- Misses 6742 6762 +20
|
@yshui I am not sure if there are pressing reasons to delay the update of the mask image similar to the shadow image in the critical section. If not, we might want to keep the mask creation in |
Hmm, creating the mask image in critical section makes me a bit uneasy. In the critical section we grab the X server and pause its processing of other client's requests. Creating the mask image can take a (relatively) long time, as it needs to render the mask, it's probably not a good idea to grab the server for that long. |
looks good, builds and works for me. the only thing i'd personally change is to rename |
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.