mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
Consolidate region 'view' and 'area'.
This commit is contained in:
parent
e6bf7429b3
commit
13763662c9
1
calmwm.h
1
calmwm.h
@ -204,7 +204,6 @@ TAILQ_HEAD(autogroup_q, autogroup);
|
|||||||
struct region_ctx {
|
struct region_ctx {
|
||||||
TAILQ_ENTRY(region_ctx) entry;
|
TAILQ_ENTRY(region_ctx) entry;
|
||||||
int num;
|
int num;
|
||||||
struct geom area;
|
|
||||||
struct geom view; /* viewable area */
|
struct geom view; /* viewable area */
|
||||||
struct geom work; /* workable area, gap-applied */
|
struct geom work; /* workable area, gap-applied */
|
||||||
};
|
};
|
||||||
|
12
screen.c
12
screen.c
@ -146,12 +146,12 @@ struct geom
|
|||||||
screen_area(struct screen_ctx *sc, int x, int y, enum apply_gap apply_gap)
|
screen_area(struct screen_ctx *sc, int x, int y, enum apply_gap apply_gap)
|
||||||
{
|
{
|
||||||
struct region_ctx *rc;
|
struct region_ctx *rc;
|
||||||
struct geom area = sc->work;
|
struct geom area = sc->view;
|
||||||
|
|
||||||
TAILQ_FOREACH(rc, &sc->regionq, entry) {
|
TAILQ_FOREACH(rc, &sc->regionq, entry) {
|
||||||
if ((x >= rc->area.x) && (x < (rc->area.x + rc->area.w)) &&
|
if ((x >= rc->view.x) && (x < (rc->view.x + rc->view.w)) &&
|
||||||
(y >= rc->area.y) && (y < (rc->area.y + rc->area.h))) {
|
(y >= rc->view.y) && (y < (rc->view.y + rc->view.h))) {
|
||||||
area = rc->area;
|
area = rc->view;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -193,10 +193,6 @@ screen_update_geometry(struct screen_ctx *sc)
|
|||||||
|
|
||||||
rc = xmalloc(sizeof(*rc));
|
rc = xmalloc(sizeof(*rc));
|
||||||
rc->num = i;
|
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.x = ci->x;
|
||||||
rc->view.y = ci->y;
|
rc->view.y = ci->y;
|
||||||
rc->view.w = ci->width;
|
rc->view.w = ci->width;
|
||||||
|
Loading…
Reference in New Issue
Block a user