about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--client.c4
-rw-r--r--dwm.h4
-rw-r--r--event.c15
3 files changed, 8 insertions, 15 deletions
diff --git a/client.c b/client.c
index 52e623a..b1328d4 100644
--- a/client.c
+++ b/client.c
@@ -315,9 +315,9 @@ resize(Client *c, Bool inc, Corner sticky)
 		*c->w = c->maxw;
 	if(c->maxh && *c->h > c->maxh)
 		*c->h = c->maxh;
-	if(sticky == TopRight || sticky == BottomRight)
+	if(sticky == TopRight || sticky == BotRight)
 		*c->x = right - *c->w;
-	if(sticky == BottomLeft || sticky == BottomRight)
+	if(sticky == BotLeft || sticky == BotRight)
 		*c->y = bottom - *c->h;
 	resizetitle(c);
 	XSetWindowBorderWidth(dpy, c->win, 1);
diff --git a/dwm.h b/dwm.h
index d3138be..5a714f2 100644
--- a/dwm.h
+++ b/dwm.h
@@ -25,9 +25,9 @@ enum { Tscratch, Tdev, Twww, Twork, TLast };
 /********** CUSTOMIZE **********/
 
 typedef union Arg Arg;
+typedef struct Client Client;
 typedef enum Corner Corner;
 typedef struct DC DC;
-typedef struct Client Client;
 typedef struct Fnt Fnt;
 typedef struct Key Key;
 typedef struct Rule Rule;
@@ -44,7 +44,7 @@ enum { WMProtocols, WMDelete, WMLast };
 /* cursor */
 enum { CurNormal, CurResize, CurMove, CurLast };
 
-enum Corner { TopLeft, TopRight, BottomLeft, BottomRight };
+enum Corner { TopLeft, TopRight, BotLeft, BotRight };
 
 struct Fnt {
 	int ascent;
diff --git a/event.c b/event.c
index 9d69373..e4dfad1 100644
--- a/event.c
+++ b/event.c
@@ -114,17 +114,10 @@ resizemouse(Client *c)
 			*c->h = abs(ocy - ev.xmotion.y);
 			*c->x = (ocx <= ev.xmotion.x) ? ocx : ocx - *c->w;
 			*c->y = (ocy <= ev.xmotion.y) ? ocy : ocy - *c->h;
-			if(ocx <= ev.xmotion.x) {
-				if(ocy <= ev.xmotion.y)
-					sticky = TopLeft;
-				else
-					sticky = BottomLeft;
-			} else {
-				if(ocy <= ev.xmotion.y)
-					sticky = TopRight;
-				else
-					sticky = BottomRight;
-			}
+			if(ocx <= ev.xmotion.x)
+				sticky = (ocy <= ev.xmotion.y) ? TopLeft : BotLeft;
+			else
+				sticky = (ocy <= ev.xmotion.y) ? TopRight : BotRight;
 			resize(c, True, sticky);
 			break;
 		case ButtonRelease:
='#n221'>221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379