diff options
author | okan <okan> | 2013-12-13 22:39:13 +0000 |
---|---|---|
committer | okan <okan> | 2013-12-13 22:39:13 +0000 |
commit | f98f4615c0bf2fbf3f6229ccb9cb46284f3dd18a (patch) | |
tree | 27fe01cb5d60eab42a16cca67c4444829577556b /screen.c | |
parent | 5732b65139493570e331fbc298eb6920f0878e5f (diff) | |
download | cwm-f98f4615c0bf2fbf3f6229ccb9cb46284f3dd18a.tar.gz cwm-f98f4615c0bf2fbf3f6229ccb9cb46284f3dd18a.tar.xz cwm-f98f4615c0bf2fbf3f6229ccb9cb46284f3dd18a.zip |
Teach screen_find_xinerama() to apply gap only when told to do so;
adjust callers. Needed for an upcoming feature.
Diffstat (limited to 'screen.c')
-rw-r--r-- | screen.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/screen.c b/screen.c index f6f4bcd..757232e 100644 --- a/screen.c +++ b/screen.c @@ -126,7 +126,7 @@ screen_updatestackingorder(struct screen_ctx *sc) * Find which xinerama screen the coordinates (x,y) is on. */ struct geom -screen_find_xinerama(struct screen_ctx *sc, int x, int y) +screen_find_xinerama(struct screen_ctx *sc, int x, int y, int flags) { XineramaScreenInfo *info; struct geom geom; @@ -141,13 +141,19 @@ screen_find_xinerama(struct screen_ctx *sc, int x, int y) info = &sc->xinerama[i]; if (x >= info->x_org && x < info->x_org + info->width && y >= info->y_org && y < info->y_org + info->height) { - geom.x = info->x_org + sc->gap.left; - geom.y = info->y_org + sc->gap.top; - geom.w = info->width - (sc->gap.left + sc->gap.right); - geom.h = info->height - (sc->gap.top + sc->gap.bottom); + geom.x = info->x_org; + geom.y = info->y_org; + geom.w = info->width; + geom.h = info->height; break; } } + if (flags & CWM_GAP) { + geom.x += sc->gap.left; + geom.y += sc->gap.top; + geom.w -= (sc->gap.left + sc->gap.right); + geom.h -= (sc->gap.top + sc->gap.bottom); + } return (geom); } |