And a window update flag for mapping the window.
Also make sure related functions consider the case where the given window
has pending updates.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Which includes the pending update flags for the window.
Using an internal struct makes sure the window update flags are opaque outside
of win.c
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
rename map_win, unmap_win, destroy_win to map_win_start,
unmap_win_start, destroy_win_start respectively. To clarify their
intended functions. Also rename the corresponding finish_* functions to
*_finish so they are consistent.
Also some very minor code clean ups.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Instead of doing both unmapping and destroying in the same function,
since that complicates the logic.
Also since now destroy_win handles both the managed and unmanaged cases,
remove destroy_unmanage_win function.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Split it into PIXMAP_STALE and SHADOW_STALE, this allows us to update
pixmaps and shadow images separately.
Also added PIXMAP_NONE and SHADOW_NONE, as redundancy to detect logic
errors.
Convenient constants and functions are provided for updating pixmap and
shadow together.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Instead of pointer to pointer. The two level of pointers were used to
inform the caller the window has been destroyed (pointer set to NULL).
Now, destruction of windows are now signaled by the return value, which
is marked `must_use`.
Problem with taking pointer to pointer is that they tends to pollute the
function signatures a little bit. And we are not using it well anyways.
A lot of the callers passes pointers to local variables to those
functions, so the information about window destruction doesn't actually
bubble up. So, we switch to use just one level of pointers instead.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
It could be hard for Ubuntu/Debian users to find the correct packages
for the dependencies.
Thanks @kgilmer
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
When a window has 0 opacity, it's rendering is skipped completely. Thus
its background isn't blurred.
This commit fixes that.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Dummy backends are backends that doesn't render anything on to the
screen or the target window. But they are still be useful for debug
purposes, and can be useful for other things too.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
blur_kernel_count could be none zero when user set a blur kernel but
didn't enable blur. In that case deinit_render will try to free
elements of blur_kerns_cache, causing a segfault because
blur_kerns_cache is never allocated.
Fixes#209
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
compton built from the git repo often _seems_ to be from a older release,
this change disambiguate the version string.
compton built from the git repo now have version string like this:
'vgit-xxxxx'
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
xerror handler might be called during XCloseDisplay, at which point
session_t is already destroyed, causing a segfault.
Ping #209
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Only render blur with transparency when window is fading in/out.
Otherwise, a window with a set opacity will always have a completely
blurred background.
Fixes#198
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>