From 9f5e85d94d6df40bfb13c44d3faeee8fa6e34d0d Mon Sep 17 00:00:00 2001 From: Marco Peereboom Date: Wed, 7 Jul 2010 15:40:29 +0000 Subject: [PATCH] Move outputs++ to new_region. Makes more sense and it make shit like NVIDIA work. Add some () around ?: for correctnes sake. From the arch linux community --- scrotwm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scrotwm.c b/scrotwm.c index d04ecca..50387a1 100644 --- a/scrotwm.c +++ b/scrotwm.c @@ -1605,7 +1605,7 @@ cyclescr(struct swm_region *r, union arg *args) /* move mouse to region */ x = rr->g.x + 1; - y = rr->g.y + 1 + bar_enabled ? bar_height : 0; + y = rr->g.y + 1 + (bar_enabled ? bar_height : 0); XWarpPointer(display, None, rr->s[i].root, 0, 0, 0, 0, x, y); a.id = SWM_ARG_ID_FOCUSCUR; @@ -4579,6 +4579,7 @@ new_region(struct swm_screen *s, int x, int y, int w, int h) r->ws = ws; r->ws_prior = NULL; ws->r = r; + outputs++; TAILQ_INSERT_TAIL(&s->rl, r, entry); } @@ -4604,10 +4605,10 @@ scan_xrandr(int i) TAILQ_REMOVE(&screens[i].rl, r, entry); TAILQ_INSERT_TAIL(&screens[i].orl, r, entry); } + outputs = 0; /* map virtual screens onto physical screens */ #ifdef SWM_XRR_HAS_CRTC - outputs = 0; if (xrandr_support) { sr = XRRGetScreenResources(display, screens[i].root); if (sr == NULL) @@ -4621,7 +4622,6 @@ scan_xrandr(int i) ci = XRRGetCrtcInfo(display, sr, sr->crtcs[c]); if (ci->noutput == 0) continue; - outputs++; if (ci != NULL && ci->mode == None) new_region(&screens[i], 0, 0, @@ -4938,7 +4938,7 @@ main(int argc, char *argv[]) if (ScreenCount(display) > 1 || outputs > 1) XWarpPointer(display, None, rr->s[0].root, 0, 0, 0, 0, rr->g.x, - rr->g.y + bar_enabled ? bar_height : 0); + rr->g.y + (bar_enabled ? bar_height : 0)); a.id = SWM_ARG_ID_FOCUSCUR; focus(rr, &a); -- 2.39.2