diff options
| author | Patrick <devnull@mailinator.com> | 2015-10-15 16:30:15 +0800 |
|---|---|---|
| committer | Patrick <devnull@mailinator.com> | 2015-10-15 16:30:15 +0800 |
| commit | ae43e426a939ea1076e32fd6be0f0a3e48dbc5f1 (patch) | |
| tree | ca4d7f1ac788fb99fe0160de40bdb0bc55352934 | |
| parent | 00195baff8d1c3bea711a37852d26fc04edf0b2d (diff) | |
use more c99
| -rw-r--r-- | x-move-resize.c | 11 |
1 files changed, 4 insertions, 7 deletions
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(;;) { |
