Krolyxon
Commit 9ee3447

Branches

Refs →

nsxiv9ee3447

Applied code style on merged changes

Author
Bert Münnich
Date
2013-03-04 19:23 +0100
Parent
ce84601
Commit
9ee34477f81dc9630e902e8059e56fa665ad007b

+10 −15

2 files changed

  1. M Makefile +1 −1
  2. M commands.c +9 −14
M Makefile View
@@ -1,4 +1,4 @@
1−VERSION = git-20130211
1+VERSION = git-20130304
22
33 PREFIX = /usr/local
44 MANPREFIX = $(PREFIX)/share/man
M commands.c View
@@ -262,6 +262,11 @@ Bool is_motionnotify(Display *d, XEvent *e, XPointer a)
262262 return e != NULL && e->type == MotionNotify;
263263 }
264264
265+#define WARP(x,y) \
266+ XWarpPointer(win.env.dpy, None, win.xwin, 0, 0, 0, 0, x, y); \
267+ ox = x, oy = y; \
268+ break
269+
265270 bool i_drag(arg_t a)
266271 {
267272 int dx = 0, dy = 0, i, ox, oy, x, y;
@@ -290,28 +295,18 @@ bool i_drag(arg_t a)
290295 x = e.xmotion.x;
291296 y = e.xmotion.y;
292297
293−#define WARP(x, y) \
294− XWarpPointer(win.env.dpy, \
295− None, win.xwin, \
296− 0, 0, 0, 0, \
297− x, y); \
298− ox = x, oy = y; \
299− break
300−
301298 /* wrap the mouse around */
302− if(x < 0){
299+ if (x < 0) {
303300 WARP(win.w, y);
304− }else if(x > win.w){
301+ } else if (x > win.w) {
305302 WARP(0, y);
306− }else if(y < 0){
303+ } else if (y < 0) {
307304 WARP(x, win.h);
308− }else if(y > win.h){
305+ } else if (y > win.h) {
309306 WARP(x, 0);
310307 }
311−
312308 dx += x - ox;
313309 dy += y - oy;
314−
315310 ox = x;
316311 oy = y;
317312 break;