diff options
Diffstat (limited to 'multitouch.c')
-rw-r--r-- | multitouch.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/multitouch.c b/multitouch.c index dccb2be..f15cbeb 100644 --- a/multitouch.c +++ b/multitouch.c @@ -19,6 +19,9 @@ struct multitouch { Window root; Window win; int xi_opcode; + + int width; + int height; }; static int error(const char *fmt, ...) @@ -57,7 +60,7 @@ static Window init_window(struct multitouch *mt) XIEventMask evmask; unsigned char mask[XIMaskLen(XI_LASTEVENT)]; - win = XCreateSimpleWindow(mt->dpy, mt->root, 0, 0, 800, 600, + win = XCreateSimpleWindow(mt->dpy, mt->root, 0, 0, mt->width, mt->height, 0, 0, WhitePixel(mt->dpy, mt->screen)); XSelectInput(mt->dpy, win, ExposureMask); XMapWindow(mt->dpy, win); @@ -79,7 +82,7 @@ static Window init_window(struct multitouch *mt) return win; } -static int init_x11(struct multitouch *mt) +static int init_x11(struct multitouch *mt, int width, int height) { Display *dpy; int major = 2, minor = 2; @@ -100,6 +103,8 @@ static int init_x11(struct multitouch *mt) mt->screen = DefaultScreen(dpy); mt->root = DefaultRootWindow(dpy); mt->xi_opcode = xi_opcode; + mt->width = width; + mt->height = height; mt->win = init_window(mt); if (!mt->win) @@ -167,7 +172,7 @@ int main(int argc, char **argv) int rc; struct multitouch mt = { 0 }; - rc = init_x11(&mt); + rc = init_x11(&mt, 800, 600); if (rc != EXIT_SUCCESS) return rc; |