Fixed a bug in dwm patches
This commit is contained in:
parent
1ed75f8f15
commit
e4e31b6f79
|
@ -51,7 +51,7 @@ diff -ruN dwm-6.2-ori/config.def.h dwm-6.2/config.def.h
|
||||||
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} },
|
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} },
|
||||||
diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
--- dwm-6.2-ori/dwm.c 2019-02-02 18:25:28.000000000 +0530
|
--- dwm-6.2-ori/dwm.c 2019-02-02 18:25:28.000000000 +0530
|
||||||
+++ dwm-6.2/dwm.c 2020-09-23 20:13:50.516133820 +0530
|
+++ dwm-6.2/dwm.c 2020-09-30 21:52:33.227950503 +0530
|
||||||
@@ -40,6 +40,8 @@
|
@@ -40,6 +40,8 @@
|
||||||
#include <X11/extensions/Xinerama.h>
|
#include <X11/extensions/Xinerama.h>
|
||||||
#endif /* XINERAMA */
|
#endif /* XINERAMA */
|
||||||
|
@ -108,7 +108,26 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
static int screen;
|
static int screen;
|
||||||
static int sw, sh; /* X display screen geometry width, height */
|
static int sw, sh; /* X display screen geometry width, height */
|
||||||
static int bh, blw = 0; /* bar geometry */
|
static int bh, blw = 0; /* bar geometry */
|
||||||
@@ -439,10 +452,14 @@
|
@@ -416,7 +429,8 @@
|
||||||
|
void
|
||||||
|
buttonpress(XEvent *e)
|
||||||
|
{
|
||||||
|
- unsigned int i, x, click;
|
||||||
|
+ unsigned int i, click;
|
||||||
|
+ int x;
|
||||||
|
Arg arg = {0};
|
||||||
|
Client *c;
|
||||||
|
Monitor *m;
|
||||||
|
@@ -430,7 +444,7 @@
|
||||||
|
focus(NULL);
|
||||||
|
}
|
||||||
|
if (ev->window == selmon->barwin) {
|
||||||
|
- i = x = 0;
|
||||||
|
+ i = 0, x = 0;
|
||||||
|
do
|
||||||
|
x += TEXTW(tags[i]);
|
||||||
|
while (ev->x >= x && ++i < LENGTH(tags));
|
||||||
|
@@ -439,10 +453,14 @@
|
||||||
arg.ui = 1 << i;
|
arg.ui = 1 << i;
|
||||||
} else if (ev->x < x + blw)
|
} else if (ev->x < x + blw)
|
||||||
click = ClkLtSymbol;
|
click = ClkLtSymbol;
|
||||||
|
@ -127,7 +146,7 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
} else if ((c = wintoclient(ev->window))) {
|
} else if ((c = wintoclient(ev->window))) {
|
||||||
focus(c);
|
focus(c);
|
||||||
restack(selmon);
|
restack(selmon);
|
||||||
@@ -695,7 +712,7 @@
|
@@ -695,7 +713,7 @@
|
||||||
void
|
void
|
||||||
drawbar(Monitor *m)
|
drawbar(Monitor *m)
|
||||||
{
|
{
|
||||||
|
@ -136,7 +155,7 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
int boxs = drw->fonts->h / 9;
|
int boxs = drw->fonts->h / 9;
|
||||||
int boxw = drw->fonts->h / 6 + 2;
|
int boxw = drw->fonts->h / 6 + 2;
|
||||||
unsigned int i, occ = 0, urg = 0;
|
unsigned int i, occ = 0, urg = 0;
|
||||||
@@ -703,9 +720,30 @@
|
@@ -703,9 +721,30 @@
|
||||||
|
|
||||||
/* draw status first so it can be overdrawn by tags later */
|
/* draw status first so it can be overdrawn by tags later */
|
||||||
if (m == selmon) { /* status is only drawn on selected monitor */
|
if (m == selmon) { /* status is only drawn on selected monitor */
|
||||||
|
@ -170,7 +189,7 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
}
|
}
|
||||||
|
|
||||||
for (c = m->clients; c; c = c->next) {
|
for (c = m->clients; c; c = c->next) {
|
||||||
@@ -728,7 +766,7 @@
|
@@ -728,7 +767,7 @@
|
||||||
drw_setscheme(drw, scheme[SchemeNorm]);
|
drw_setscheme(drw, scheme[SchemeNorm]);
|
||||||
x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
|
x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
|
||||||
|
|
||||||
|
@ -179,7 +198,7 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
if (m->sel) {
|
if (m->sel) {
|
||||||
drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
|
drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
|
||||||
drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);
|
drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);
|
||||||
@@ -1122,8 +1160,20 @@
|
@@ -1122,8 +1161,20 @@
|
||||||
Monitor *m;
|
Monitor *m;
|
||||||
XMotionEvent *ev = &e->xmotion;
|
XMotionEvent *ev = &e->xmotion;
|
||||||
|
|
||||||
|
@ -201,7 +220,7 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
if ((m = recttomon(ev->x_root, ev->y_root, 1, 1)) != mon && mon) {
|
if ((m = recttomon(ev->x_root, ev->y_root, 1, 1)) != mon && mon) {
|
||||||
unfocus(selmon->sel, 1);
|
unfocus(selmon->sel, 1);
|
||||||
selmon = m;
|
selmon = m;
|
||||||
@@ -1564,6 +1614,7 @@
|
@@ -1564,6 +1615,7 @@
|
||||||
netatom[NetClientList] = XInternAtom(dpy, "_NET_CLIENT_LIST", False);
|
netatom[NetClientList] = XInternAtom(dpy, "_NET_CLIENT_LIST", False);
|
||||||
/* init cursors */
|
/* init cursors */
|
||||||
cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr);
|
cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr);
|
||||||
|
@ -209,7 +228,7 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
cursor[CurResize] = drw_cur_create(drw, XC_sizing);
|
cursor[CurResize] = drw_cur_create(drw, XC_sizing);
|
||||||
cursor[CurMove] = drw_cur_create(drw, XC_fleur);
|
cursor[CurMove] = drw_cur_create(drw, XC_fleur);
|
||||||
/* init appearance */
|
/* init appearance */
|
||||||
@@ -1637,6 +1688,28 @@
|
@@ -1637,6 +1689,28 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -238,7 +257,7 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
spawn(const Arg *arg)
|
spawn(const Arg *arg)
|
||||||
{
|
{
|
||||||
if (arg->v == dmenucmd)
|
if (arg->v == dmenucmd)
|
||||||
@@ -1805,7 +1878,7 @@
|
@@ -1805,7 +1879,7 @@
|
||||||
XSetWindowAttributes wa = {
|
XSetWindowAttributes wa = {
|
||||||
.override_redirect = True,
|
.override_redirect = True,
|
||||||
.background_pixmap = ParentRelative,
|
.background_pixmap = ParentRelative,
|
||||||
|
@ -247,7 +266,7 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
};
|
};
|
||||||
XClassHint ch = {"dwm", "dwm"};
|
XClassHint ch = {"dwm", "dwm"};
|
||||||
for (m = mons; m; m = m->next) {
|
for (m = mons; m; m = m->next) {
|
||||||
@@ -1847,6 +1920,42 @@
|
@@ -1847,6 +1921,42 @@
|
||||||
(unsigned char *) &(c->win), 1);
|
(unsigned char *) &(c->win), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -290,7 +309,7 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
int
|
int
|
||||||
updategeom(void)
|
updategeom(void)
|
||||||
{
|
{
|
||||||
@@ -1987,9 +2096,27 @@
|
@@ -1987,9 +2097,27 @@
|
||||||
void
|
void
|
||||||
updatestatus(void)
|
updatestatus(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -51,7 +51,7 @@ diff -ruN dwm-6.2-ori/config.def.h dwm-6.2/config.def.h
|
||||||
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} },
|
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} },
|
||||||
diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
--- dwm-6.2-ori/dwm.c 2020-08-17 23:51:19.057243495 +0530
|
--- dwm-6.2-ori/dwm.c 2020-08-17 23:51:19.057243495 +0530
|
||||||
+++ dwm-6.2/dwm.c 2020-09-23 20:34:40.620032555 +0530
|
+++ dwm-6.2/dwm.c 2020-09-30 21:57:10.685001270 +0530
|
||||||
@@ -40,6 +40,8 @@
|
@@ -40,6 +40,8 @@
|
||||||
#include <X11/extensions/Xinerama.h>
|
#include <X11/extensions/Xinerama.h>
|
||||||
#endif /* XINERAMA */
|
#endif /* XINERAMA */
|
||||||
|
@ -125,7 +125,26 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
static int lrpad; /* sum of left and right padding for text */
|
static int lrpad; /* sum of left and right padding for text */
|
||||||
static int (*xerrorxlib)(Display *, XErrorEvent *);
|
static int (*xerrorxlib)(Display *, XErrorEvent *);
|
||||||
static unsigned int numlockmask = 0;
|
static unsigned int numlockmask = 0;
|
||||||
@@ -475,10 +487,13 @@
|
@@ -452,7 +464,8 @@
|
||||||
|
void
|
||||||
|
buttonpress(XEvent *e)
|
||||||
|
{
|
||||||
|
- unsigned int i, x, click;
|
||||||
|
+ unsigned int i, click;
|
||||||
|
+ int x;
|
||||||
|
Arg arg = {0};
|
||||||
|
Client *c;
|
||||||
|
Monitor *m;
|
||||||
|
@@ -466,7 +479,7 @@
|
||||||
|
focus(NULL);
|
||||||
|
}
|
||||||
|
if (ev->window == selmon->barwin) {
|
||||||
|
- i = x = 0;
|
||||||
|
+ i = 0, x = 0;
|
||||||
|
do
|
||||||
|
x += TEXTW(tags[i]);
|
||||||
|
while (ev->x >= x && ++i < LENGTH(tags));
|
||||||
|
@@ -475,10 +488,13 @@
|
||||||
arg.ui = 1 << i;
|
arg.ui = 1 << i;
|
||||||
} else if (ev->x < x + blw)
|
} else if (ev->x < x + blw)
|
||||||
click = ClkLtSymbol;
|
click = ClkLtSymbol;
|
||||||
|
@ -143,7 +162,7 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
} else if ((c = wintoclient(ev->window))) {
|
} else if ((c = wintoclient(ev->window))) {
|
||||||
focus(c);
|
focus(c);
|
||||||
restack(selmon);
|
restack(selmon);
|
||||||
@@ -789,23 +804,45 @@
|
@@ -789,23 +805,45 @@
|
||||||
void
|
void
|
||||||
drawbar(Monitor *m)
|
drawbar(Monitor *m)
|
||||||
{
|
{
|
||||||
|
@ -197,7 +216,7 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
for (c = m->clients; c; c = c->next) {
|
for (c = m->clients; c; c = c->next) {
|
||||||
occ |= c->tags;
|
occ |= c->tags;
|
||||||
if (c->isurgent)
|
if (c->isurgent)
|
||||||
@@ -826,7 +863,7 @@
|
@@ -826,7 +864,7 @@
|
||||||
drw_setscheme(drw, scheme[SchemeNorm]);
|
drw_setscheme(drw, scheme[SchemeNorm]);
|
||||||
x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
|
x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
|
||||||
|
|
||||||
|
@ -206,7 +225,7 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
if (m->sel) {
|
if (m->sel) {
|
||||||
drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
|
drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
|
||||||
drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);
|
drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);
|
||||||
@@ -837,7 +874,7 @@
|
@@ -837,7 +875,7 @@
|
||||||
drw_rect(drw, x, 0, w, bh, 1, 1);
|
drw_rect(drw, x, 0, w, bh, 1, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -215,7 +234,7 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -1246,8 +1283,19 @@
|
@@ -1246,8 +1284,19 @@
|
||||||
Monitor *m;
|
Monitor *m;
|
||||||
XMotionEvent *ev = &e->xmotion;
|
XMotionEvent *ev = &e->xmotion;
|
||||||
|
|
||||||
|
@ -236,7 +255,7 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
if ((m = recttomon(ev->x_root, ev->y_root, 1, 1)) != mon && mon) {
|
if ((m = recttomon(ev->x_root, ev->y_root, 1, 1)) != mon && mon) {
|
||||||
unfocus(selmon->sel, 1);
|
unfocus(selmon->sel, 1);
|
||||||
selmon = m;
|
selmon = m;
|
||||||
@@ -1750,6 +1798,7 @@
|
@@ -1750,6 +1799,7 @@
|
||||||
xatom[XembedInfo] = XInternAtom(dpy, "_XEMBED_INFO", False);
|
xatom[XembedInfo] = XInternAtom(dpy, "_XEMBED_INFO", False);
|
||||||
/* init cursors */
|
/* init cursors */
|
||||||
cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr);
|
cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr);
|
||||||
|
@ -244,7 +263,7 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
cursor[CurResize] = drw_cur_create(drw, XC_sizing);
|
cursor[CurResize] = drw_cur_create(drw, XC_sizing);
|
||||||
cursor[CurMove] = drw_cur_create(drw, XC_fleur);
|
cursor[CurMove] = drw_cur_create(drw, XC_fleur);
|
||||||
/* init appearance */
|
/* init appearance */
|
||||||
@@ -1825,6 +1874,28 @@
|
@@ -1825,6 +1875,28 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -273,7 +292,7 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
spawn(const Arg *arg)
|
spawn(const Arg *arg)
|
||||||
{
|
{
|
||||||
if (arg->v == dmenucmd)
|
if (arg->v == dmenucmd)
|
||||||
@@ -2011,7 +2082,7 @@
|
@@ -2011,7 +2083,7 @@
|
||||||
XSetWindowAttributes wa = {
|
XSetWindowAttributes wa = {
|
||||||
.override_redirect = True,
|
.override_redirect = True,
|
||||||
.background_pixmap = ParentRelative,
|
.background_pixmap = ParentRelative,
|
||||||
|
@ -282,7 +301,7 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
};
|
};
|
||||||
XClassHint ch = {"dwm", "dwm"};
|
XClassHint ch = {"dwm", "dwm"};
|
||||||
for (m = mons; m; m = m->next) {
|
for (m = mons; m; m = m->next) {
|
||||||
@@ -2058,6 +2129,42 @@
|
@@ -2058,6 +2130,42 @@
|
||||||
(unsigned char *) &(c->win), 1);
|
(unsigned char *) &(c->win), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -325,7 +344,7 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
int
|
int
|
||||||
updategeom(void)
|
updategeom(void)
|
||||||
{
|
{
|
||||||
@@ -2198,10 +2305,27 @@
|
@@ -2198,10 +2306,27 @@
|
||||||
void
|
void
|
||||||
updatestatus(void)
|
updatestatus(void)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue