X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=scrotwm.c;h=b0793f32c9d6241bb466a55603169e5f063dd18f;hb=7230e8cbf224cd6993a9f714acda44ada29eb2bc;hp=d8e5d0517b3f8276b65471793c869c3a00a1edd8;hpb=5861c15d647d027da81fd5af417d26a21d8ad011;p=spectrwm.git diff --git a/scrotwm.c b/scrotwm.c index d8e5d05..b0793f3 100644 --- a/scrotwm.c +++ b/scrotwm.c @@ -1657,11 +1657,10 @@ focus(struct swm_region *r, union arg *args) return; } - cur_focus = r->ws->focus; - if (cur_focus == NULL) { + if (r->ws->focus == NULL) return; - } + cur_focus = r->ws->focus; ws = r->ws; wl = &ws->winlist; @@ -1695,22 +1694,12 @@ focus(struct swm_region *r, union arg *args) } break; case SWM_ARG_ID_FOCUSNEXT: - cur_focus = r->ws->focus; - if (cur_focus == NULL) - return; - wl = &cur_focus->ws->winlist; - winfocus = TAILQ_NEXT(cur_focus, entry); if (winfocus == NULL) winfocus = TAILQ_FIRST(wl); break; case SWM_ARG_ID_FOCUSMAIN: - cur_focus = r->ws->focus; - if (cur_focus == NULL) - return; - wl = &cur_focus->ws->winlist; - winfocus = TAILQ_FIRST(wl); if (winfocus == cur_focus) winfocus = cur_focus->ws->focus_prev;