From bfbf991af95a40ee5b6421da25b1e2e35e6002cc Mon Sep 17 00:00:00 2001 From: Richard Grenville Date: Fri, 7 Dec 2012 22:38:10 +0800 Subject: Bug fix #68: Possible fix for failure in client window detection - Note I'm not in the best state today (bad cold & sleep-deprived). This commit is likely to introduce bugs. - Attempt to fix client window detection failures happening when compton searches for client window before it's ready. - Fix build failure with role is not freed on window destruction. --- compton.h | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'compton.h') diff --git a/compton.h b/compton.h index 9bc5bd091..6b4eed221 100644 --- a/compton.h +++ b/compton.h @@ -58,7 +58,10 @@ // For compatiblity with pattern); #ifdef CONFIG_REGEX_PCRE if (cond->regex_pcre_extra) - pcre_free_study(cond->regex_pcre_extra); + LPCRE_FREE_STUDY(cond->regex_pcre_extra); if (cond->regex_pcre) pcre_free(cond->regex_pcre); #endif @@ -1077,6 +1080,7 @@ free_win_res(session_t *ps, win *w) { free(w->name); free(w->class_instance); free(w->class_general); + free(w->role); } /** @@ -1149,15 +1153,15 @@ static inline bool is_normal_win(const win *w) { } /** - * Determine if a window has a specific attribute. + * Determine if a window has a specific property. * * @param session_t current session * @param w window to check - * @param atom atom of attribute to check + * @param atom atom of property to check * @return 1 if it has the attribute, 0 otherwise */ static inline bool -wid_has_attr(const session_t *ps, Window w, Atom atom) { +wid_has_prop(const session_t *ps, Window w, Atom atom) { Atom type = None; int format; unsigned long nitems, after; @@ -1451,6 +1455,10 @@ win_update_focused(session_t *ps, win *w) { */ static inline void win_set_focused(session_t *ps, win *w, bool focused) { + // Unmapped windows will have their focused state reset on map + if (IsUnmapped == w->a.map_state) + return; + w->focused_real = focused; win_update_focused(ps, w); } @@ -1480,7 +1488,13 @@ static void calc_shadow_geometry(session_t *ps, win *w); static void -mark_client_win(session_t *ps, win *w, Window client); +win_mark_client(session_t *ps, win *w, Window client); + +static void +win_unmark_client(session_t *ps, win *w); + +static void +win_recheck_client(session_t *ps, win *w); static void add_win(session_t *ps, Window id, Window prev); @@ -1516,6 +1530,9 @@ static bool wid_get_text_prop(session_t *ps, Window wid, Atom prop, char ***pstrlst, int *pnstr); +static Window +wid_get_prop_window(session_t *ps, Window wid, Atom aprop); + static bool wid_get_name(session_t *ps, Window w, char **name); -- cgit v1.2.1