diff options
author | okan | 2015-06-26 17:17:46 +0000 |
---|---|---|
committer | okan | 2015-06-26 17:17:46 +0000 |
commit | 0a8714c24e91e851245d33469341663bf594ab95 (patch) | |
tree | 98a43650f7748eefff2eee204a5a1188576bcaff /client.c | |
parent | 8ee45f99bd44dcf347cc84ebb8afdddda5b28997 (diff) | |
download | cwm-0a8714c24e91e851245d33469341663bf594ab95.tar.gz |
Mechanical change from xinerama to region backed areas.
Diffstat (limited to 'client.c')
-rw-r--r-- | client.c | 116 |
1 files changed, 58 insertions, 58 deletions
@@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: client.c,v 1.193 2015/06/08 15:11:29 okan Exp $ + * $OpenBSD: client.c,v 1.194 2015/06/26 17:17:46 okan Exp $ */ #include <sys/types.h> @@ -265,7 +265,7 @@ void client_toggle_fullscreen(struct client_ctx *cc) { struct screen_ctx *sc = cc->sc; - struct geom xine; + struct geom area; if ((cc->flags & CLIENT_FREEZE) && !(cc->flags & CLIENT_FULLSCREEN)) @@ -280,12 +280,12 @@ client_toggle_fullscreen(struct client_ctx *cc) cc->fullgeom = cc->geom; - xine = screen_find_xinerama(sc, + area = screen_area(sc, cc->geom.x + cc->geom.w / 2, cc->geom.y + cc->geom.h / 2, CWM_NOGAP); cc->bwidth = 0; - cc->geom = xine; + cc->geom = area; cc->flags |= (CLIENT_FULLSCREEN | CLIENT_FREEZE); resize: @@ -297,7 +297,7 @@ void client_toggle_maximize(struct client_ctx *cc) { struct screen_ctx *sc = cc->sc; - struct geom xine; + struct geom area; if (cc->flags & (CLIENT_FREEZE|CLIENT_STICKY)) return; @@ -323,14 +323,14 @@ client_toggle_maximize(struct client_ctx *cc) * that's probably more fair than if just the origin of * a window is poking over a boundary */ - xine = screen_find_xinerama(sc, + area = screen_area(sc, cc->geom.x + cc->geom.w / 2, cc->geom.y + cc->geom.h / 2, CWM_GAP); - cc->geom.x = xine.x; - cc->geom.y = xine.y; - cc->geom.w = xine.w - (cc->bwidth * 2); - cc->geom.h = xine.h - (cc->bwidth * 2); + cc->geom.x = area.x; + cc->geom.y = area.y; + cc->geom.w = area.w - (cc->bwidth * 2); + cc->geom.h = area.h - (cc->bwidth * 2); cc->flags |= CLIENT_MAXIMIZED; resize: @@ -342,7 +342,7 @@ void client_toggle_vmaximize(struct client_ctx *cc) { struct screen_ctx *sc = cc->sc; - struct geom xine; + struct geom area; if (cc->flags & (CLIENT_FREEZE|CLIENT_STICKY)) return; @@ -357,12 +357,12 @@ client_toggle_vmaximize(struct client_ctx *cc) cc->savegeom.y = cc->geom.y; cc->savegeom.h = cc->geom.h; - xine = screen_find_xinerama(sc, + area = screen_area(sc, cc->geom.x + cc->geom.w / 2, cc->geom.y + cc->geom.h / 2, CWM_GAP); - cc->geom.y = xine.y; - cc->geom.h = xine.h - (cc->bwidth * 2); + cc->geom.y = area.y; + cc->geom.h = area.h - (cc->bwidth * 2); cc->flags |= CLIENT_VMAXIMIZED; resize: @@ -374,7 +374,7 @@ void client_toggle_hmaximize(struct client_ctx *cc) { struct screen_ctx *sc = cc->sc; - struct geom xine; + struct geom area; if (cc->flags & (CLIENT_FREEZE|CLIENT_STICKY)) return; @@ -389,12 +389,12 @@ client_toggle_hmaximize(struct client_ctx *cc) cc->savegeom.x = cc->geom.x; cc->savegeom.w = cc->geom.w; - xine = screen_find_xinerama(sc, + area = screen_area(sc, cc->geom.x + cc->geom.w / 2, cc->geom.y + cc->geom.h / 2, CWM_GAP); - cc->geom.x = xine.x; - cc->geom.w = xine.w - (cc->bwidth * 2); + cc->geom.x = area.x; + cc->geom.w = area.w - (cc->bwidth * 2); cc->flags |= CLIENT_HMAXIMIZED; resize: @@ -740,33 +740,33 @@ client_placecalc(struct client_ctx *cc) cc->geom.x = MIN(cc->geom.x, xslack); cc->geom.y = MIN(cc->geom.y, yslack); } else { - struct geom xine; + struct geom area; int xmouse, ymouse; xu_ptr_getpos(sc->rootwin, &xmouse, &ymouse); - xine = screen_find_xinerama(sc, xmouse, ymouse, CWM_GAP); - xine.w += xine.x; - xine.h += xine.y; - xmouse = MAX(xmouse, xine.x) - cc->geom.w / 2; - ymouse = MAX(ymouse, xine.y) - cc->geom.h / 2; + area = screen_area(sc, xmouse, ymouse, CWM_GAP); + area.w += area.x; + area.h += area.y; + xmouse = MAX(xmouse, area.x) - cc->geom.w / 2; + ymouse = MAX(ymouse, area.y) - cc->geom.h / 2; - xmouse = MAX(xmouse, xine.x); - ymouse = MAX(ymouse, xine.y); + xmouse = MAX(xmouse, area.x); + ymouse = MAX(ymouse, area.y); - xslack = xine.w - cc->geom.w - cc->bwidth * 2; - yslack = xine.h - cc->geom.h - cc->bwidth * 2; + xslack = area.w - cc->geom.w - cc->bwidth * 2; + yslack = area.h - cc->geom.h - cc->bwidth * 2; - if (xslack >= xine.x) { - cc->geom.x = MAX(MIN(xmouse, xslack), xine.x); + if (xslack >= area.x) { + cc->geom.x = MAX(MIN(xmouse, xslack), area.x); } else { - cc->geom.x = xine.x; - cc->geom.w = xine.w; + cc->geom.x = area.x; + cc->geom.w = area.w; } - if (yslack >= xine.y) { - cc->geom.y = MAX(MIN(ymouse, yslack), xine.y); + if (yslack >= area.y) { + cc->geom.y = MAX(MIN(ymouse, yslack), area.y); } else { - cc->geom.y = xine.y; - cc->geom.h = xine.h; + cc->geom.y = area.y; + cc->geom.h = area.h; } } } @@ -949,7 +949,7 @@ client_htile(struct client_ctx *cc) struct client_ctx *ci; struct group_ctx *gc = cc->group; struct screen_ctx *sc = cc->sc; - struct geom xine; + struct geom area; int i, n, mh, x, h, w; if (!gc) @@ -965,36 +965,36 @@ client_htile(struct client_ctx *cc) if (n == 0) return; - xine = screen_find_xinerama(sc, + area = screen_area(sc, cc->geom.x + cc->geom.w / 2, cc->geom.y + cc->geom.h / 2, CWM_GAP); if (cc->flags & CLIENT_VMAXIMIZED || - cc->geom.h + (cc->bwidth * 2) >= xine.h) + cc->geom.h + (cc->bwidth * 2) >= area.h) return; cc->flags &= ~CLIENT_HMAXIMIZED; - cc->geom.x = xine.x; - cc->geom.y = xine.y; - cc->geom.w = xine.w - (cc->bwidth * 2); + cc->geom.x = area.x; + cc->geom.y = area.y; + cc->geom.w = area.w - (cc->bwidth * 2); client_resize(cc, 1); client_ptrwarp(cc); mh = cc->geom.h + (cc->bwidth * 2); - x = xine.x; - w = xine.w / n; - h = xine.h - mh; + x = area.x; + w = area.w / n; + h = area.h - mh; TAILQ_FOREACH(ci, &gc->clientq, group_entry) { if (ci->flags & CLIENT_HIDDEN || ci->flags & CLIENT_IGNORE || (ci == cc)) continue; ci->bwidth = Conf.bwidth; - ci->geom.y = xine.y + mh; + ci->geom.y = area.y + mh; ci->geom.x = x; ci->geom.h = h - (ci->bwidth * 2); ci->geom.w = w - (ci->bwidth * 2); if (i + 1 == n) - ci->geom.w = xine.x + xine.w - + ci->geom.w = area.x + area.w - ci->geom.x - (ci->bwidth * 2); x += w; client_resize(ci, 1); @@ -1008,7 +1008,7 @@ client_vtile(struct client_ctx *cc) struct client_ctx *ci; struct group_ctx *gc = cc->group; struct screen_ctx *sc = cc->sc; - struct geom xine; + struct geom area; int i, n, mw, y, h, w; if (!gc) @@ -1024,36 +1024,36 @@ client_vtile(struct client_ctx *cc) if (n == 0) return; - xine = screen_find_xinerama(sc, + area = screen_area(sc, cc->geom.x + cc->geom.w / 2, cc->geom.y + cc->geom.h / 2, CWM_GAP); if (cc->flags & CLIENT_HMAXIMIZED || - cc->geom.w + (cc->bwidth * 2) >= xine.w) + cc->geom.w + (cc->bwidth * 2) >= area.w) return; cc->flags &= ~CLIENT_VMAXIMIZED; - cc->geom.x = xine.x; - cc->geom.y = xine.y; - cc->geom.h = xine.h - (cc->bwidth * 2); + cc->geom.x = area.x; + cc->geom.y = area.y; + cc->geom.h = area.h - (cc->bwidth * 2); client_resize(cc, 1); client_ptrwarp(cc); mw = cc->geom.w + (cc->bwidth * 2); - y = xine.y; - h = xine.h / n; - w = xine.w - mw; + y = area.y; + h = area.h / n; + w = area.w - mw; TAILQ_FOREACH(ci, &gc->clientq, group_entry) { if (ci->flags & CLIENT_HIDDEN || ci->flags & CLIENT_IGNORE || (ci == cc)) continue; ci->bwidth = Conf.bwidth; ci->geom.y = y; - ci->geom.x = xine.x + mw; + ci->geom.x = area.x + mw; ci->geom.h = h - (ci->bwidth * 2); ci->geom.w = w - (ci->bwidth * 2); if (i + 1 == n) - ci->geom.h = xine.y + xine.h - + ci->geom.h = area.y + area.h - ci->geom.y - (ci->bwidth * 2); y += h; client_resize(ci, 1); |