Commit Graph

1197 Commits

Author SHA1 Message Date
Yuxuan Shui
19c852b3ae options: mention the "default" shader
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-21 05:22:15 +01:00
Yuxuan Shui
32478df27c core: force redraw if animated shader is in-use
I also noticed there is an opportunity to unify fades, animated shaders,
and the benchmark mode. We should be able to get rid of the fade timer.
A TODO for the future.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-12 13:45:30 +01:00
Yuxuan Shui
83e1cd9a19 backend: add and implement get_shader_attributes
Used for passing back information about whether a shader needs to be
re-rendered every frame.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-11 04:53:14 +01:00
Yuxuan Shui
eb54974ac0 core: init/deinit shaders when init/deinit-ing the backend
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-11 04:41:47 +01:00
Yuxuan Shui
a1f4cafda4 backend: gl: improve error reporting when creating shaders
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-11 04:41:44 +01:00
Yuxuan Shui
eeabf5807e backend: gl: handle custom shader image property
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-11 04:41:20 +01:00
Bernd Busse
c95152e83e backend: gl_common: add time uniform to (custom) window shader 2022-08-11 04:41:17 +01:00
Yuxuan Shui
81768f4a11 backend: gl: implement create_shader/destroy_shader 2022-08-11 04:41:12 +01:00
Yuxuan Shui
947077f329 backend: add custom shader image property
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-11 04:40:43 +01:00
Yuxuan Shui
f5b40ba10e backend: add shader related APIs
Current this API can only create shader from a single source file. This
could be changed in the future.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-11 04:29:50 +01:00
Bernd Busse
5577363aaf win: keep track of window specific shader in managed_win 2022-08-11 04:29:47 +01:00
Yuxuan Shui
654772b8cf config: add options window-shader-fg and window-shader-fg-rules
Used for setting custom window shaders and rules for choosing custom
window shaders.

Added a "c2_userdata_free" parameter to c2_list_free, so allocated userdata
stored in nodes can be freed.

Signed-off-by: Bernd Busse <bernd@busse-net.de>
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-11 04:28:48 +01:00
Yuxuan Shui
db6f11624b c2: fix typo
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-07-17 18:15:09 +01:00
Yuxuan Shui
5d79da6387 c2: return if foreach function returned early
Useful for error handling.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-07-17 18:09:20 +01:00
Yuxuan Shui
23c56ab328 c2: add list iterating functions
Also renames free_wincondlst to c2_list_free and move it to c2.h.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-07-17 17:48:13 +01:00
Yuxuan Shui
7e833744b7 string_utils: add trim_both
trim_both removes whitespaces from both side of a string.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-07-17 15:43:47 +01:00
Yuxuan Shui
8c3ba22ae0 c2: deprecate raw string pattern
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-07-17 14:08:44 +01:00
Yuxuan Shui
96fcc6089e c2: silence a compiler warning
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>
2022-07-16 15:05:03 +01:00
Yuxuan Shui
a8b15f3a1b config_libconfig: resolve symlinks when setting include dir
If the config file is loaded from a symlink'd locaiton, it could be
confusing that include dir is set based on the location of the symlink
instead of the real file.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-07-14 18:30:03 +01:00
Yuxuan Shui
f8914dda23 backend: gl: apply postprocessing to border_color
Previously postprocessing is omitted when estimating the color of the
border (e.g. dimming, opacity, inversion, etc.), causing the border to
be drawn with the wrong color.

Related: #770

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-02-13 13:54:25 +00:00
Yuxuan Shui
e63ec3fd16 backend: gl: fix corner being drawn with wrong color
The outer pixels of the corner are drawn with antialiasing, but it color
used for antialiasing is wrong. The estimated border color is used when
there is actually no border.

Related: #770

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-02-13 13:49:45 +00:00
Yuxuan Shui
ea2ba58efd backend: gl: don't fill window with big border_width
If a window's border_width is bigger than its corner_radius, the inner
radius of the border become less than 0, causing the entire window to be
filled.

Fixes #778

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-02-10 07:47:48 +00:00
Yuxuan Shui
01649b68b9 backend: don't trust device_status after a reset
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-02-08 10:31:41 +00:00
Yuxuan Shui
e17eaefb89 backend: handle device reset
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-02-08 10:31:41 +00:00
Yuxuan Shui
a383dc1cdd backend: add new optional API: device_status
This is meant to be used to detect GPU resets.

