diff options
author | Okan Demirmen <okan@cvs.openbsd.org> | 2012-07-13 15:21:36 +0000 |
---|---|---|
committer | Okan Demirmen <okan@cvs.openbsd.org> | 2012-07-13 15:21:36 +0000 |
commit | 276cee98df6b1a108b06ce08b70474c5ce731897 (patch) | |
tree | a48335568c740c002fdf50dcf7bf14dabee53f6d | |
parent | faeb5961fdec501bae4e3401d9890e58b3fbbf25 (diff) |
convert xmax/ymax uses to view geometry.
-rw-r--r-- | app/cwm/calmwm.h | 4 | ||||
-rw-r--r-- | app/cwm/client.c | 16 | ||||
-rw-r--r-- | app/cwm/kbfunc.c | 14 | ||||
-rw-r--r-- | app/cwm/menu.c | 6 | ||||
-rw-r--r-- | app/cwm/mousefunc.c | 6 | ||||
-rw-r--r-- | app/cwm/screen.c | 5 | ||||
-rw-r--r-- | app/cwm/xevents.c | 6 | ||||
-rw-r--r-- | app/cwm/xutil.c | 12 |
8 files changed, 32 insertions, 37 deletions
diff --git a/app/cwm/calmwm.h b/app/cwm/calmwm.h index 1bc20d222..efbbf3b6f 100644 --- a/app/cwm/calmwm.h +++ b/app/cwm/calmwm.h @@ -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: calmwm.h,v 1.150 2012/07/13 14:18:04 okan Exp $ + * $OpenBSD: calmwm.h,v 1.151 2012/07/13 15:21:35 okan Exp $ */ #ifndef _CALMWM_H_ @@ -211,8 +211,6 @@ struct screen_ctx { struct color color[CWM_COLOR_MAX]; GC gc; int cycling; - int xmax; - int ymax; struct geom view; /* viewable area */ struct geom work; /* workable area, gap-applied */ struct gap gap; diff --git a/app/cwm/client.c b/app/cwm/client.c index 1aa46fe9b..fbc1ee4ce 100644 --- a/app/cwm/client.c +++ b/app/cwm/client.c @@ -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.96 2012/07/04 18:00:13 okan Exp $ + * $OpenBSD: client.c,v 1.97 2012/07/13 15:21:35 okan Exp $ */ #include <sys/param.h> @@ -256,7 +256,7 @@ void client_maximize(struct client_ctx *cc) { struct screen_ctx *sc = cc->sc; - int xmax = sc->xmax, ymax = sc->ymax; + int xmax = sc->view.w, ymax = sc->view.h; int x_org = 0, y_org = 0; if (cc->flags & CLIENT_FREEZE) @@ -312,7 +312,7 @@ void client_vertmaximize(struct client_ctx *cc) { struct screen_ctx *sc = cc->sc; - int y_org = 0, ymax = sc->ymax; + int y_org = 0, ymax = sc->view.h; if (cc->flags & CLIENT_FREEZE) return; @@ -360,7 +360,7 @@ void client_horizmaximize(struct client_ctx *cc) { struct screen_ctx *sc = cc->sc; - int x_org = 0, xmax = sc->xmax; + int x_org = 0, xmax = sc->view.w; if (cc->flags & CLIENT_FREEZE) return; @@ -670,8 +670,8 @@ client_placecalc(struct client_ctx *cc) * XRandR bits mean that {x,y}max shouldn't be outside what's * currently there. */ - xslack = sc->xmax - cc->geom.width - cc->bwidth * 2; - yslack = sc->ymax - cc->geom.height - cc->bwidth * 2; + xslack = sc->view.w - cc->geom.width - cc->bwidth * 2; + yslack = sc->view.h - cc->geom.height - cc->bwidth * 2; if (cc->size->x > 0) cc->geom.x = MIN(cc->size->x, xslack); if (cc->size->y > 0) @@ -693,8 +693,8 @@ client_placecalc(struct client_ctx *cc) } else { noxine: xorig = yorig = 0; - xmax = sc->xmax; - ymax = sc->ymax; + xmax = sc->view.w; + ymax = sc->view.h; } xmouse = MAX(xmouse, xorig) - cc->geom.width / 2; ymouse = MAX(ymouse, yorig) - cc->geom.height / 2; diff --git a/app/cwm/kbfunc.c b/app/cwm/kbfunc.c index a201bc26a..67179a4c3 100644 --- a/app/cwm/kbfunc.c +++ b/app/cwm/kbfunc.c @@ -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: kbfunc.c,v 1.60 2012/07/04 23:42:03 okan Exp $ + * $OpenBSD: kbfunc.c,v 1.61 2012/07/13 15:21:35 okan Exp $ */ #include <sys/param.h> @@ -90,20 +90,20 @@ kbfunc_moveresize(struct client_ctx *cc, union arg *arg) cc->geom.y += my; if (cc->geom.y + cc->geom.height < 0) cc->geom.y = -cc->geom.height; - if (cc->geom.y > sc->ymax - 1) - cc->geom.y = sc->ymax - 1; + if (cc->geom.y > sc->view.h - 1) + cc->geom.y = sc->view.h - 1; cc->geom.x += mx; if (cc->geom.x + cc->geom.width < 0) cc->geom.x = -cc->geom.width; - if (cc->geom.x > sc->xmax - 1) - cc->geom.x = sc->xmax - 1; + if (cc->geom.x > sc->view.w - 1) + cc->geom.x = sc->view.w - 1; cc->geom.x += client_snapcalc(cc->geom.x, - cc->geom.width, sc->xmax, + cc->geom.width, sc->view.w, cc->bwidth, Conf.snapdist); cc->geom.y += client_snapcalc(cc->geom.y, - cc->geom.height, sc->ymax, + cc->geom.height, sc->view.h, cc->bwidth, Conf.snapdist); client_move(cc); diff --git a/app/cwm/menu.c b/app/cwm/menu.c index 5fc2888a9..7452c420b 100644 --- a/app/cwm/menu.c +++ b/app/cwm/menu.c @@ -16,7 +16,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: menu.c,v 1.34 2012/05/16 01:04:36 okan Exp $ + * $OpenBSD: menu.c,v 1.35 2012/07/13 15:21:35 okan Exp $ */ #include <sys/param.h> @@ -349,8 +349,8 @@ menu_draw(struct screen_ctx *sc, struct menu_ctx *mc, struct menu_q *menuq, ymax = xine->y_org + xine->height; } else { xmin = ymin = 0; - xmax = sc->xmax; - ymax = sc->ymax; + xmax = sc->view.w; + ymax = sc->view.h; } xsave = mc->x; diff --git a/app/cwm/mousefunc.c b/app/cwm/mousefunc.c index b84e1895c..136161778 100644 --- a/app/cwm/mousefunc.c +++ b/app/cwm/mousefunc.c @@ -16,7 +16,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: mousefunc.c,v 1.35 2012/07/04 23:42:03 okan Exp $ + * $OpenBSD: mousefunc.c,v 1.36 2012/07/13 15:21:35 okan Exp $ */ #include <sys/param.h> @@ -162,10 +162,10 @@ mousefunc_window_move(struct client_ctx *cc, void *arg) cc->geom.y = ev.xmotion.y_root - py - cc->bwidth; cc->geom.x += client_snapcalc(cc->geom.x, - cc->geom.width, sc->xmax, + cc->geom.width, sc->view.w, cc->bwidth, Conf.snapdist); cc->geom.y += client_snapcalc(cc->geom.y, - cc->geom.height, sc->ymax, + cc->geom.height, sc->view.h, cc->bwidth, Conf.snapdist); /* don't move more than 60 times / second */ diff --git a/app/cwm/screen.c b/app/cwm/screen.c index 28778b12b..6a078b24a 100644 --- a/app/cwm/screen.c +++ b/app/cwm/screen.c @@ -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: screen.c,v 1.32 2012/07/13 14:18:04 okan Exp $ + * $OpenBSD: screen.c,v 1.33 2012/07/13 15:21:35 okan Exp $ */ #include <sys/param.h> @@ -117,9 +117,6 @@ screen_find_xinerama(struct screen_ctx *sc, int x, int y) void screen_update_geometry(struct screen_ctx *sc) { - sc->xmax = DisplayWidth(X_Dpy, sc->which); - sc->ymax = DisplayHeight(X_Dpy, sc->which); - sc->view.x = 0; sc->view.y = 0; sc->view.w = DisplayWidth(X_Dpy, sc->which); diff --git a/app/cwm/xevents.c b/app/cwm/xevents.c index 9480c7de6..2a7c5e106 100644 --- a/app/cwm/xevents.c +++ b/app/cwm/xevents.c @@ -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: xevents.c,v 1.63 2012/07/06 14:18:00 okan Exp $ + * $OpenBSD: xevents.c,v 1.64 2012/07/13 15:21:35 okan Exp $ */ /* @@ -151,10 +151,10 @@ xev_handle_configurerequest(XEvent *ee) if (e->value_mask & CWBorderWidth) wc.border_width = e->border_width; - if (cc->geom.x == 0 && cc->geom.width >= sc->xmax) + if (cc->geom.x == 0 && cc->geom.width >= sc->view.w) cc->geom.x -= cc->bwidth; - if (cc->geom.y == 0 && cc->geom.height >= sc->ymax) + if (cc->geom.y == 0 && cc->geom.height >= sc->view.h) cc->geom.y -= cc->bwidth; wc.x = cc->geom.x; diff --git a/app/cwm/xutil.c b/app/cwm/xutil.c index c89b21540..15e648a6b 100644 --- a/app/cwm/xutil.c +++ b/app/cwm/xutil.c @@ -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: xutil.c,v 1.43 2012/07/08 02:55:01 okan Exp $ + * $OpenBSD: xutil.c,v 1.44 2012/07/13 15:21:35 okan Exp $ */ #include <sys/param.h> @@ -298,7 +298,7 @@ xu_ewmh_net_supported_wm_check(struct screen_ctx *sc) void xu_ewmh_net_desktop_geometry(struct screen_ctx *sc) { - long geom[2] = { sc->xmax, sc->ymax }; + long geom[2] = { sc->view.w, sc->view.h }; XChangeProperty(X_Dpy, sc->rootwin, ewmh[_NET_DESKTOP_GEOMETRY].atom, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)geom , 2); @@ -311,10 +311,10 @@ xu_ewmh_net_workarea(struct screen_ctx *sc) int i; for (i = 0; i < CALMWM_NGROUPS; i++) { - workareas[i][0] = sc->gap.left; - workareas[i][1] = sc->gap.top; - workareas[i][2] = sc->xmax - (sc->gap.left + sc->gap.right); - workareas[i][3] = sc->ymax - (sc->gap.top + sc->gap.bottom); + workareas[i][0] = sc->work.x; + workareas[i][1] = sc->work.y; + workareas[i][2] = sc->work.w; + workareas[i][3] = sc->work.h; } XChangeProperty(X_Dpy, sc->rootwin, ewmh[_NET_WORKAREA].atom, |