diff options
| author | allusive-dev <[email protected]> | 2023-11-08 13:04:53 +1100 |
|---|---|---|
| committer | allusive-dev <[email protected]> | 2023-11-08 13:04:53 +1100 |
| commit | c5e1978de02698f8eff33c0316ac1a0c4ed1581d (patch) | |
| tree | a70c1bdc06e77196d1e7e2c3c3fbd3b28c230596 /src | |
| parent | tweak (diff) | |
| download | compfy-c5e1978de02698f8eff33c0316ac1a0c4ed1581d.tar.xz compfy-c5e1978de02698f8eff33c0316ac1a0c4ed1581d.zip | |
backtrack
Diffstat (limited to 'src')
| -rw-r--r-- | src/atom.h | 3 | ||||
| -rw-r--r-- | src/config_libconfig.c | 18 | ||||
| -rw-r--r-- | src/options.c | 3 | ||||
| -rw-r--r-- | src/picom.c | 20 | ||||
| -rw-r--r-- | src/win.c | 13 | ||||
| -rw-r--r-- | src/wm_check.c | 22 | ||||
| -rw-r--r-- | src/wm_check.h | 6 |
7 files changed, 8 insertions, 77 deletions
@@ -23,7 +23,8 @@ WM_CLIENT_MACHINE, \ _NET_ACTIVE_WINDOW, \ _COMPTON_SHADOW, \ - _NET_WM_WINDOW_TYPE + _NET_WM_WINDOW_TYPE, \ + _NET_CURRENT_DESKTOP #define ATOM_LIST2 \ _NET_WM_WINDOW_TYPE_DESKTOP, \ diff --git a/src/config_libconfig.c b/src/config_libconfig.c index 0f6a0f1..1b81a50 100644 --- a/src/config_libconfig.c +++ b/src/config_libconfig.c @@ -468,21 +468,6 @@ char *parse_config_libconfig(options_t *opt, const char *config_file, bool *shad goto err; } } - - const char *wmNotice = checkWindowManager(); - - if (strcmp(wmNotice, "awesome") == 0) { - log_warn("Looks like you are using AwesomeWM. Applying Patches"); - } else if (strcmp(wmNotice, "herb") == 0) { - log_warn("Looks like you are using HerbstluftWM. Applying Patches"); - } else if (strcmp(wmNotice, "dwm") == 0) { - log_warn("Looks like you are using DWM. Applying Patches"); - } else if (strcmp(wmNotice, "NULL") == 0) { - log_warn("Your not using a Display Manager. Add this to your shells's rc file to ensure you will get the right patches.\n export DESKTOP_SESSION='your-window-manager'\n"); - } else { - log_warn("Looks like your WM, %s does not have any patches avaliable. This is not an Error.", wmNotice); - } - // --log-level if (config_lookup_string(&cfg, "log-level", &sval)) { auto level = string_to_log_level(sval); @@ -616,8 +601,7 @@ char *parse_config_libconfig(options_t *opt, const char *config_file, bool *shad log_fatal("Invalid window manager name passed %s", sval); goto err; } - log_warn("wm-support is deprecated. Your window manager will now be detected and have patches applied automatically"); - opt->support_for_wm = WM_SUPPORT_NONE; + opt->support_for_wm = wm; } // --opacity-rule parse_cfg_condlst_opct(opt, &cfg, "opacity-rule"); diff --git a/src/options.c b/src/options.c index e2fcd42..c98a77e 100644 --- a/src/options.c +++ b/src/options.c @@ -805,8 +805,7 @@ bool get_cfg(options_t *opt, int argc, char *const *argv, bool shadow_enable, if (wm >= WM_SUPPORT_INVALID) { log_warn("Invalid window manager %s, ignoring.", optarg); } else { - log_warn("wm-support is deprecated. Your window manager will now be detected and have patches applied automatically"); - opt->support_for_wm = WM_SUPPORT_NONE; + opt->support_for_wm = wm; } break; } diff --git a/src/picom.c b/src/picom.c index 7c350b9..c8dea67 100644 --- a/src/picom.c +++ b/src/picom.c @@ -17,7 +17,6 @@ #include <fcntl.h> #include <inttypes.h> #include <stdio.h> -#include <stdlib.h> #include <string.h> #include <unistd.h> #include <xcb/composite.h> @@ -63,8 +62,6 @@ #include "options.h" #include "uthash_extra.h" -#include "wm_check.c" - /// Get session_t pointer from a pointer to a member of session_t #define session_ptr(ptr, member) \ ({ \ @@ -838,11 +835,9 @@ paint_preprocess(session_t *ps, bool *fade_running, bool *animation_running) { if (size_changed) { win_on_win_size_change(ps, w); - const char *wm = checkWindowManager(); - - if (strcmp(wm, "awesome") == 0) { + if (ps->o.support_for_wm == WM_SUPPORT_AWESOME) { win_update_bounding_shape(ps, w); - } else if (strcmp(wm, "herb") == 0) { + } else if (ps->o.support_for_wm == WM_SUPPORT_HERB) { win_update_bounding_shape(ps, w); } else { pixman_region32_clear(&w->bounding_shape); @@ -851,17 +846,6 @@ paint_preprocess(session_t *ps, bool *fade_running, bool *animation_running) { (uint)w->widthb, (uint)w->heightb); } - // if (ps->o.support_for_wm == WM_SUPPORT_AWESOME) { - // win_update_bounding_shape(ps, w); - // } else if (ps->o.support_for_wm == WM_SUPPORT_HERB) { - // 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); @@ -34,8 +34,6 @@ #include "utils.h" #include "x.h" -#include "wm_check.h" - #ifdef CONFIG_DBUS #include "dbus.h" #endif @@ -1128,16 +1126,13 @@ double win_calc_opacity_target(session_t *ps, const struct managed_win *w) { return 0; } - - const char *wm = checkWindowManager(); - // Try obeying opacity property and window type opacity firstly if (w->has_opacity_prop) { opacity = ((double)w->opacity_prop) / OPAQUE; } else if (w->opacity_is_set && !ps->o.inactive_opacity_override) { opacity = w->opacity_set; } else if (w->opacity_is_set && ps->o.inactive_opacity_override) { - if (strcmp(wm, "dwm") == 0) { + if (ps->o.support_for_wm == WM_SUPPORT_DWM) { if (win_is_focused_raw(ps, w)) { if (c2_match(ps, w, ps->o.active_opacity_blacklist, NULL)) { opacity = 1.0; @@ -1215,10 +1210,7 @@ bool win_should_dim(session_t *ps, const struct managed_win *w) { return false; } - const char *wm = checkWindowManager(); - - if (strcmp(wm, "dwm") == 0) { - // printf("DWM True\n"); + if (ps->o.support_for_wm == WM_SUPPORT_DWM) { if (ps->o.inactive_dim > 0 && !win_is_focused_raw(ps, w)) { if (c2_match(ps, w, ps->o.inactive_opacity_blacklist, NULL)) { return false; @@ -1229,7 +1221,6 @@ bool win_should_dim(session_t *ps, const struct managed_win *w) { return false; } } else { - // printf("DWM False\n"); if (ps->o.inactive_dim > 0 && !win_is_focused_raw(ps, w)) { if (c2_match(ps, w, ps->o.inactive_opacity_blacklist, NULL)) { return false; diff --git a/src/wm_check.c b/src/wm_check.c deleted file mode 100644 index 462f68b..0000000 --- a/src/wm_check.c +++ /dev/null @@ -1,22 +0,0 @@ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -const char *checkWindowManager() { - char *desktopSession = getenv("DESKTOP_SESSION"); - if (strlen(desktopSession) == 0) { - return "NULL"; - } else { - if (strstr(desktopSession, "xmonad") != NULL) { - return "xmonad"; - } else if (strstr(desktopSession, "herb") != NULL) { - return "herb"; - } else if (strstr(desktopSession, "awesome") != NULL) { - return "awesome"; - } else if (strstr(desktopSession, "dwm") != NULL) { - return "dwm"; - } else { - return "empty"; - } - } -}
\ No newline at end of file diff --git a/src/wm_check.h b/src/wm_check.h deleted file mode 100644 index 0b95d4d..0000000 --- a/src/wm_check.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef WINDOW_MANAGER_CHECKER_H -#define WINDOW_MANAGER_CHECKER_H - -const char *checkWindowManager(); - -#endif
\ No newline at end of file |