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.
Partially revert 32754b0262.
We start with mapping the window (`win_process_update_flags()`). Then check
if focus has changed and process focus updates. Finally refresh stale images
(`win_process_image_flags`) because rules based on focus may have invalidated
them or require them to be created.
Fixes#465 with the following rule:
```
shadow-exclude = [
"focused" != 1"
]
```
Implement the dual-filter kawase blur algorithm for the new OpenGL backend
as seen in kwin [1]. Use with `--blur-method dual_kawase` and set the
desired strength with `--blur-strength level` (1-20).
The dual-filter kawase algorithm produces results close to a traditional
gaussian blur with higher performace, especially at high blur radii. The
supported strength levels provide an effect similar to gauss-radii between
4 and 500 pixels.
As this algorithm relies heavily on the texture-filtering units of a
GPU, there is no support for the xrender backend — at least for now.
[1](https://kwin.kde.narkive.com/aSqRYYw7/d9848-updated-the-blur-method-to-use-the-more-efficient-dual-kawase-blur-algorithm)
**Work-in-Progress**
Split-off kernel-blur specific initialization and rendering from common
OpenGL setup. Add stub functions for dual_kawase-blur initialization and
rendering.
**Work-in-Progress**
Generate suitable parameters for dual-filter kawase blur based on the
selected `blur-strength` or approximate a gauss blur with the selected
`blur-size` and std-deviation.
**Work-in-Progress**
Add `dual_kawase` to configuration and argument parsing. Allow `kawase`
for backward compatibility. Add `--blur-strength` parameter for
blur-method `dual_kawase`.
Update documentation to reflect the new blur-method and parameters.