if (winfocus == NULL || winfocus == win)
winfocus = TAILQ_NEXT(cur_focus, entry);
done:
- if (winfocus == winlostfocus || winfocus == NULL)
+ if (winfocus == winlostfocus || winfocus == NULL) {
+ /* update the bar so that title/class/name will be cleared. */
+ if (window_name_enabled || title_name_enabled || title_class_enabled)
+ bar_update();
+
return;
+ }
focus_magic(winfocus);
}
/* skip iconics */
if (winfocus && winfocus->iconic) {
- TAILQ_FOREACH_REVERSE(winfocus, wl, ws_win_list, entry)
+ while (winfocus != cur_focus) {
+ if (winfocus == NULL)
+ winfocus = TAILQ_LAST(wl, ws_win_list);
if (winfocus->iconic == 0)
break;
+ winfocus = TAILQ_PREV(winfocus, ws_win_list, entry);
+ }
}
break;
/* skip iconics */
if (winfocus && winfocus->iconic) {
- TAILQ_FOREACH(winfocus, wl, entry)
+ while (winfocus != cur_focus) {
+ if (winfocus == NULL)
+ winfocus = TAILQ_FIRST(wl);
if (winfocus->iconic == 0)
break;
+ winfocus = TAILQ_NEXT(winfocus, entry);
+ }
}
break;
default:
return;
}
- if (winfocus == winlostfocus || winfocus == NULL)
+ if (winfocus == winlostfocus || winfocus == NULL) {
+ /* update the bar so that title/class/name will be cleared. */
+ if (window_name_enabled || title_name_enabled || title_class_enabled)
+ bar_update();
+
return;
+ }
focus_magic(winfocus);
}
}
switch (ev->atom) {
- case XA_WM_NORMAL_HINTS:
#if 0
+ case XA_WM_NORMAL_HINTS:
long mask;
XGetWMNormalHints(display, win->id, &win->sh, &mask);
fprintf(stderr, "normal hints: flag 0x%x\n", win->sh.flags);
XMoveResizeWindow(display, win->id,
win->g.x, win->g.y, win->g.w, win->g.h);
#endif
+ case XA_WM_CLASS:
+ if (title_name_enabled || title_class_enabled)
+ bar_update();
+ break;
+ case XA_WM_NAME:
if (window_name_enabled)
bar_update();
break;