aboutsummaryrefslogtreecommitdiffstats
path: root/screen.c
diff options
context:
space:
mode:
authorokan2013-01-08 04:12:51 +0000
committerokan2013-01-08 04:12:51 +0000
commitbd448cd97c1d6ac4577fa4831105f3d54fab673b (patch)
tree61f8f353e5171fe196b38740dc4bd70e791f1b93 /screen.c
parent4e7878b6c81f71a76583a323008e0e5809ff4b56 (diff)
downloadcwm-bd448cd97c1d6ac4577fa4831105f3d54fab673b.tar.gz
teach screen_find_xinerama() about gap and adjust (simplify) callers;
menu becomes gap-aware for free.
Diffstat (limited to 'screen.c')
-rw-r--r--screen.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/screen.c b/screen.c
index 02fa342..e7ed769 100644
--- a/screen.c
+++ b/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.44 2013/01/07 21:45:24 okan Exp $
+ * $OpenBSD: screen.c,v 1.45 2013/01/08 04:12:51 okan Exp $
*/
#include <sys/param.h>
@@ -132,7 +132,7 @@ screen_find_xinerama(struct screen_ctx *sc, int x, int y)
struct geom geom;
int i;
- geom = sc->view;
+ geom = sc->work;
if (sc->xinerama == NULL)
return (geom);
@@ -141,10 +141,10 @@ 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;
- geom.y = info->y_org;
- geom.w = info->width;
- geom.h = 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);
break;
}
}