Commit Graph

16 Commits

Author SHA1 Message Date
Yuxuan Shui 8f8d42f0c6
atom: add a mock for struct atom
And define a macro specifically for fuzzer so we know when to build the
mock.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-18 19:38:48 +00:00
Yuxuan Shui ae88e83aa1
atom: make the internal implementations replaceable
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-18 19:38:47 +00:00
Yuxuan Shui 5159f4da37
atom: add two-way mapping between atom and its name
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-18 19:38:41 +00:00
Yuxuan Shui 5fa870ae66
cache: support string without a NUL terminator
Also we, by which I mean me, might have been using HASH_ADD_STR wrong...

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-02-18 00:56:20 +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 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
Maxim Solovyov fea1dc794c
atom: add atoms associated with the background pixmap 2023-06-18 14:57:50 +03:00
Yuxuan Shui dc37370a66
x: remove the last bit of Xlib dependency
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>
2020-10-23 07:58:01 +01:00
Yuxuan Shui b026708026
Partially handle _NET_WM_BYPASS_COMPOSITOR
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>
2020-01-18 18:02:41 +00:00
Tasos Sahanidis 10d5c9b2f9
Use XCB to check if an application is fullscreen 2019-07-19 14:11:15 +03:00
Yuxuan Shui e894105e7b
atom: fix memory leak
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:34 +01:00
Yuxuan Shui c6a4928a45
atom: cache result of get_atom
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:33 +01:00