comparison event.c @ 105:3e74cc981e9b

refactored Sanders code somewhat
author arg@10ksloc.org
date Wed, 19 Jul 2006 13:52:31 +0200
parents a19556fe83b5
children f5b0c3d22d93
comparison
equal deleted inserted replaced
104:3a708f113f55 105:3e74cc981e9b
112 XSync(dpy, False); 112 XSync(dpy, False);
113 *c->w = abs(ocx - ev.xmotion.x); 113 *c->w = abs(ocx - ev.xmotion.x);
114 *c->h = abs(ocy - ev.xmotion.y); 114 *c->h = abs(ocy - ev.xmotion.y);
115 *c->x = (ocx <= ev.xmotion.x) ? ocx : ocx - *c->w; 115 *c->x = (ocx <= ev.xmotion.x) ? ocx : ocx - *c->w;
116 *c->y = (ocy <= ev.xmotion.y) ? ocy : ocy - *c->h; 116 *c->y = (ocy <= ev.xmotion.y) ? ocy : ocy - *c->h;
117 if(ocx <= ev.xmotion.x) { 117 if(ocx <= ev.xmotion.x)
118 if(ocy <= ev.xmotion.y) 118 sticky = (ocy <= ev.xmotion.y) ? TopLeft : BotLeft;
119 sticky = TopLeft; 119 else
120 else 120 sticky = (ocy <= ev.xmotion.y) ? TopRight : BotRight;
121 sticky = BottomLeft;
122 } else {
123 if(ocy <= ev.xmotion.y)
124 sticky = TopRight;
125 else
126 sticky = BottomRight;
127 }
128 resize(c, True, sticky); 121 resize(c, True, sticky);
129 break; 122 break;
130 case ButtonRelease: 123 case ButtonRelease:
131 XUngrabPointer(dpy, CurrentTime); 124 XUngrabPointer(dpy, CurrentTime);
132 return; 125 return;