summaryrefslogtreecommitdiffstats
path: root/compton.h
diff options
context:
space:
mode:
authorRichard Grenville <[email protected]>2013-09-18 21:50:57 +0800
committerRichard Grenville <[email protected]>2013-09-18 22:41:40 +0800
commit2b534cd86445fcd770948bbb79f4732361259ab9 (patch)
tree38cbed58124b2e713d426bb60df9d078c355571c /compton.h
parent6e82deb05b7e8d4c183d33c5a4acb978cf465b46 (diff)
downloadtdebase-2b534cd86445fcd770948bbb79f4732361259ab9.tar.gz
tdebase-2b534cd86445fcd770948bbb79f4732361259ab9.zip
Bug fix #99: Rewrite focus detection logic
- Rewrite focus detection logic. Remove w->focused_real and use ps->active_win to identify focused window uniformly. Use a more expensive way to filter FocusIn/Out events to improve reliability. Only limited tests are done, and bugs are likely to be introduced. (#99) - Known issue: Under fvwm, compton sometimes does not consistently report the window input gets sent to. But there's something wrong in that case: XGetInputFocus() shows the root window is focused but another window is receiving input.
Diffstat (limited to 'compton.h')
-rw-r--r--compton.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/compton.h b/compton.h
index 1180ce32c..11325b75c 100644
--- a/compton.h
+++ b/compton.h
@@ -563,6 +563,20 @@ clear_cache_win_leaders(session_t *ps) {
static win *
find_toplevel2(session_t *ps, Window wid);
+/**
+ * Find matched window.
+ */
+static inline win *
+find_win_all(session_t *ps, const Window wid) {
+ if (!wid || PointerRoot == wid || wid == ps->root || wid == ps->overlay)
+ return NULL;
+
+ win *w = find_win(ps, wid);
+ if (!w) w = find_toplevel(ps, wid);
+ if (!w) w = find_toplevel2(ps, wid);
+ return w;
+}
+
static Window
win_get_leader_raw(session_t *ps, win *w, int recursions);
@@ -589,7 +603,7 @@ group_is_focused(session_t *ps, Window leader) {
for (win *w = ps->list; w; w = w->next) {
if (win_get_leader(ps, w) == leader && !w->destroyed
- && w->focused_real)
+ && win_is_focused_real(ps, w))
return true;
}
@@ -765,6 +779,9 @@ static inline void
win_set_focused(session_t *ps, win *w, bool focused);
static void
+win_on_focus_change(session_t *ps, win *w);
+
+static void
win_determine_fade(session_t *ps, win *w);
static void