GLX context is released when it's no longer current in any threads, so
we have to release the context before destroy it.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Prevent a useless error message from glGetUniformLocationChecked, as
"opacity" is not used by the dummy shader, we will fail to get its
location.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
If the user is using custom shaders, picom will naturally fail to get
some uniform locations if the given uniform is not used in the shader.
So we really shouldn't report error for it.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
"notify" is the only wintype that has a name inconsistent with its Xorg
name. So fix that.
Compatibility code is added as well, so the old "notify" wintype name
still works.
Fixes#323
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
xdgh in xdg_config_home is not always allocated. This commit makes sure
it's always a valid pointer to free by strdup it.
With helps from @dtzWill
Fixes#326Closes#327
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
According to the XDG Base Directory Specification, relative paths in
XDG_CONFIG_DIRS are invalid, so eliminate them if found.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Fixed 2 problems:
1. Made sure the returned list is NULL terminated.
2. Allocate the duplicated string and the return list together, so the
duplicated string will be freed as we free the list. Fixed a memory
leak.
Fixes#324
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
While /dev/null is always empty, it still generates inotify events. So
using /dev/null as config file will cause the compositor to reset itself
frequently.
Not entire sure if only allowing regular files is sufficient, but we
will be doing this until an issue comes up.
Fixes#320
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Currently if the shadow image fails to bind, the entire window is marked
as having image errors. So nothing of that window will render, even if
the window image itself is fine.
The commit cause shadow to be disabled when shadow image fails, instead
of marking the window.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
For big windows, their shadow images might exceed the maximum request
length limit of Xorg. libxcb will shutdown the connection to X server if
we try to send that image. So we have to break the image apart and send
it piecemeal.
In the future we probably should migrate to MIT-SHM.
Fixes#255#274
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Unredirect the screen when some window sets _NET_WM_BYPASS_COMPOSITOR
to 1, but ignore the case where some window requests the screen to be
redirected by setting _NET_WM_BYPASS_COMPOSITOR to 2.
Closes#267
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
In file included from ../src/log.h:8,
from ../src/backend/gl/glx.h:18,
from ../src/common.h:45,
from ../src/picom.c:32:
../src/compiler.h:98:11: fatal error: threads.h: No such file or directory
98 | # include <threads.h>
| ^~~~~~~~~~~
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 compositor crashes when a window does:
has shadow -> no shadow -> has shadow
This is because when the shadow is turned off, the shadow image is not
freed, and this is catched by a later assertion.
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>