summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Grenville <pyxlcy@gmail.com>2012-09-26 19:48:36 +0800
committerRichard Grenville <pyxlcy@gmail.com>2012-09-26 19:48:36 +0800
commit10ede8999852630fd375f3eb11e501f0e60eee4e (patch)
tree1a8422fdb69fdaa457b5a61581c434e5b272e7d3
parent60f724a30a4814095bb219433f704d099ad46ebb (diff)
downloadtdebase-10ede899.tar.gz
tdebase-10ede899.zip
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.
-rw-r--r--compton.c17
-rw-r--r--compton.h2
2 files changed, 17 insertions, 2 deletions
diff --git a/compton.c b/compton.c
index 0d1f30e7a..8294dd99d 100644
--- a/compton.c
+++ b/compton.c
@@ -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;
diff --git a/compton.h b/compton.h
index 77166a666..f785981e9 100644
--- a/compton.h
+++ b/compton.h
@@ -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;