aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorallusive-dev <[email protected]>2023-11-03 09:59:00 +1100
committerallusive-dev <[email protected]>2023-11-03 09:59:00 +1100
commitb072635252b2d1d1ebac50d38bfcd8f0c6cdc36e (patch)
tree2d72dc27730f3e8407f3a83e95631c20f1279584
parentMerge pull request #22 from IogaMaster/flake (diff)
downloadcompfy-b072635252b2d1d1ebac50d38bfcd8f0c6cdc36e.tar.xz
compfy-b072635252b2d1d1ebac50d38bfcd8f0c6cdc36e.zip
Added wm-support and re-arranged patches. This update will also make changes to the nixos package
-rw-r--r--meson.build2
-rw-r--r--src/config.c11
-rw-r--r--src/config.h10
-rw-r--r--src/config_libconfig.c9
-rw-r--r--src/options.c19
-rw-r--r--src/picom.c13
6 files changed, 54 insertions, 10 deletions
diff --git a/meson.build b/meson.build
index d49c115..e6c9c9a 100644
--- a/meson.build
+++ b/meson.build
@@ -1,4 +1,4 @@
-project('picom', 'c', version: '1.2.2',
+project('picom', 'c', version: '1.2.5',
default_options: ['c_std=c11', 'warning_level=1'])
cc = meson.get_compiler('c')
diff --git a/src/config.c b/src/config.c
index 605cde8..d0724e8 100644
--- a/src/config.c
+++ b/src/config.c
@@ -782,6 +782,15 @@ enum open_window_animation parse_open_window_animation(const char *src) {
return OPEN_WINDOW_ANIMATION_INVALID;
}
+enum wm_support parse_wm_support(const char *src) {
+ if (strcmp(src, "none") == 0) {
+ return WM_SUPPORT_NONE;
+ }else if (strcmp(src, "awesome") == 0) {
+ return WM_SUPPORT_AWESOME;
+ }
+ return WM_SUPPORT_INVALID;
+}
+
char *parse_config(options_t *opt, const char *config_file, bool *shadow_enable,
bool *fading_enable, bool *hasneg, win_option_mask_t *winopt_mask) {
// clang-format off
@@ -846,6 +855,8 @@ char *parse_config(options_t *opt, const char *config_file, bool *shadow_enable,
.corner_rules = NULL,
.blur_rules = NULL,
+ .support_for_wm = WM_SUPPORT_NONE,
+
.inactive_opacity = 1.0,
.inactive_opacity_override = false,
.active_opacity = 1.0,
diff --git a/src/config.h b/src/config.h
index e495d6e..e9f4172 100644
--- a/src/config.h
+++ b/src/config.h
@@ -54,6 +54,12 @@ enum open_window_animation {
OPEN_WINDOW_ANIMATION_INVALID,
};
+enum wm_support {
+ WM_SUPPORT_NONE = 0,
+ WM_SUPPORT_AWESOME,
+ WM_SUPPORT_INVALID,
+};
+
typedef struct win_option_mask {
bool shadow : 1;
bool fade : 1;
@@ -221,6 +227,9 @@ typedef struct options {
/// Whether to clamp animations
bool animation_clamping;
+ // Wm Support
+ enum wm_support support_for_wm;
+
// === Opacity ===
/// Default opacity for inactive windows.
/// 32-bit integer with the format of _NET_WM_WINDOW_OPACITY.
@@ -328,6 +337,7 @@ char *must_use locate_auxiliary_file(const char *scope, const char *path,
const char *include_dir);
enum blur_method must_use parse_blur_method(const char *src);
enum open_window_animation must_use parse_open_window_animation(const char *src);
+enum wm_support must_use parse_wm_support(const char *src);
/**
* Add a pattern to a condition linked list.
diff --git a/src/config_libconfig.c b/src/config_libconfig.c
index f44049e..0a5902e 100644
--- a/src/config_libconfig.c
+++ b/src/config_libconfig.c
@@ -590,6 +590,15 @@ char *parse_config_libconfig(options_t *opt, const char *config_file, bool *shad
parse_cfg_condlst_corner(opt, &cfg, "corners-rule");
// blur-rule
parse_cfg_condlst(&cfg, &opt->blur_rules, "blur-rule");
+ // wm-support
+ if (config_lookup_string(&cfg, "wm-support", &sval)) {
+ enum wm_support wm = parse_wm_support(sval);
+ if (wm >= WM_SUPPORT_INVALID) {
+ log_fatal("Invalid window manager name passed %s", sval);
+ goto err;
+ }
+ opt->support_for_wm = wm;
+ }
// --opacity-rule
parse_cfg_condlst_opct(opt, &cfg, "opacity-rule");
// --unredir-if-possible-exclude
diff --git a/src/options.c b/src/options.c
index c3eccab..87f0fa3 100644
--- a/src/options.c
+++ b/src/options.c
@@ -183,10 +183,11 @@ static const struct picom_option picom_options[] = {
{"animation-for-open-window", required_argument, 809, NULL, "open window animation"},
// {"animation-for-transient-window", required_argument, 810, NULL, "transient window animation"},
{"animation-for-unmap-window", required_argument, 811, NULL, "unmap window animation"},
- {"corners-rule", required_argument, NULL, 812, "rounded corner rules"},
- {"blur-rule", required_argument, NULL, 813, "blur rules"},
- {"animation-open-exclude", required_argument, NULL, 814, "animation open exclude list"},
- {"animation-unmap-exclude", required_argument, NULL, 815, "animation unmap exclude list"},
+ {"corners-rule", required_argument, 812, NULL, "rounded corner rules"},
+ {"blur-rule", required_argument, 813, NULL, "blur rules"},
+ {"animation-open-exclude", required_argument, 814, NULL, "animation open exclude list"},
+ {"animation-unmap-exclude", required_argument, 815, NULL, "animation unmap exclude list"},
+ {"wm-support", required_argument, 816, NULL, "Set specific window manager support"},
};
// clang-format on
@@ -796,6 +797,16 @@ bool get_cfg(options_t *opt, int argc, char *const *argv, bool shadow_enable,
case 815:
condlst_add(&opt->animation_unmap_blacklist, optarg);
break;
+ case 816: {
+ // wm-support
+ enum wm_support wm = parse_wm_support(optarg);
+ if (wm >= WM_SUPPORT_INVALID) {
+ log_warn("Invalid window manager %s, ignoring.", optarg);
+ } else {
+ opt->support_for_wm = wm;
+ }
+ break;
+ }
default: usage(argv[0], 1); break;
#undef P_CASEBOOL
}
diff --git a/src/picom.c b/src/picom.c
index 727896f..46f74cd 100644
--- a/src/picom.c
+++ b/src/picom.c
@@ -835,11 +835,14 @@ paint_preprocess(session_t *ps, bool *fade_running, bool *animation_running) {
if (size_changed) {
win_on_win_size_change(ps, w);
- // pixman_region32_clear(&w->bounding_shape);
- // pixman_region32_fini(&w->bounding_shape);
- // pixman_region32_init_rect(&w->bounding_shape, 0, 0,
- // (uint)w->widthb, (uint)w->heightb);
- win_update_bounding_shape(ps, w);
+ if (ps->o.support_for_wm == WM_SUPPORT_AWESOME) {
+ win_update_bounding_shape(ps, w);
+ } else {
+ pixman_region32_clear(&w->bounding_shape);
+ pixman_region32_fini(&w->bounding_shape);
+ pixman_region32_init_rect(&w->bounding_shape, 0, 0,
+ (uint)w->widthb, (uint)w->heightb);
+ }
if (w->state != WSTATE_DESTROYING)
win_clear_flags(w, WIN_FLAGS_PIXMAP_STALE);