Bug fix #191: Add rounded-corners detection to --unredir-if-possible

Add `bounding_shape` and `rounded_corners` as condition match target.
Deprecate --shadow-ignore-shaped. Add rounded-corners detection to
win_is_fullscreen(). Slightly modify win_rounded_corners() logic. Thanks
to tdryer for reporting. (#191)
This commit is contained in:
Richard Grenville
2014-04-21 22:45:27 +08:00
parent 15cd6aad38
commit ef58e4e417
6 changed files with 19 additions and 8 deletions

View File

@ -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"