When the screen is unredirected, no window have a shadow image. So the
assertions in win_set_shadow don't hold. But in that case, we don't want
to add damages anyway. So we put them behind a check of whether the screen
is redirected.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
- Fix non-critical memory-leak in `picom.c` and `options.c` where we
don't free all allocated memory before dieing.
- Explicitly allocate new branch in `c2.c` to silence false-positive
memory-leak.
Downstream code expect wid_get_text_prop to return at least 1 string.
However wid_get_text_prop would return 0 strings when the property is
set to an empty string.
Fixes: dc37370a66
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Clear both STALE flags (`IMAGES_STALE = PIXMAP_STALE | SHADOW_STALE`)
when destroying windows (see f493447b33).
Clearing `SHADOW_STALE` as well should eliminate the recreation of a shadow
image for a window currently being destroyed which will cause the
rendering to fail because we can't properly update the flags anymore.
Should fix: #394
Of course, we still use GLX, so we can't completely remove Xlib yet. But
this removes all Xlib uses outside of the backends.
This drops support for COMPOUND_TEXT Xorg strings, so people how wants
multilingual support has to use UTF8, which should be fine since most of
the applications support that.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
If a window receives multiple configure notifies in between 2 frames, we
add all the in between positions into damage, when we really just need
the starting and the end position.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
So we don't need to call c2_match every frame something is fading. Also
saves us from some out-of-critical-section X server queries.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Previously, when some explicitly checked property (e.g.
_NET_WM_WINDOW_OPACITY) changed, it won't trigger a
win_on_factor_change, and the rules will not be re-evaluated. Because
that property stale flag will be cleared after we explicitly check the
property, so it won't be detected as a tracked property change.
Here, we instead set WIN_FLAGS_FACTOR_CHANGED directly when a tracked
property changed.
Fixes: f3ff7eff8c
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Part of the configure notify handling which requires querying the X
server, has been moved into the X critical section.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Rename `popcountl` to `popcntul` to avoid name conflicts with NetBSD
system headers.
Remove the unused `popcount` function.
Closes#502
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Keep track of the number of elements/indices for the normal blur rects
as well as the resized ones and use the correct number when drawing.
The number of rects can change if resized rects overlap and are reduced
into a single rect.
Fixes#440
* src/event.c: expose_root: region is not freed
* backend/xrender/xrender.c:
* bind_pixmap: the reply `r` is not freed
* blur: reg_op_resized is not freed
Spotted-by: Samuel Hand <samuel.d.hand@gmail.com>
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This replaces single quotes for double quotes in the configuration
comments that refer to strings.
This was misleading since someone could took that comment as a valid
config entry, which is not. One notable example was `backend = 'glx'`
which is not accepted by libconfig.
This also adds `;` for each default config values for consistency.