Implemented in the glx backend using the GL_ARB_robustness extension.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-02-08 10:31:41 +00:00
Yuxuan Shui
4c5d6a19cd dbus: add signal named according to dbus naming conventions
Some code generators don't work well with signal names not in
UpperCamelCase. (e.g. https://dbus.pages.freedesktop.org/zbus)

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-02-04 16:02:08 +00:00
Yuxuan Shui
95dcc02d9c dbus: add Type property to window objects
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-02-04 16:02:06 +00:00
Yuxuan Shui
de434f7b1f config_libconfig: add dbus option
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-02-04 16:02:03 +00:00
Yuxuan Shui
cb6ea3f567 dbus: follow dbus naming conventions
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-02-04 16:00:37 +00:00
Yuxuan Shui
0f3926b912 dbus: add mappepd property to windows
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-02-04 16:00:36 +00:00
Yuxuan Shui
3bebcca7b4 dbus: add name property to windows
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-02-04 16:00:34 +00:00
Yuxuan Shui
dfc10da57a dbus: add some properties to window objects
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-02-04 16:00:33 +00:00
Yuxuan Shui
764990ade4 dbus: expose windows as dbus objects
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-02-04 16:00:29 +00:00
yshui
0ad6685614 Merge pull request #768 from yshui/deprecation-chore 2022-01-27 10:42:25 +00:00
Yuxuan Shui
f4c4bdb33d dbus: properly handle object path
Previously we reply to requests sent to _any_ object path, even though
we only declare /com/github/chjj/compton. This commit makes sure we only
reply to request sent to the right path.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-01-27 02:28:37 +00:00
Yuxuan Shui
b4e0e6128c dbus: fix win_get with "id"
The target name got changed to "base.id" by accident.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-01-27 01:19:31 +00:00
Yuxuan Shui
c3fb9ef017 core: don't crash when binding root pixmap failed
Fixes #767

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-01-25 00:15:15 +00:00
Yuxuan Shui
b65c8c775f Report error for setting vsync to non-boolean values
This is deprecated since v5, but we forgot to change this to error in
v8.

Doing it now.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-01-24 18:49:18 +00:00
Yuxuan Shui
73f66c7d5d Formally deprecate --menu-opacity
It was deprecated in v4, but warning message wasn't printed for
specifying it on the command line.

Properly deprecate it now.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-01-24 18:44:31 +00:00
Yuxuan Shui
4fbaaca0d6 Remove error message for no-dock-shadow and no-dnd-shadow
Deprecated since v4.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-01-24 18:40:39 +00:00
Yuxuan Shui
4532187c34 config_libconfig: reuse the deprecation message
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-01-24 18:38:32 +00:00
Yuxuan Shui
bcbc410c92 Deprecate the refresh-rate options
It's meaningless without the sw-opti option, which has been deprecated
since v6.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-01-24 18:35:45 +00:00
Yuxuan Shui
183e83cf11 Remove error message for --xrender-sync
Deprecated in v5.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-01-24 18:25:22 +00:00
Yuxuan Shui
c75c55d379 Remove error message for --no-name-pixmap
Deprecated since v5.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-01-24 18:23:47 +00:00
Yuxuan Shui
74ab086c70 Remove error message for -d and -S
Deprecated since v5.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-01-24 18:22:53 +00:00
Yuxuan Shui
d17c915acd Remove error message for --alpha-step
Deprecated since v5.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-01-24 18:20:42 +00:00
Yuxuan Shui
03dc98d47d Remove error messages for --dbe and --paint-on-overlay
Deprecated since v4.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-01-24 18:19:15 +00:00
Yuxuan Shui
f8424646a5 Remove the glx-swap-method option
Deprecated since v6.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-01-24 18:16:15 +00:00
Yuxuan Shui
1e757dcfad Remove the vsync-aggressive flag
Deprecated since v6.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-01-24 18:16:13 +00:00
Yuxuan Shui
e0642763b6 Remove the glx-use-gpushader4 options
Deprecated since v6.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-01-24 18:16:10 +00:00