2236 Commits

Author SHA1 Message Date
Arda Atci
df4c6a3d9b xrender fix
Some checks failed
CodeQL / Analyze (cpp) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
coding-style / check (push) Has been cancelled
2024-02-17 01:40:37 +03:00
Arda Atci
3b9e2c5812 Merge remote-tracking branch 'yshui/next' into next 2024-02-17 01:35:02 +03:00
Yuxuan Shui
b99c7db73e x: wid_get_text_prop doesn't need the whole session_t
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-16 15:50:28 +00:00
Yuxuan Shui
7c15a1438a chore: tweak .clang-tidy
1. Increase cognitive complexity threshold to 50. The default value of
   25 marks a lot of functions, which is too noisy to be useful.
2. Ignore int8_t in signed char to integer conversion check.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-16 15:43:52 +00:00
Yuxuan Shui
2b52edd9e3 cache: hide details of struct atom_entry
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-16 12:47:31 +00:00
Yuxuan Shui
9175489f65 utils: try to avoid variable shadowing in some macros
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-16 12:42:14 +00:00
Yuxuan Shui
45ffdf9849 Merge pull request #1200 from yshui/cache-redesign 2024-02-16 01:45:39 +01:00
Yuxuan Shui
96de4f07ca cache: remove unused function cache_invalidate
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-16 00:42:22 +00:00
Yuxuan Shui
a93bbc30e5 atom: get_atom now requires explicit xcb_connection_t
This is to make the access to X server more explicit, and make managing
the lifetime of xcb_connection_t a bit easier.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-16 00:38:40 +00:00
Yuxuan Shui
6315faed20 cache: redesign
cache uses an invasive design now, a la list.h and uthash. This get rid
of the ugly integer to pointer cache, and gives us freedom of what we
can put into the cache.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-16 00:38:38 +00:00
Yuxuan Shui
580aef939f atom: add get_atom_cached
Add a version of get_atom that does not query the X server.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-15 20:12:20 +00:00
Yuxuan Shui
071b77c49f atom: remove an unnecessary use of get_atom
Replace get_atom("COMPTON_VERSION") with a fixed atom.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-15 20:11:42 +00:00
Yuxuan Shui
0dcca2228e cache: slight refactor
Added a pure version of `cache_get` which does not change the cache, and
renamed the old `cache_get` to `cache_get_or_fetch`.

Remove unused `cache_set`, and remove prefix underscore from function
names.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-15 20:07:34 +00:00
Yuxuan Shui
bb097730c7 test.h: import upstream updates
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-15 13:58:29 +00:00
Yuxuan Shui
8d0284da1b compiler: abort in debug build if unreachable() is reached
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-15 13:58:27 +00:00
Yuxuan Shui
9b6b6855d7 Merge pull request #1182 from yshui/image-handle 2024-02-15 14:55:39 +01:00
Yuxuan Shui
2d98518b7d backend: give images a type
It's quite confusing what should be passed into what because too many
things are `void *`. So give images a type to make things a bit clearer.
Because of C's limited type system, we lose the ability to annotate them
as nonnull or const, well you win some you lose some.

Also while doing this I noticed error handling around this is a bit
lacking.

