summaryrefslogtreecommitdiffstats
path: root/compton.c
diff options
context:
space:
mode:
authorRichard Grenville <[email protected]>2013-03-10 18:45:54 +0800
committerRichard Grenville <[email protected]>2013-03-10 18:45:54 +0800
commit07ed9901e7a6ff65a6baa2dcf95e206dc6970ca5 (patch)
tree375316b107a99443a3f8c6588492bb4b907015e6 /compton.c
parentdc4da095bb876c4ba2b77050b35883e59af944a6 (diff)
downloadtdebase-07ed9901e7a6ff65a6baa2dcf95e206dc6970ca5.tar.gz
tdebase-07ed9901e7a6ff65a6baa2dcf95e206dc6970ca5.zip
Improvement: ARGB window matching & Enable track_focus with D-Bus
- Add predefined matching target "argb" to match ARGB windows. - Make it possible to enable focus tracking on-the-fly with D-Bus method.
Diffstat (limited to 'compton.c')
-rw-r--r--compton.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/compton.c b/compton.c
index ff1dd4975..8bd853384 100644
--- a/compton.c
+++ b/compton.c
@@ -1822,6 +1822,9 @@ map_win(session_t *ps, Window id) {
// Make sure the XSelectInput() requests are sent
XSync(ps->dpy, False);
+ // Update window mode here to do matching of ARGB
+ win_determine_mode(ps, w);
+
// Detect client window here instead of in add_win() as the client
// window should have been prepared at this point
if (!w->client_win) {
@@ -1982,8 +1985,6 @@ win_determine_mode(session_t *ps, win *w) {
winmode_t mode = WMODE_SOLID;
XRenderPictFormat *format;
- /* if trans prop == -1 fall back on previous tests */
-
if (w->a.class == InputOnly) {
format = 0;
} else {
@@ -3247,6 +3248,29 @@ win_set_invert_color_force(session_t *ps, win *w, switch_t val) {
win_determine_invert_color(ps, w);
}
}
+
+/**
+ * Enable focus tracking.
+ */
+void
+opts_init_track_focus(session_t *ps) {
+ // Already tracking focus
+ if (ps->o.track_focus)
+ return;
+
+ ps->o.track_focus = true;
+
+ if (!ps->o.use_ewmh_active_win) {
+ // Start listening to FocusChange events
+ for (win *w = ps->list; w; w = w->next)
+ if (IsViewable == w->a.map_state)
+ XSelectInput(ps->dpy, w->id,
+ determine_evmask(ps, w->id, WIN_EVMODE_FRAME));
+ }
+
+ // Recheck focus
+ recheck_focus(ps);
+}
//!@}
#endif