Transparent windows usually blends on top of other windows, this commit
adds an option to make transparent windows clip other windows like
non-transparent windows do.
Closes#265
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Previously win_set_shadow tries to release the shadow image when turning
off shadow for a window. When shadow is turned off _immediately_ after
it's turned on, picom won't have a chance to handle the delayed creation
of the shadow before win_set_shadow tries to release the shadow image,
causing a assertion failure because win_set_shadow tried to release a
non-existing image.
This commit makes releasing the shadow image delayed as well.
In theory, we could check the STALE flag in win_set_shadow before
release the image, but that duplicates the logic that is already in
win_process_flags.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
The assertion check for condition that are too board.
If we get multiple root config event in a row, then we might find
ourselves trying to release a image that was released in a previous
backend destruction and is yet to be bound (IOW, the window will have
IMAGES_NONE _and_ IMAGES_STALE set), causing the assertion to fail.
This commit relax the check, so we don't check if STALE is set when NONE
is set.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
deinit then init the logging system after resets, because otherwise
duplicated log handlers will be added by session_init, and we will
see duplicated logs.
Doing this also enables us to add log handlers for early logging.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Automatically reset picom and reload the configuration when a change in
the configuration file is detected.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Unsupported backends were rejected when we try to initialize them, now
we reject them in the option parsing phase.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Instead of allocating new textures everytime gl_average_texture_color is
called, we keep two textures per gl_image and reuse those.
Doing this significantly improves CPU usage on AMDGPU driver for some
reason. But in general, less texture allocation is always better.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
leftovers:
1) config file path. Has to implement compatibility functionalities before
we can change it.
2) links in man pages. Has to migrate the repo first.
3) _COMPTON_SHADOW, it has become a defacto standard, so we have to keep
supporting it.
4) dbus names, undecided whether we should/could change it.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
A quick search on GitHub showing the _COMPTON_SHADOW is actively being
used (most noteably, by polybar). It is not a difficult thing to support,
and it doesn't have that much runtime overhead. So remove the option
that guards this feature, make it enabled by default.
(Side note, I saw lots of people putting this option in their config
files, but this is actually a command line only option.)
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Firstly, this breaks the assumption that when we redirect the screen,
all window is either mapped or unmapped, causing a assertion failure.
Secondly, if transition window into fading when the screen is not
redirected, the fading will not progress until the screen is redirected,
probably not the desired result.
Fixes#246
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Since user reports indicate it has real performance benefits.
Also add a command line flag for turning use-damage off.
Fixes#242
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Because first frame no window has their pixmap bound, which doesn't
happen in frames after the first. If a window is unmapped in that frame,
the compositor will try to render a window with no pixmap bound if
fading is enabled.
Now we keep track if we are in the first frame, and if that's the case
we skip fading in unmap/destroy.
Fixes#239, bug number 2
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This simplifies the logic a bit since we know a shadow is always bound
(if needed) when the screen is redirected.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Previously all image stale flags are ignored when processing an unmapped
window. If a window gains a shadow during its fading out transition, the
shadow flag will be set, but shadow won't actually be generated, causing
a NULL pointer dereference during render.
Fixes#239
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Otherwise shadow won't get generated in next critical section, causing
NULL pointer dereference or assertion failure in next render.
Partially fixes#239
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
win_get_name _updates_ the name of the window by querying the X server,
thus potentially changes the behaviour of the compositor when logging is
turned on (e.g. we could fail to detect window name changes, because the
name was blindly updated in a logging call without handling the name change).
We shouldn't do that.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>