Co-authored-by: Maxim Solovyov <msolovyov@protonmail.com>
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-15 13:48:47 +00:00
Yuxuan Shui
7f3f8b37b5 Merge pull request #1199 from Lenivaya/fix/nix-overlay 2024-02-15 14:20:28 +01:00
Lenivaya
42782689e8 chore: deduplication and reformat of flake.nix 2024-02-15 14:18:11 +01:00
Lenivaya
216bfefd9f fix: add libepoxy to default nix overlay 2024-02-15 14:18:11 +01:00
Yuxuan Shui
bef1240b41 Merge pull request #1198 from yshui/cache-focused 2024-02-15 14:17:38 +01:00
Yuxuan Shui
7e7c2b0cef win: store focused state in struct managed_win
So we don't need the whole session_t just to check if a window is
focused.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-15 11:22:07 +00:00
Yuxuan Shui
f509008cb9 win: don't call win_on_factor_change in win_update_bounding_shape
Later in win_process_update_flags, we check for WIN_FLAGS_FACTOR_CHANGED
and will call win_on_factor_change if needed. So in
win_update_bounding_shape we just need to set that flag. Otherwise we
call win_on_factor_change multiple times unnecessarily.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-14 23:46:12 +00:00
Yuxuan Shui
8c96fbebc4 Merge pull request #1196 from yshui/cache-fullscreen 2024-02-15 00:45:06 +01:00
Yuxuan Shui
05b1fbff9e win: remember calculated fullscreen state for window
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-14 23:41:28 +00:00
Yuxuan Shui
613d179f2d win: cache the EWMH fullscreen property
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-14 23:41:27 +00:00
Yuxuan Shui
84b9ff3148 x: support getting winprop_t items as atoms
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-14 23:41:24 +00:00
Yuxuan Shui
7da8b7afeb Merge pull request #1197 from absolutelynothelix/bsd-werror 2024-02-14 23:18:43 +01:00
Maxim Solovyov
5b81ea2c58 ci: build with --werror on freebsd and openbsd 2024-02-15 00:09:11 +03:00
Maxim Solovyov
2238cf1e54 Merge pull request #1190 from yshui/cache-fbconfig
cache GLX fbconfigs
2024-02-14 23:23:29 +03:00
Yuxuan Shui
85bb56e8a6 Update CHANGELOG.md
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-14 19:44:06 +00:00
Yuxuan Shui
241d7f1d03 backend: glx: cache GLX FBConfigs
This should marginally speed up pixmap binding for the glx backend (we
don't need FBConfigs for egl).

Fix a long running complaint in #381 (unrelated issue, but there is
complaint in there about glXChooseFBConfig being called whenever we bind
a new pixmap).

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-14 19:44:02 +00:00
Yuxuan Shui
e8d42885fa backend: gl: don't force fbconfig info on to heap
It's fairly small, so it's reasonable to put it on the stack.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-14 19:42:40 +00:00
Yuxuan Shui
e948b74363 backend: gl: remove an unused type
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-14 19:42:16 +00:00
Yuxuan Shui
64f6c4885a Merge pull request #1195 from absolutelynothelix/xcb-util 2024-02-14 20:16:58 +01:00
Maxim Solovyov
23b0c5a1d5 x: don't require an entire struct x_connection in x_get_visual_for_depth
inspired by the xcb-util's xcb_aux_get_depth_of_visual function
implementation
2024-02-14 21:31:32 +03:00
Maxim Solovyov
c7591982b6 x: remove x_get_visual_depth and use xcb_aux_get_depth_of_visual instead 2024-02-14 21:13:00 +03:00
Maxim Solovyov
1aa90f6466 x: remove x_sync and use xcb_aux_sync instead 2024-02-14 21:12:39 +03:00
Maxim Solovyov
b0dfcf4a32 x: remove x_screen_of_display and use xcb_aux_get_screen instead 2024-02-14 21:12:09 +03:00
Maxim Solovyov
28cb220b5b Merge pull request #1194 from yshui/update-clang
ci: update git-clang-format
2024-02-14 20:37:34 +03:00
Yuxuan Shui
c6db632d9d ci: update git-clang-format
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-14 17:29:11 +00:00
Yuxuan Shui
f28905b62d Merge pull request #1192 from absolutelynothelix/ci-fixes 2024-02-14 02:40:21 +01:00
Maxim Solovyov
53dd8a4e66 fix most of build warnings on openbsd
sorry openbsd people, we're not going to use the snprintf function.
2024-02-14 02:19:16 +03:00
Maxim Solovyov
f179119d84 ci: use meson setup instead of meson 2024-02-14 00:21:03 +03:00
Maxim Solovyov
466fb4c9e0 ci: update github actions to use node.js 20 2024-02-14 00:20:45 +03:00
Yuxuan Shui
4f792243c1 Update CHANGELOG.md
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-13 10:44:38 +00:00
Maxim Solovyov
9392829d84 backend: xrender: cache the present region
to avoid creating and destroying it every frame

(cherry picked from commit 5a1990b236c85f1222098ef147398855cbb3af69)
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-13 10:27:51 +00:00
Maxim Solovyov
a4ec70982c x: add the x_set_region function
it sets an x region to a pixman region

(cherry picked from commit efb7a1430f2c530c7b9cc0cb6d6d6cff95d8a4d9)
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-13 10:27:41 +00:00
Yuxuan Shui
0ab3e0740e Update CHANGELOG.md
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-11 23:18:47 +00:00
Yuxuan Shui
7ada6db4a3 Merge pull request #1181 from yshui/defroster
See #1145 and #1166
2024-02-12 00:12:50 +01:00