remove not working patch

This commit is contained in:
Linux User 2022-10-01 06:16:29 +00:00
parent d6b3d8419b
commit 02bab89c90
3 changed files with 5 additions and 22 deletions

BIN
dwm

Binary file not shown.

27
dwm.c
View File

@ -1563,14 +1563,9 @@ void
resizemouse(const Arg *arg) resizemouse(const Arg *arg)
{ {
int ocx, ocy, nw, nh; int ocx, ocy, nw, nh;
int ocx2, ocy2, nx, ny;
Client *c; Client *c;
Monitor *m; Monitor *m;
XEvent ev; XEvent ev;
int horizcorner, vertcorner;
int di;
unsigned int dui;
Window dummy;
Time lasttime = 0; Time lasttime = 0;
if (!(c = selmon->sel)) if (!(c = selmon->sel))
@ -1580,18 +1575,10 @@ resizemouse(const Arg *arg)
restack(selmon); restack(selmon);
ocx = c->x; ocx = c->x;
ocy = c->y; ocy = c->y;
ocx2 = c->x + c->w;
ocy2 = c->y + c->h;
if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync,
None, cursor[CurResize]->cursor, CurrentTime) != GrabSuccess) None, cursor[CurResize]->cursor, CurrentTime) != GrabSuccess)
return; return;
if (!XQueryPointer (dpy, c->win, &dummy, &dummy, &di, &di, &nx, &ny, &dui)) XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1);
return;
horizcorner = nx < c->w / 2;
vertcorner = ny < c->h / 2;
XWarpPointer(dpy, None, c->win, 0, 0, 0, 0,
horizcorner ? (-c->bw) : (c->w + c->bw - 1),
vertcorner ? (-c->bw) : (c->h + c->bw - 1));
do { do {
XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev); XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev);
switch(ev.type) { switch(ev.type) {
@ -1605,10 +1592,8 @@ resizemouse(const Arg *arg)
continue; continue;
lasttime = ev.xmotion.time; lasttime = ev.xmotion.time;
nx = horizcorner ? ev.xmotion.x : c->x; nw = MAX(ev.xmotion.x - ocx - 2 * c->bw + 1, 1);
ny = vertcorner ? ev.xmotion.y : c->y; nh = MAX(ev.xmotion.y - ocy - 2 * c->bw + 1, 1);
nw = MAX(horizcorner ? (ocx2 - nx) : (ev.xmotion.x - ocx - 2 * c->bw + 1), 1);
nh = MAX(vertcorner ? (ocy2 - ny) : (ev.xmotion.y - ocy - 2 * c->bw + 1), 1);
if (c->mon->wx + nw >= selmon->wx && c->mon->wx + nw <= selmon->wx + selmon->ww if (c->mon->wx + nw >= selmon->wx && c->mon->wx + nw <= selmon->wx + selmon->ww
&& c->mon->wy + nh >= selmon->wy && c->mon->wy + nh <= selmon->wy + selmon->wh) && c->mon->wy + nh >= selmon->wy && c->mon->wy + nh <= selmon->wy + selmon->wh)
@ -1618,13 +1603,11 @@ resizemouse(const Arg *arg)
togglefloating(NULL); togglefloating(NULL);
} }
if (!selmon->lt[selmon->sellt]->arrange || c->isfloating) if (!selmon->lt[selmon->sellt]->arrange || c->isfloating)
resize(c, nx, ny, nw, nh, 1); resize(c, c->x, c->y, nw, nh, 1);
break; break;
} }
} while (ev.type != ButtonRelease); } while (ev.type != ButtonRelease);
XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1);
horizcorner ? (-c->bw) : (c->w + c->bw - 1),
vertcorner ? (-c->bw) : (c->h + c->bw - 1));
XUngrabPointer(dpy, CurrentTime); XUngrabPointer(dpy, CurrentTime);
while (XCheckMaskEvent(dpy, EnterWindowMask, &ev)); while (XCheckMaskEvent(dpy, EnterWindowMask, &ev));
if ((m = recttomon(c->x, c->y, c->w, c->h)) != selmon) { if ((m = recttomon(c->x, c->y, c->w, c->h)) != selmon) {

BIN
dwm.o

Binary file not shown.