tapresize.c (1421B)
1 void 2 resizemousescroll(const Arg *arg) 3 { 4 int nw, nh; 5 Client *c; 6 Monitor *m; 7 XEvent ev; 8 int dw = *((int*)arg->v + 1); 9 int dh = *(int*)arg->v; 10 11 if (!(c = selmon->sel)) 12 return; 13 #if !FAKEFULLSCREEN_PATCH 14 #if FAKEFULLSCREEN_CLIENT_PATCH 15 if (c->isfullscreen && c->fakefullscreen != 1) /* no support resizing fullscreen windows by mouse */ 16 return; 17 #else 18 if (c->isfullscreen) /* no support resizing fullscreen windows by mouse */ 19 return; 20 #endif // FAKEFULLSCREEN_CLIENT_PATCH 21 #endif // !FAKEFULLSCREEN_PATCH 22 restack(selmon); 23 if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, 24 None, cursor[CurResize]->cursor, CurrentTime) != GrabSuccess) 25 return; 26 nw = MAX(c->w + dw, 1); 27 nh = MAX(c->h + dh, 1); 28 if (c->mon->wx + nw >= selmon->wx && c->mon->wx + nw <= selmon->wx + selmon->ww 29 && c->mon->wy + nh >= selmon->wy && c->mon->wy + nh <= selmon->wy + selmon->wh) 30 { 31 if (!c->isfloating && selmon->lt[selmon->sellt]->arrange 32 && (abs(nw - c->w) > snap || abs(nh - c->h) > snap)) 33 togglefloating(NULL); 34 } 35 if (!selmon->lt[selmon->sellt]->arrange || c->isfloating) 36 resize(c, c->x, c->y, nw, nh, 1); 37 XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1); 38 XUngrabPointer(dpy, CurrentTime); 39 while (XCheckMaskEvent(dpy, EnterWindowMask, &ev)); 40 if ((m = recttomon(c->x, c->y, c->w, c->h)) != selmon) { 41 sendmon(c, m); 42 selmon = m; 43 focus(NULL); 44 } 45 } 46