From cbdb48ff3e2ef19f12bd95ab4144c108c3a42524 Mon Sep 17 00:00:00 2001 From: Marco Peereboom Date: Thu, 1 Oct 2009 21:51:50 +0000 Subject: [PATCH] Do nothing when switching screens with keyboard when only on one screen. Make the dummykeyfunc and legacyfunc look a little less like c++ Remove hiding windows when chaning xrandr on the fly since stack deals with it and it ws causing issues with making windows dissapear. --- scrotwm.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/scrotwm.c b/scrotwm.c index d31cde5..e66aff4 100644 --- a/scrotwm.c +++ b/scrotwm.c @@ -1330,6 +1330,10 @@ cyclescr(struct swm_region *r, union arg *args) struct swm_region *rr; int i; + /* do nothing if we don't have more than one screen */ + if (!(ScreenCount(display) > 1 || outputs > 1)) + return; + i = r->s->idx; switch (args->id) { case SWM_ARG_ID_CYCLESC_UP: @@ -2141,8 +2145,15 @@ move(struct ws_win *win, union arg *args) } /* key definitions */ -void dummykeyfunc(struct swm_region *r, union arg *args) {}; -void legacyfunc(struct swm_region *r, union arg *args) {}; +void +dummykeyfunc(struct swm_region *r, union arg *args) +{ +}; + +void +legacyfunc(struct swm_region *r, union arg *args) +{ +}; struct keyfunc { char name[SWM_FUNCNAME_LEN]; @@ -3869,11 +3880,6 @@ screenchange(XEvent *e) { /* brute force for now, just re-enumerate the regions */ scan_xrandr(i); - /* hide any windows that went away */ - TAILQ_FOREACH(r, &screens[i].rl, entry) - TAILQ_FOREACH(win, &r->ws->winlist, entry) - unmap_window(win); - /* add bars to all regions */ for (i = 0; i < ScreenCount(display); i++) TAILQ_FOREACH(r, &screens[i].rl, entry) -- 1.7.10.4