Bug fix: Issue #46: Optionally mark override-redirect windows as active
Attempt to fix the transparency issue of Firefox and Chromium location bar dropdown window by marking override_redirect windows as active. This may not work completely and could have other side effects. Experimental. Enable by using --mark-ovredir-focused.
This commit is contained in:
parent
606e2d7061
commit
8c0379180b
@ -27,6 +27,7 @@ fade-out-step = 0.03
|
|||||||
|
|
||||||
# Other
|
# Other
|
||||||
mark-wmwin-focused = true;
|
mark-wmwin-focused = true;
|
||||||
|
mark-ovredir-focused = true;
|
||||||
|
|
||||||
# Window type settings
|
# Window type settings
|
||||||
wintypes:
|
wintypes:
|
||||||
|
@ -125,6 +125,7 @@ static options_t opts = {
|
|||||||
.frame_opacity = 0.0,
|
.frame_opacity = 0.0,
|
||||||
.inactive_dim = 0.0,
|
.inactive_dim = 0.0,
|
||||||
.mark_wmwin_focused = False,
|
.mark_wmwin_focused = False,
|
||||||
|
.mark_ovredir_focused = False,
|
||||||
.shadow_blacklist = NULL,
|
.shadow_blacklist = NULL,
|
||||||
.fade_blacklist = NULL,
|
.fade_blacklist = NULL,
|
||||||
.fork_after_register = False,
|
.fork_after_register = False,
|
||||||
@ -1584,8 +1585,10 @@ map_win(Display *dpy, Window id,
|
|||||||
if (opts.track_focus) {
|
if (opts.track_focus) {
|
||||||
recheck_focus(dpy);
|
recheck_focus(dpy);
|
||||||
// Consider a window without client window a WM window and mark it
|
// Consider a window without client window a WM window and mark it
|
||||||
// focused if mark_wmwin_focused is on
|
// focused if mark_wmwin_focused is on, or it's over-redirected and
|
||||||
if (opts.mark_wmwin_focused && !w->client_win)
|
// mark_ovredir_focused is on
|
||||||
|
if ((opts.mark_wmwin_focused && !w->client_win)
|
||||||
|
|| (opts.mark_ovredir_focused && w->a.override_redirect))
|
||||||
w->focused = True;
|
w->focused = True;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2880,6 +2883,8 @@ usage(void) {
|
|||||||
" Try to detect WM windows and mark them as active.\n"
|
" Try to detect WM windows and mark them as active.\n"
|
||||||
"--shadow-exclude condition\n"
|
"--shadow-exclude condition\n"
|
||||||
" Exclude conditions for shadows.\n"
|
" Exclude conditions for shadows.\n"
|
||||||
|
"--mark-ovredir-focused\n"
|
||||||
|
" Mark over-redirect windows as active.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Format of a condition:\n"
|
"Format of a condition:\n"
|
||||||
"\n"
|
"\n"
|
||||||
@ -3127,6 +3132,9 @@ parse_config(char *cpath, struct options_tmp *pcfgtmp) {
|
|||||||
config_lookup_float(&cfg, "inactive-dim", &opts.inactive_dim);
|
config_lookup_float(&cfg, "inactive-dim", &opts.inactive_dim);
|
||||||
// --mark-wmwin-focused
|
// --mark-wmwin-focused
|
||||||
lcfg_lookup_bool(&cfg, "mark-wmwin-focused", &opts.mark_wmwin_focused);
|
lcfg_lookup_bool(&cfg, "mark-wmwin-focused", &opts.mark_wmwin_focused);
|
||||||
|
// --mark-ovredir-focused
|
||||||
|
lcfg_lookup_bool(&cfg, "mark-ovredir-focused",
|
||||||
|
&opts.mark_ovredir_focused);
|
||||||
// --shadow-exclude
|
// --shadow-exclude
|
||||||
{
|
{
|
||||||
config_setting_t *setting =
|
config_setting_t *setting =
|
||||||
@ -3185,6 +3193,7 @@ get_cfg(int argc, char *const *argv) {
|
|||||||
{ "inactive-dim", required_argument, NULL, 261 },
|
{ "inactive-dim", required_argument, NULL, 261 },
|
||||||
{ "mark-wmwin-focused", no_argument, NULL, 262 },
|
{ "mark-wmwin-focused", no_argument, NULL, 262 },
|
||||||
{ "shadow-exclude", required_argument, NULL, 263 },
|
{ "shadow-exclude", required_argument, NULL, 263 },
|
||||||
|
{ "mark-ovredir-focused", no_argument, NULL, 264 },
|
||||||
// Must terminate with a NULL entry
|
// Must terminate with a NULL entry
|
||||||
{ NULL, 0, NULL, 0 },
|
{ NULL, 0, NULL, 0 },
|
||||||
};
|
};
|
||||||
@ -3319,6 +3328,10 @@ get_cfg(int argc, char *const *argv) {
|
|||||||
// --shadow-exclude
|
// --shadow-exclude
|
||||||
condlst_add(&opts.shadow_blacklist, optarg);
|
condlst_add(&opts.shadow_blacklist, optarg);
|
||||||
break;
|
break;
|
||||||
|
case 264:
|
||||||
|
// --mark-ovredir-focused
|
||||||
|
opts.mark_ovredir_focused = True;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
usage();
|
usage();
|
||||||
break;
|
break;
|
||||||
|
@ -246,6 +246,8 @@ typedef struct _options {
|
|||||||
char *display;
|
char *display;
|
||||||
/// Whether to try to detect WM windows and mark them as focused.
|
/// Whether to try to detect WM windows and mark them as focused.
|
||||||
Bool mark_wmwin_focused;
|
Bool mark_wmwin_focused;
|
||||||
|
/// Whether to mark override-redirect windows as focused.
|
||||||
|
Bool mark_ovredir_focused;
|
||||||
/// Whether to fork to background.
|
/// Whether to fork to background.
|
||||||
Bool fork_after_register;
|
Bool fork_after_register;
|
||||||
Bool synchronize;
|
Bool synchronize;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user