diff options
| author | Patrick <devnull@mailinator.com> | 2017-06-09 18:12:18 +0800 |
|---|---|---|
| committer | Patrick <devnull@mailinator.com> | 2017-06-09 18:12:18 +0800 |
| commit | 6296055b03839a50c8f0ae00fc1584b627ec86e2 (patch) | |
| tree | 1bdf5b6d411a77f6c5dc9e2d9824774c1e47e82f | |
| parent | 5bc9b12ced99e942ea4eea122fb70dda7042b60c (diff) | |
apply window viewability heuristic from x-window-list
| -rw-r--r-- | x-alt-tab.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/x-alt-tab.c b/x-alt-tab.c index c5acc16..619c302 100644 --- a/x-alt-tab.c +++ b/x-alt-tab.c @@ -19,11 +19,18 @@ void x_alt_tab(Rotation r, Display *dpy, Window *wins, unsigned int nwins) { unsigned int vc = 0; // make list of viewable windows - XWindowAttributes attr; for (w = wins; w - wins < nwins; w++) { - XGetWindowAttributes(dpy, *w, &attr); - if (attr.map_state == IsViewable) - viewables[vc++] = w; + XWindowAttributes attr; + + if (! XGetWMHints(dpy, *w)) + continue; + if (! XGetWindowAttributes(dpy, *w, &attr)) + continue; + if (attr.override_redirect) + continue; + if (attr.map_state != IsViewable) + continue; + viewables[vc++] = w; } viewables[vc] = NULL; |
