diff --git a/compton.sample.conf b/compton.sample.conf index c84ef04..46d5056 100644 --- a/compton.sample.conf +++ b/compton.sample.conf @@ -18,7 +18,6 @@ shadow-exclude = [ "_GTK_FRAME_EXTENTS@:c" ]; # shadow-exclude = "n:e:Notification"; -shadow-ignore-shaped = false; # shadow-exclude-reg = "x10+0+0"; # xinerama-shadow-crop = true; diff --git a/man/compton.1.asciidoc b/man/compton.1.asciidoc index 35d0d21..dff1665 100644 --- a/man/compton.1.asciidoc +++ b/man/compton.1.asciidoc @@ -291,7 +291,7 @@ With greater-than/less-than operators it looks like: 'NEGATION' (optional) is one or more exclamation marks; -'TARGET' is either a predefined target name, or the name of a window property to match. Supported predefined targets are `id`, `x`, `y`, `x2` (x + widthb), `y2`, `width`, `height`, `widthb` (width + 2 * border), `heightb`, `override_redirect`, `argb` (whether the window has an ARGB visual), `focused`, `wmwin` (whether the window looks like a WM window, i.e. has no child window with `WM_STATE` and is not override-redirected), `client` (ID of client window), `window_type` (window type in string), `leader` (ID of window leader), `name`, `class_g` (= `WM_CLASS[1]`), `class_i` (= `WM_CLASS[0]`), and `role`. +'TARGET' is either a predefined target name, or the name of a window property to match. Supported predefined targets are `id`, `x`, `y`, `x2` (x + widthb), `y2`, `width`, `height`, `widthb` (width + 2 * `border_width`), `heightb`, `override_redirect`, `argb` (whether the window has an ARGB visual), `focused`, `wmwin` (whether the window looks like a WM window, i.e. has no child window with `WM_STATE` and is not override-redirected), `bounding_shaped`, `rounded_corners` (requires *--detect-rounded-corners*), `client` (ID of client window), `window_type` (window type in string), `leader` (ID of window leader), `name`, `class_g` (= `WM_CLASS[1]`), `class_i` (= `WM_CLASS[0]`), and `role`. 'CLIENT/FRAME' is a single `@` if the window attribute should be be looked up on client window, nothing if on frame window; diff --git a/src/c2.c b/src/c2.c index f70dcb5..6baf133 100644 --- a/src/c2.c +++ b/src/c2.c @@ -764,6 +764,7 @@ c2_l_postprocess(session_t *ps, c2_l_t *pleaf) { if (pleaf->predef) { switch (pleaf->predef) { case C2_L_PFOCUSED: ps->o.track_focus = true; break; + // case C2_L_PROUNDED: ps->o.detect_rounded_corners = true; break; case C2_L_PNAME: case C2_L_PCLASSG: case C2_L_PCLASSI: @@ -1057,6 +1058,8 @@ c2_match_once_leaf(session_t *ps, win *w, const c2_l_t *pleaf, case C2_L_PARGB: tgt = (WMODE_ARGB == w->mode); break; case C2_L_PFOCUSED: tgt = win_is_focused_real(ps, w); break; case C2_L_PWMWIN: tgt = w->wmwin; break; + case C2_L_PBSHAPED: tgt = w->bounding_shaped; break; + case C2_L_PROUNDED: tgt = w->rounded_corners; break; case C2_L_PCLIENT: tgt = w->client_win; break; case C2_L_PLEADER: tgt = w->leader; break; default: *perr = true; assert(0); break; diff --git a/src/c2.h b/src/c2.h index 3c56e2f..e9aaf8b 100644 --- a/src/c2.h +++ b/src/c2.h @@ -113,6 +113,8 @@ struct _c2_l { C2_L_PARGB, C2_L_PFOCUSED, C2_L_PWMWIN, + C2_L_PBSHAPED, + C2_L_PROUNDED, C2_L_PCLIENT, C2_L_PWINDOWTYPE, C2_L_PLEADER, @@ -201,6 +203,8 @@ const static c2_predef_t C2_PREDEFS[] = { [C2_L_PARGB ] = { "argb" , C2_L_TCARDINAL , 0 }, [C2_L_PFOCUSED ] = { "focused" , C2_L_TCARDINAL , 0 }, [C2_L_PWMWIN ] = { "wmwin" , C2_L_TCARDINAL , 0 }, + [C2_L_PBSHAPED ] = { "bounding_shaped" , C2_L_TCARDINAL , 0 }, + [C2_L_PROUNDED ] = { "rounded_corners" , C2_L_TCARDINAL , 0 }, [C2_L_PCLIENT ] = { "client" , C2_L_TWINDOW , 0 }, [C2_L_PWINDOWTYPE ] = { "window_type" , C2_L_TSTRING , 0 }, [C2_L_PLEADER ] = { "leader" , C2_L_TWINDOW , 0 }, diff --git a/src/common.h b/src/common.h index d563c37..bbbfeae 100644 --- a/src/common.h +++ b/src/common.h @@ -1962,7 +1962,7 @@ rect_is_fullscreen(session_t *ps, int x, int y, unsigned wid, unsigned hei) { static inline bool win_is_fullscreen(session_t *ps, const win *w) { return rect_is_fullscreen(ps, w->a.x, w->a.y, w->widthb, w->heightb) - && !w->bounding_shaped; + && (!w->bounding_shaped || w->rounded_corners); } /** diff --git a/src/compton.c b/src/compton.c index 14d7d07..00464ff 100644 --- a/src/compton.c +++ b/src/compton.c @@ -647,6 +647,8 @@ wid_get_prop_adv(const session_t *ps, Window w, Atom atom, long offset, */ static void win_rounded_corners(session_t *ps, win *w) { + w->rounded_corners = false; + if (!w->bounding_shaped) return; @@ -676,11 +678,9 @@ win_rounded_corners(session_t *ps, win *w) { for (i = 0; i < nrects; ++i) if (rects[i].width >= minwidth && rects[i].height >= minheight) { w->rounded_corners = true; - cxfree(rects); - return; + break; } - w->rounded_corners = false; cxfree(rects); } @@ -4483,10 +4483,15 @@ usage(int ret) { "--no-fading-openclose\n" " Do not fade on window open/close.\n" "--shadow-ignore-shaped\n" - " Do not paint shadows on shaped windows.\n" + " Do not paint shadows on shaped windows. (Deprecated, use\n" + " --shadow-exclude \'bounding_shaped\' or\n" + " --shadow-exclude \'bounding_shaped && !rounded_corners\' instead.)\n" "--detect-rounded-corners\n" " Try to detect windows with rounded corners and don't consider\n" - " them shaped windows.\n" + " them shaped windows. Affects --shadow-ignore-shaped,\n" + " --unredir-if-possible, and possibly others. You need to turn this\n" + " on manually if you want to match against rounded_corners in\n" + " conditions.\n" "--detect-client-opacity\n" " Detect _NET_WM_OPACITY on client windows, useful for window\n" " managers not passing _NET_WM_OPACITY of client windows to frame\n"