One annoying thing is C23 still defines auto as a storage class despite
it now being used for type inference. As a consequence we must write
"auto const" instead of the more natural "const auto".
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
GCC warns about a use after free, because a pointer is used in pointer
comparison after it was freed. This particular case is completely safe,
but GCC warns anyway.
Move the free after the comparison requires me duplicating the free a
couple of times, so instead I made use of the cleanup attribute to auto
free the pointer when it goes out of scope.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
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>
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>
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>
| ^~~~~~~~~~~
Window state tracking is basically the back bond of window fading. We
add a new enum field to the win struct to track the state of the window,
instead of using a set of boolean variables. We also remove the fading
callbacks, since it is only used for fading, so the potential of code
reuse is lost. And it makes the code slightly harder to understand.
Also fixed a problem that --no-fading-openclose is not behaving as
advertised (from my observation, enabling this flag disables fading
entirely, instead of just diabling it for open/close).
Also uses double for opacity everywhere internally. Use opacity_t only
when setting X opacity prop.
TODO: Remove win::*_last
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>