Compare commits
No commits in common. "8770c7b8785a4e7bb316c3a2cf50b63e6cbd7b06" and "4f9dcc5d4272dbe00b0e5485ac9f74d77ef4e84d" have entirely different histories.
8770c7b878
...
4f9dcc5d42
4
drw.c
4
drw.c
@ -274,7 +274,7 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp
|
|||||||
|
|
||||||
usedfont = drw->fonts;
|
usedfont = drw->fonts;
|
||||||
if (!ellipsis_width && render)
|
if (!ellipsis_width && render)
|
||||||
ellipsis_width = drw_fontset_getwidth(drw, "…");
|
ellipsis_width = drw_fontset_getwidth(drw, "...");
|
||||||
while (1) {
|
while (1) {
|
||||||
ew = ellipsis_len = utf8strlen = 0;
|
ew = ellipsis_len = utf8strlen = 0;
|
||||||
utf8str = text;
|
utf8str = text;
|
||||||
@ -328,7 +328,7 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp
|
|||||||
w -= ew;
|
w -= ew;
|
||||||
}
|
}
|
||||||
if (render && overflow)
|
if (render && overflow)
|
||||||
drw_text(drw, ellipsis_x, y, ellipsis_w, h, 0, "…", invert);
|
drw_text(drw, ellipsis_x, y, ellipsis_w, h, 0, "...", invert);
|
||||||
|
|
||||||
if (!*text || overflow) {
|
if (!*text || overflow) {
|
||||||
break;
|
break;
|
||||||
|
30
dwm.c
30
dwm.c
@ -1674,15 +1674,10 @@ void
|
|||||||
resizemouse(const Arg *arg)
|
resizemouse(const Arg *arg)
|
||||||
{
|
{
|
||||||
int ocx, ocy, nw, nh;
|
int ocx, ocy, nw, nh;
|
||||||
int ocx2, ocy2, nx, ny;
|
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
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))
|
||||||
@ -1692,21 +1687,12 @@ 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;
|
||||||
|
|
||||||
// should be in the if, but i want gcc to stfu
|
|
||||||
horizcorner = nx < c->w / 2;
|
|
||||||
vertcorner = ny < c->h / 2;
|
|
||||||
if (c->isfloating || NULL == c->mon->lt[c->mon->sellt]->arrange) {
|
if (c->isfloating || NULL == c->mon->lt[c->mon->sellt]->arrange) {
|
||||||
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;
|
|
||||||
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));
|
|
||||||
} else {
|
} else {
|
||||||
XWarpPointer(dpy, None, root, 0, 0, 0, 0,
|
XWarpPointer(dpy, None, root, 0, 0, 0, 0,
|
||||||
selmon->mx + (selmon->ww * selmon->mfact),
|
selmon->mx + (selmon->ww * selmon->mfact),
|
||||||
@ -1726,12 +1712,12 @@ resizemouse(const Arg *arg)
|
|||||||
if ((ev.xmotion.time - lasttime) <= (1000 / 60))
|
if ((ev.xmotion.time - lasttime) <= (1000 / 60))
|
||||||
continue;
|
continue;
|
||||||
lasttime = ev.xmotion.time;
|
lasttime = ev.xmotion.time;
|
||||||
nx = horizcorner ? ev.xmotion.x : c->x;
|
|
||||||
ny = vertcorner ? ev.xmotion.y : c->y;
|
nw = MAX(ev.xmotion.x - ocx - 2 * c->bw + 1, 1);
|
||||||
nw = MAX(horizcorner ? (ocx2 - nx) : (ev.xmotion.x - ocx - 2 * c->bw + 1), 1);
|
nh = MAX(ev.xmotion.y - ocy - 2 * c->bw + 1, 1);
|
||||||
nh = MAX(vertcorner ? (ocy2 - ny) : (ev.xmotion.y - ocy - 2 * c->bw + 1), 1);
|
|
||||||
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);
|
||||||
else {
|
else {
|
||||||
selmon->mfact = (double) (ev.xmotion.x_root - selmon->mx) / (double) selmon->ww;
|
selmon->mfact = (double) (ev.xmotion.x_root - selmon->mx) / (double) selmon->ww;
|
||||||
for(i=0; i<LENGTH(tags); ++i)
|
for(i=0; i<LENGTH(tags); ++i)
|
||||||
@ -1746,9 +1732,7 @@ resizemouse(const Arg *arg)
|
|||||||
} while (ev.type != ButtonRelease);
|
} while (ev.type != ButtonRelease);
|
||||||
|
|
||||||
if (c->isfloating || NULL == c->mon->lt[c->mon->sellt]->arrange) {
|
if (c->isfloating || NULL == c->mon->lt[c->mon->sellt]->arrange) {
|
||||||
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));
|
|
||||||
} else {
|
} else {
|
||||||
XWarpPointer(dpy, None, root, 0, 0, 0, 0,
|
XWarpPointer(dpy, None, root, 0, 0, 0, 0,
|
||||||
selmon->mx + (selmon->ww * selmon->mfact),
|
selmon->mx + (selmon->ww * selmon->mfact),
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
diff --git a/drw.c b/drw.c
|
|
||||||
index ced7d37..95da860 100644
|
|
||||||
--- a/drw.c
|
|
||||||
+++ b/drw.c
|
|
||||||
@@ -285,7 +285,7 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp
|
|
||||||
|
|
||||||
usedfont = drw->fonts;
|
|
||||||
if (!ellipsis_width && render)
|
|
||||||
- ellipsis_width = drw_fontset_getwidth(drw, "...");
|
|
||||||
+ ellipsis_width = drw_fontset_getwidth(drw, "…");
|
|
||||||
while (1) {
|
|
||||||
ew = ellipsis_len = utf8strlen = 0;
|
|
||||||
utf8str = text;
|
|
||||||
@@ -339,7 +339,7 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp
|
|
||||||
w -= ew;
|
|
||||||
}
|
|
||||||
if (render && overflow)
|
|
||||||
- drw_text(drw, ellipsis_x, y, ellipsis_w, h, 0, "...", invert);
|
|
||||||
+ drw_text(drw, ellipsis_x, y, ellipsis_w, h, 0, "…", invert);
|
|
||||||
|
|
||||||
if (!*text || overflow) {
|
|
||||||
break;
|
|
@ -1,68 +0,0 @@
|
|||||||
diff -r -u a/dwm.c b/dwm.c
|
|
||||||
--- a/dwm.c 2019-02-02 07:55:28.000000000 -0500
|
|
||||||
+++ b/dwm.c 2022-01-17 22:38:33.614493243 -0500
|
|
||||||
@@ -1291,9 +1291,14 @@
|
|
||||||
resizemouse(const Arg *arg)
|
|
||||||
{
|
|
||||||
int ocx, ocy, nw, nh;
|
|
||||||
+ int ocx2, ocy2, nx, ny;
|
|
||||||
Client *c;
|
|
||||||
Monitor *m;
|
|
||||||
XEvent ev;
|
|
||||||
+ int horizcorner, vertcorner;
|
|
||||||
+ int di;
|
|
||||||
+ unsigned int dui;
|
|
||||||
+ Window dummy;
|
|
||||||
Time lasttime = 0;
|
|
||||||
|
|
||||||
if (!(c = selmon->sel))
|
|
||||||
@@ -1303,10 +1308,18 @@
|
|
||||||
restack(selmon);
|
|
||||||
ocx = c->x;
|
|
||||||
ocy = c->y;
|
|
||||||
+ ocx2 = c->x + c->w;
|
|
||||||
+ ocy2 = c->y + c->h;
|
|
||||||
if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync,
|
|
||||||
None, cursor[CurResize]->cursor, CurrentTime) != GrabSuccess)
|
|
||||||
return;
|
|
||||||
- XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1);
|
|
||||||
+ if (!XQueryPointer (dpy, c->win, &dummy, &dummy, &di, &di, &nx, &ny, &dui))
|
|
||||||
+ 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 {
|
|
||||||
XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev);
|
|
||||||
switch(ev.type) {
|
|
||||||
@@ -1320,8 +1333,11 @@
|
|
||||||
continue;
|
|
||||||
lasttime = ev.xmotion.time;
|
|
||||||
|
|
||||||
- nw = MAX(ev.xmotion.x - ocx - 2 * c->bw + 1, 1);
|
|
||||||
- nh = MAX(ev.xmotion.y - ocy - 2 * c->bw + 1, 1);
|
|
||||||
+ nx = horizcorner ? ev.xmotion.x : c->x;
|
|
||||||
+ ny = vertcorner ? ev.xmotion.y : c->y;
|
|
||||||
+ 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
|
|
||||||
&& c->mon->wy + nh >= selmon->wy && c->mon->wy + nh <= selmon->wy + selmon->wh)
|
|
||||||
{
|
|
||||||
@@ -1330,11 +1346,13 @@
|
|
||||||
togglefloating(NULL);
|
|
||||||
}
|
|
||||||
if (!selmon->lt[selmon->sellt]->arrange || c->isfloating)
|
|
||||||
- resize(c, c->x, c->y, nw, nh, 1);
|
|
||||||
+ resize(c, nx, ny, nw, nh, 1);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} while (ev.type != ButtonRelease);
|
|
||||||
- XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1);
|
|
||||||
+ 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));
|
|
||||||
XUngrabPointer(dpy, CurrentTime);
|
|
||||||
while (XCheckMaskEvent(dpy, EnterWindowMask, &ev));
|
|
||||||
if ((m = recttomon(c->x, c->y, c->w, c->h)) != selmon) {
|
|
Loading…
Reference in New Issue
Block a user