Bug fix: Detect and mark WM windows as active

See chjj's comments on issue #39:
https://github.com/chjj/compton/issues/39#issuecomment-8533360

- Add a switch --mark-wmwin-focused that try to detect WM windows and
  mark them active.

- Fix a bug that causes BadDrawable, etc. if a window is mapped then
  immediately unmapped.

- Fix a bug in determine_evmask().

- Add a debug option DEBUG_CLIENTWIN.

- Force window repaint on window frame extent change.

- Code cleanup.
This commit is contained in:
Richard Grenville
2012-09-20 13:50:27 +08:00
parent 778a8b177c
commit 8724101c0a
2 changed files with 68 additions and 64 deletions

View File

@ -34,6 +34,7 @@
// #define DEBUG_EVENTS 1
// #define DEBUG_RESTACK 1
// #define DEBUG_WINTYPE 1
// #define DEBUG_CLIENTWIN 1
// #define MONITOR_REPAINT 1
// For printing timestamps
@ -488,11 +489,7 @@ static Window
find_client_win(Display *dpy, Window w);
static void
get_frame_extents(Display *dpy, Window w,
unsigned int *left,
unsigned int *right,
unsigned int *top,
unsigned int *bottom);
get_frame_extents(Display *dpy, win *w, Window client);
static win *
paint_preprocess(Display *dpy, win *list);
@ -543,6 +540,13 @@ calc_opacity(Display *dpy, win *w, Bool refetch_prop);
static void
calc_dim(Display *dpy, win *w);
static inline void
set_focused(Display *dpy, win *w, Bool focused) {
w->focused = focused;
calc_opacity(dpy, w, False);
calc_dim(dpy, w);
}
static void
determine_fade(Display *dpy, win *w);