From: Ryan McBride Date: Wed, 14 Jan 2009 06:04:21 +0000 (+0000) Subject: Don't swap_to_main if no window has focus or main has focus. X-Git-Url: https://jasonwoof.com/gitweb/?a=commitdiff_plain;h=ef5a4d70c75a403677a33caeade5b34a96cae687;p=spectrwm.git Don't swap_to_main if no window has focus or main has focus. --- diff --git a/scrotwm.c b/scrotwm.c index 87cb946..d8b6519 100644 --- a/scrotwm.c +++ b/scrotwm.c @@ -371,7 +371,10 @@ swap_to_main(union arg *args) struct ws_win *tmpwin = TAILQ_FIRST(&ws[current_ws].winlist); DNPRINTF(SWM_D_MISC, "swap_to_main: win: %lu\n", - ws[current_ws].focus->id); + ws[current_ws].focus ? ws[current_ws].focus->id : 0); + + if (ws[current_ws].focus == NULL || ws[current_ws].focus == tmpwin) + return; TAILQ_REMOVE(&ws[current_ws].winlist, tmpwin, entry); TAILQ_INSERT_AFTER(&ws[current_ws].winlist, ws[current_ws].focus,