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:
Richard Grenville 2012-09-26 19:48:36 +08:00
parent 606e2d7061
commit 8c0379180b
3 changed files with 18 additions and 2 deletions

View File

@ -27,6 +27,7 @@ fade-out-step = 0.03
# Other
mark-wmwin-focused = true;
mark-ovredir-focused = true;
# Window type settings
wintypes:

View File

@ -125,6 +125,7 @@ static options_t opts = {
.frame_opacity = 0.0,
.inactive_dim = 0.0,
.mark_wmwin_focused = False,
.mark_ovredir_focused = False,
.shadow_blacklist = NULL,
.fade_blacklist = NULL,
.fork_after_register = False,
@ -1584,8 +1585,10 @@ map_win(Display *dpy, Window id,
if (opts.track_focus) {
recheck_focus(dpy);
// Consider a window without client window a WM window and mark it
// focused if mark_wmwin_focused is on
if (opts.mark_wmwin_focused && !w->client_win)
// focused if mark_wmwin_focused is on, or it's over-redirected and
// mark_ovredir_focused is on
if ((opts.mark_wmwin_focused && !w->client_win)
|| (opts.mark_ovredir_focused && w->a.override_redirect))
w->focused = True;
}
@ -2880,6 +2883,8 @@ usage(void) {
" Try to detect WM windows and mark them as active.\n"
"--shadow-exclude condition\n"
" Exclude conditions for shadows.\n"
"--mark-ovredir-focused\n"
" Mark over-redirect windows as active.\n"
"\n"
"Format of a condition:\n"
"\n"
@ -3127,6 +3132,9 @@ parse_config(char *cpath, struct options_tmp *pcfgtmp) {
config_lookup_float(&cfg, "inactive-dim", &opts.inactive_dim);
// --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
{
config_setting_t *setting =
@ -3185,6 +3193,7 @@ get_cfg(int argc, char *const *argv) {
{ "inactive-dim", required_argument, NULL, 261 },
{ "mark-wmwin-focused", no_argument, NULL, 262 },
{ "shadow-exclude", required_argument, NULL, 263 },
{ "mark-ovredir-focused", no_argument, NULL, 264 },
// Must terminate with a NULL entry
{ NULL, 0, NULL, 0 },
};
@ -3319,6 +3328,10 @@ get_cfg(int argc, char *const *argv) {
// --shadow-exclude
condlst_add(&opts.shadow_blacklist, optarg);
break;
case 264:
// --mark-ovredir-focused
opts.mark_ovredir_focused = True;
break;
default:
usage();
break;

View File

@ -246,6 +246,8 @@ typedef struct _options {
char *display;
/// Whether to try to detect WM windows and mark them as focused.
Bool mark_wmwin_focused;
/// Whether to mark override-redirect windows as focused.
Bool mark_ovredir_focused;
/// Whether to fork to background.
Bool fork_after_register;
Bool synchronize;