X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=scrotwm.c;h=5757fc3f146c83514413dce515a766678488926d;hb=641cdb0fc683e4645bd45f3d3c744f95da1153eb;hp=658696b1a93cae32099d889c8dfb4cd6ba57311f;hpb=043047d54808a281ff6e65ae43d913d740ed1ee2;p=spectrwm.git diff --git a/scrotwm.c b/scrotwm.c index 658696b..5757fc3 100644 --- a/scrotwm.c +++ b/scrotwm.c @@ -1485,6 +1485,13 @@ bar_update(void) } void +bar_check_opts(void) +{ + if (title_class_enabled || title_name_enabled || window_name_enabled) + bar_update(); +} + +void bar_signal(int sig) { bar_alarm = 1; @@ -2215,8 +2222,7 @@ focus_win(struct ws_win *win) PropModeReplace, (unsigned char *)&win->id,1); } - if (window_name_enabled || title_class_enabled || title_name_enabled) - bar_update(); + bar_check_opts(); } void @@ -2532,15 +2538,8 @@ focus_prev(struct ws_win *win) winfocus = TAILQ_LAST(wl, ws_win_list); if (winfocus == NULL || winfocus == win) winfocus = TAILQ_NEXT(cur_focus, entry); -done: - 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; - } +done: focus_magic(winfocus); } @@ -2644,14 +2643,6 @@ focus(struct swm_region *r, union arg *args) default: return; } - 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); } @@ -5997,8 +5988,11 @@ focus_magic(struct ws_win *win) { DNPRINTF(SWM_D_FOCUS, "focus_magic: window: 0x%lx\n", WINID(win)); - if (win == NULL) + if (win == NULL) { + /* if there are no windows clear the status-bar */ + bar_check_opts(); return; + } if (win->child_trans) { /* win = parent & has a transient so focus on that */ @@ -6007,7 +6001,7 @@ focus_magic(struct ws_win *win) if (win->child_trans->take_focus) client_msg(win, takefocus); } else { - /* make sure transient hasn't dissapeared */ + /* make sure transient hasn't disappeared */ if (validate_win(win->child_trans) == 0) { focus_win(win->child_trans); if (win->child_trans->take_focus)