From 4943cc002d8c76a803b6147a2722f9ab74f16030 Mon Sep 17 00:00:00 2001 From: okan Date: Tue, 13 Feb 2018 15:06:22 +0000 Subject: [PATCH] Consolidate region 'view' and 'area'. --- app/cwm/calmwm.h | 3 +-- app/cwm/screen.c | 14 +++++--------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/app/cwm/calmwm.h b/app/cwm/calmwm.h index 393768a9a..8631232fb 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.358 2018/02/09 20:08:07 okan Exp $ + * $OpenBSD: calmwm.h,v 1.359 2018/02/13 15:06:22 okan Exp $ */ #ifndef _CALMWM_H_ @@ -204,7 +204,6 @@ TAILQ_HEAD(autogroup_q, autogroup); struct region_ctx { TAILQ_ENTRY(region_ctx) entry; int num; - struct geom area; struct geom view; /* viewable area */ struct geom work; /* workable area, gap-applied */ }; diff --git a/app/cwm/screen.c b/app/cwm/screen.c index 2cd3db985..4cde1dfd5 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.86 2018/02/09 20:08:07 okan Exp $ + * $OpenBSD: screen.c,v 1.87 2018/02/13 15:06:22 okan Exp $ */ #include @@ -146,12 +146,12 @@ struct geom screen_area(struct screen_ctx *sc, int x, int y, enum apply_gap apply_gap) { struct region_ctx *rc; - struct geom area = sc->work; + struct geom area = sc->view; TAILQ_FOREACH(rc, &sc->regionq, entry) { - if ((x >= rc->area.x) && (x < (rc->area.x + rc->area.w)) && - (y >= rc->area.y) && (y < (rc->area.y + rc->area.h))) { - area = rc->area; + if ((x >= rc->view.x) && (x < (rc->view.x + rc->view.w)) && + (y >= rc->view.y) && (y < (rc->view.y + rc->view.h))) { + area = rc->view; break; } } @@ -193,10 +193,6 @@ screen_update_geometry(struct screen_ctx *sc) rc = xmalloc(sizeof(*rc)); rc->num = i; - rc->area.x = ci->x; - rc->area.y = ci->y; - rc->area.w = ci->width; - rc->area.h = ci->height; rc->view.x = ci->x; rc->view.y = ci->y; rc->view.w = ci->width;