summaryrefslogtreecommitdiffstats
path: root/commands.c
diff options
context:
space:
mode:
authorBert Münnich <ber.t@gmx.com>2013-03-04 19:23:07 +0100
committerBert Münnich <ber.t@gmx.com>2013-03-04 19:23:07 +0100
commit9ee34477f81dc9630e902e8059e56fa665ad007b (patch)
tree41e23b8dfc5144dc4b6e09979ddbc3d69e7c9e84 /commands.c
parentce8460108aafc98aa932832e7353271f4dab8c0c (diff)
downloadnsxiv-9ee34477f81dc9630e902e8059e56fa665ad007b.tar.zst
Applied code style on merged changes
Diffstat (limited to 'commands.c')
-rw-r--r--commands.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/commands.c b/commands.c
index 7ec7b88..f358ed3 100644
--- a/commands.c
+++ b/commands.c
@@ -262,6 +262,11 @@ Bool is_motionnotify(Display *d, XEvent *e, XPointer a)
return e != NULL && e->type == MotionNotify;
}
+#define WARP(x,y) \
+ XWarpPointer(win.env.dpy, None, win.xwin, 0, 0, 0, 0, x, y); \
+ ox = x, oy = y; \
+ break
+
bool i_drag(arg_t a)
{
int dx = 0, dy = 0, i, ox, oy, x, y;
@@ -290,28 +295,18 @@ bool i_drag(arg_t a)
x = e.xmotion.x;
y = e.xmotion.y;
-#define WARP(x, y) \
- XWarpPointer(win.env.dpy, \
- None, win.xwin, \
- 0, 0, 0, 0, \
- x, y); \
- ox = x, oy = y; \
- break
-
/* wrap the mouse around */
- if(x < 0){
+ if (x < 0) {
WARP(win.w, y);
- }else if(x > win.w){
+ } else if (x > win.w) {
WARP(0, y);
- }else if(y < 0){
+ } else if (y < 0) {
WARP(x, win.h);
- }else if(y > win.h){
+ } else if (y > win.h) {
WARP(x, 0);
}
-
dx += x - ox;
dy += y - oy;
-
ox = x;
oy = y;
break;