From ae43e426a939ea1076e32fd6be0f0a3e48dbc5f1 Mon Sep 17 00:00:00 2001 From: Patrick Date: Thu, 15 Oct 2015 16:30:15 +0800 Subject: use more c99 --- x-move-resize.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'x-move-resize.c') diff --git a/x-move-resize.c b/x-move-resize.c index 45bbf9a..67f8213 100644 --- a/x-move-resize.c +++ b/x-move-resize.c @@ -27,7 +27,7 @@ If not, see http://creativecommons.org/publicdomain/zero/1.0/ */ Cursor cursor; XWindowAttributes attr; -XButtonEvent start; +XButtonEvent start = { .button = 0, .x_root = 0, .y_root = 0 }; extern void exit(int code); // fun on down @@ -100,17 +100,14 @@ int main() { [ButtonRelease] = buttonrelease, [MotionNotify] = motionnotify, }; - int cursor_shape = XC_plus; - start.button = 0; - start.x_root = 0; - start.y_root = 0; if(!(dpy = XOpenDisplay(0x0))) return 1; root = DefaultRootWindow(dpy); - cursor = XCreateFontCursor(dpy, cursor_shape); if (XGrabPointer (dpy, root, False, (ButtonPressMask), - GrabModeAsync, GrabModeAsync, None, cursor, CurrentTime) != GrabSuccess) + GrabModeAsync, GrabModeAsync, None, + XCreateFontCursor(dpy, XC_plus), + CurrentTime) != GrabSuccess) die(dpy, 1); for(;;) { -- cgit v1.2.3