Set WIN_FLAGS_MAPPED instead, it will be handled later. Previously, we
call map_win_start because we need the geometry of the window, which is
updated in map_win_start. Now, we get the geometry in fill_win, so
map_win_start is not needed anymore.
Eliminate a case where destroy_backend could see IMAGES_STALE flags set
on windows.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Make unmapped window events work mostly like a mapped window, except
flags set on unmapped windows aren't processed until the window is
mapped.
Hopefully this unifies some of the code paths and reduce corner cases.
Should fix#525
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
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>
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.