Improved and bug fixed patches
This commit is contained in:
parent
18b6ff255d
commit
3bd2416d86
|
@ -43,7 +43,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-12-27 19:55:32.771263008 +0530
|
+++ dwm-6.2/dwm.c 2020-12-28 21:41:08.356370628 +0530
|
||||||
@@ -40,6 +40,7 @@
|
@@ -40,6 +40,7 @@
|
||||||
#include <X11/extensions/Xinerama.h>
|
#include <X11/extensions/Xinerama.h>
|
||||||
#endif /* XINERAMA */
|
#endif /* XINERAMA */
|
||||||
|
@ -69,7 +69,15 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
enum { NetSupported, NetWMName, NetWMState, NetWMCheck,
|
enum { NetSupported, NetWMName, NetWMState, NetWMCheck,
|
||||||
NetWMFullscreen, NetActiveWindow, NetWMWindowType,
|
NetWMFullscreen, NetActiveWindow, NetWMWindowType,
|
||||||
NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */
|
NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */
|
||||||
@@ -205,6 +210,7 @@
|
@@ -124,6 +129,7 @@
|
||||||
|
unsigned int tagset[2];
|
||||||
|
int showbar;
|
||||||
|
int topbar;
|
||||||
|
+ int statushandcursor;
|
||||||
|
Client *clients;
|
||||||
|
Client *sel;
|
||||||
|
Client *stack;
|
||||||
|
@@ -205,6 +211,7 @@
|
||||||
static void seturgent(Client *c, int urg);
|
static void seturgent(Client *c, int urg);
|
||||||
static void showhide(Client *c);
|
static void showhide(Client *c);
|
||||||
static void sigchld(int unused);
|
static void sigchld(int unused);
|
||||||
|
@ -77,7 +85,7 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
static void spawn(const Arg *arg);
|
static void spawn(const Arg *arg);
|
||||||
static void tag(const Arg *arg);
|
static void tag(const Arg *arg);
|
||||||
static void tagmon(const Arg *arg);
|
static void tagmon(const Arg *arg);
|
||||||
@@ -219,6 +225,7 @@
|
@@ -219,6 +226,7 @@
|
||||||
static void updatebarpos(Monitor *m);
|
static void updatebarpos(Monitor *m);
|
||||||
static void updatebars(void);
|
static void updatebars(void);
|
||||||
static void updateclientlist(void);
|
static void updateclientlist(void);
|
||||||
|
@ -85,7 +93,7 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
static int updategeom(void);
|
static int updategeom(void);
|
||||||
static void updatenumlockmask(void);
|
static void updatenumlockmask(void);
|
||||||
static void updatesizehints(Client *c);
|
static void updatesizehints(Client *c);
|
||||||
@@ -236,12 +243,16 @@
|
@@ -236,12 +244,15 @@
|
||||||
|
|
||||||
/* variables */
|
/* variables */
|
||||||
static const char broken[] = "broken";
|
static const char broken[] = "broken";
|
||||||
|
@ -96,9 +104,8 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
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 */
|
||||||
+static int bh, blw, ble; /* bar geometry */
|
+static int bh, blw, ble; /* bar geometry */
|
||||||
|
+static int wstext; /* width of status text */
|
||||||
static int lrpad; /* sum of left and right padding for text */
|
static int lrpad; /* sum of left and right padding for text */
|
||||||
+static int statushandcursor;
|
|
||||||
+static int wstext;
|
|
||||||
static int (*xerrorxlib)(Display *, XErrorEvent *);
|
static int (*xerrorxlib)(Display *, XErrorEvent *);
|
||||||
+static unsigned int dwmblockssig;
|
+static unsigned int dwmblockssig;
|
||||||
static unsigned int numlockmask = 0;
|
static unsigned int numlockmask = 0;
|
||||||
|
@ -120,7 +127,7 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
/* focus monitor if necessary */
|
/* focus monitor if necessary */
|
||||||
if ((m = wintomon(ev->window)) && m != selmon) {
|
if ((m = wintomon(ev->window)) && m != selmon) {
|
||||||
unfocus(selmon->sel, 1);
|
unfocus(selmon->sel, 1);
|
||||||
@@ -430,25 +441,30 @@
|
@@ -430,25 +441,29 @@
|
||||||
focus(NULL);
|
focus(NULL);
|
||||||
}
|
}
|
||||||
if (ev->window == selmon->barwin) {
|
if (ev->window == selmon->barwin) {
|
||||||
|
@ -137,17 +144,16 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
- click = ClkStatusText;
|
- click = ClkStatusText;
|
||||||
- else
|
- else
|
||||||
- click = ClkWinTitle;
|
- click = ClkWinTitle;
|
||||||
+ if (ev->x < ble) {
|
+ if (ev->x < ble - blw) {
|
||||||
+ if (ev->x < ble - blw) {
|
+ i = -1, x = -ev->x;
|
||||||
+ i = -1, x = -ev->x;
|
+ do
|
||||||
+ do
|
+ x += TEXTW(tags[++i]);
|
||||||
+ x += TEXTW(tags[++i]);
|
+ while (x <= 0);
|
||||||
+ while (x <= 0);
|
+ click = ClkTagBar;
|
||||||
+ click = ClkTagBar;
|
+ arg.ui = 1 << i;
|
||||||
+ arg.ui = 1 << i;
|
+ } else if (ev->x < ble)
|
||||||
+ } else
|
+ click = ClkLtSymbol;
|
||||||
+ click = ClkLtSymbol;
|
+ else if (ev->x < selmon->ww - wstext)
|
||||||
+ } else if (ev->x < selmon->ww - wstext)
|
|
||||||
+ click = ClkWinTitle;
|
+ click = ClkWinTitle;
|
||||||
+ else if ((x = selmon->ww - lrpad / 2 - ev->x) > 0 && (x -= wstext - lrpad) <= 0) {
|
+ else if ((x = selmon->ww - lrpad / 2 - ev->x) > 0 && (x -= wstext - lrpad) <= 0) {
|
||||||
+ updatedwmblockssig(x);
|
+ updatedwmblockssig(x);
|
||||||
|
@ -165,7 +171,7 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
for (i = 0; i < LENGTH(buttons); i++)
|
for (i = 0; i < LENGTH(buttons); i++)
|
||||||
if (click == buttons[i].click && buttons[i].func && buttons[i].button == ev->button
|
if (click == buttons[i].click && buttons[i].func && buttons[i].button == ev->button
|
||||||
&& CLEANMASK(buttons[i].mask) == CLEANMASK(ev->state))
|
&& CLEANMASK(buttons[i].mask) == CLEANMASK(ev->state))
|
||||||
@@ -695,7 +711,7 @@
|
@@ -695,7 +710,7 @@
|
||||||
void
|
void
|
||||||
drawbar(Monitor *m)
|
drawbar(Monitor *m)
|
||||||
{
|
{
|
||||||
|
@ -174,7 +180,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 +719,30 @@
|
@@ -703,9 +718,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 */
|
||||||
|
@ -208,7 +214,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) {
|
||||||
@@ -724,11 +761,17 @@
|
@@ -724,11 +760,17 @@
|
||||||
urg & 1 << i);
|
urg & 1 << i);
|
||||||
x += w;
|
x += w;
|
||||||
}
|
}
|
||||||
|
@ -228,7 +234,11 @@ 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,14 +1165,24 @@
|
@@ -1119,17 +1161,24 @@
|
||||||
|
motionnotify(XEvent *e)
|
||||||
|
{
|
||||||
|
static Monitor *mon = NULL;
|
||||||
|
+ int x;
|
||||||
Monitor *m;
|
Monitor *m;
|
||||||
XMotionEvent *ev = &e->xmotion;
|
XMotionEvent *ev = &e->xmotion;
|
||||||
|
|
||||||
|
@ -247,21 +257,17 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
+ focus(NULL);
|
+ focus(NULL);
|
||||||
+ }
|
+ }
|
||||||
+ mon = m;
|
+ mon = m;
|
||||||
+ } else if (ev->window == selmon->barwin) {
|
+ } else if (ev->window == selmon->barwin && (x = selmon->ww - lrpad / 2 - ev->x) > 0
|
||||||
+ int x;
|
+ && (x -= wstext - lrpad) <= 0)
|
||||||
+
|
+ updatedwmblockssig(x);
|
||||||
+ if (ev->x >= ble && (x = selmon->ww - lrpad / 2 - ev->x) > 0 &&
|
+ else if (selmon->statushandcursor) {
|
||||||
+ (x -= wstext - lrpad) <= 0)
|
+ selmon->statushandcursor = 0;
|
||||||
+ updatedwmblockssig(x);
|
+ XDefineCursor(dpy, selmon->barwin, cursor[CurNormal]->cursor);
|
||||||
+ else if (statushandcursor) {
|
|
||||||
+ statushandcursor = 0;
|
|
||||||
+ XDefineCursor(dpy, selmon->barwin, cursor[CurNormal]->cursor);
|
|
||||||
+ }
|
|
||||||
+ }
|
+ }
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -1564,6 +1617,7 @@
|
@@ -1564,6 +1613,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);
|
||||||
|
@ -269,7 +275,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 +1691,28 @@
|
@@ -1637,6 +1687,28 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -298,7 +304,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 +1881,7 @@
|
@@ -1805,7 +1877,7 @@
|
||||||
XSetWindowAttributes wa = {
|
XSetWindowAttributes wa = {
|
||||||
.override_redirect = True,
|
.override_redirect = True,
|
||||||
.background_pixmap = ParentRelative,
|
.background_pixmap = ParentRelative,
|
||||||
|
@ -307,7 +313,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 +1923,42 @@
|
@@ -1847,6 +1919,42 @@
|
||||||
(unsigned char *) &(c->win), 1);
|
(unsigned char *) &(c->win), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -330,8 +336,8 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
+ if (x >= 0) {
|
+ if (x >= 0) {
|
||||||
+ if (ctmp == DELIMITERENDCHAR)
|
+ if (ctmp == DELIMITERENDCHAR)
|
||||||
+ goto cursorondelim;
|
+ goto cursorondelim;
|
||||||
+ if (!statushandcursor) {
|
+ if (!selmon->statushandcursor) {
|
||||||
+ statushandcursor = 1;
|
+ selmon->statushandcursor = 1;
|
||||||
+ XDefineCursor(dpy, selmon->barwin, cursor[CurHand]->cursor);
|
+ XDefineCursor(dpy, selmon->barwin, cursor[CurHand]->cursor);
|
||||||
+ }
|
+ }
|
||||||
+ dwmblockssig = ctmp;
|
+ dwmblockssig = ctmp;
|
||||||
|
@ -340,8 +346,8 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
+ tp = ++ts;
|
+ tp = ++ts;
|
||||||
+ }
|
+ }
|
||||||
+cursorondelim:
|
+cursorondelim:
|
||||||
+ if (statushandcursor) {
|
+ if (selmon->statushandcursor) {
|
||||||
+ statushandcursor = 0;
|
+ selmon->statushandcursor = 0;
|
||||||
+ XDefineCursor(dpy, selmon->barwin, cursor[CurNormal]->cursor);
|
+ XDefineCursor(dpy, selmon->barwin, cursor[CurNormal]->cursor);
|
||||||
+ }
|
+ }
|
||||||
+ dwmblockssig = 0;
|
+ dwmblockssig = 0;
|
||||||
|
@ -350,7 +356,7 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
int
|
int
|
||||||
updategeom(void)
|
updategeom(void)
|
||||||
{
|
{
|
||||||
@@ -1987,9 +2099,27 @@
|
@@ -1987,9 +2095,27 @@
|
||||||
void
|
void
|
||||||
updatestatus(void)
|
updatestatus(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,7 +43,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-12-27 20:04:13.757998389 +0530
|
+++ dwm-6.2/dwm.c 2020-12-28 21:48:30.327935787 +0530
|
||||||
@@ -40,6 +40,7 @@
|
@@ -40,6 +40,7 @@
|
||||||
#include <X11/extensions/Xinerama.h>
|
#include <X11/extensions/Xinerama.h>
|
||||||
#endif /* XINERAMA */
|
#endif /* XINERAMA */
|
||||||
|
@ -74,7 +74,15 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
enum { NetSupported, NetWMName, NetWMState, NetWMCheck,
|
enum { NetSupported, NetWMName, NetWMState, NetWMCheck,
|
||||||
NetSystemTray, NetSystemTrayOP, NetSystemTrayOrientation, NetSystemTrayOrientationHorz,
|
NetSystemTray, NetSystemTrayOP, NetSystemTrayOrientation, NetSystemTrayOrientationHorz,
|
||||||
NetWMFullscreen, NetActiveWindow, NetWMWindowType,
|
NetWMFullscreen, NetActiveWindow, NetWMWindowType,
|
||||||
@@ -234,6 +239,7 @@
|
@@ -142,6 +147,7 @@
|
||||||
|
unsigned int tagset[2];
|
||||||
|
int showbar;
|
||||||
|
int topbar;
|
||||||
|
+ int statushandcursor;
|
||||||
|
Client *clients;
|
||||||
|
Client *sel;
|
||||||
|
Client *stack;
|
||||||
|
@@ -234,6 +240,7 @@
|
||||||
static void seturgent(Client *c, int urg);
|
static void seturgent(Client *c, int urg);
|
||||||
static void showhide(Client *c);
|
static void showhide(Client *c);
|
||||||
static void sigchld(int unused);
|
static void sigchld(int unused);
|
||||||
|
@ -82,7 +90,7 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
static void spawn(const Arg *arg);
|
static void spawn(const Arg *arg);
|
||||||
static Monitor *systraytomon(Monitor *m);
|
static Monitor *systraytomon(Monitor *m);
|
||||||
static void tag(const Arg *arg);
|
static void tag(const Arg *arg);
|
||||||
@@ -249,6 +255,7 @@
|
@@ -249,6 +256,7 @@
|
||||||
static void updatebarpos(Monitor *m);
|
static void updatebarpos(Monitor *m);
|
||||||
static void updatebars(void);
|
static void updatebars(void);
|
||||||
static void updateclientlist(void);
|
static void updateclientlist(void);
|
||||||
|
@ -90,7 +98,7 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
static int updategeom(void);
|
static int updategeom(void);
|
||||||
static void updatenumlockmask(void);
|
static void updatenumlockmask(void);
|
||||||
static void updatesizehints(Client *c);
|
static void updatesizehints(Client *c);
|
||||||
@@ -269,14 +276,17 @@
|
@@ -269,14 +277,17 @@
|
||||||
static void zoom(const Arg *arg);
|
static void zoom(const Arg *arg);
|
||||||
|
|
||||||
/* variables */
|
/* variables */
|
||||||
|
@ -100,20 +108,18 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
+static char stextc[STATUSLENGTH];
|
+static char stextc[STATUSLENGTH];
|
||||||
+static char stexts[STATUSLENGTH];
|
+static char stexts[STATUSLENGTH];
|
||||||
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 */
|
||||||
-static int lrpad; /* sum of left and right padding for text */
|
+static int bh, blw, ble; /* bar geometry */
|
||||||
+static int sw, sh; /* X display screen geometry width, height */
|
+static int wsbar; /* width of selmon bar */
|
||||||
+static int bh, blw, ble, stw; /* bar geometry */
|
+static int wstext; /* width of status text */
|
||||||
+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 int statushandcursor;
|
|
||||||
+static int wstext;
|
|
||||||
+static unsigned int dwmblockssig;
|
+static unsigned int dwmblockssig;
|
||||||
static unsigned int numlockmask = 0;
|
static unsigned int numlockmask = 0;
|
||||||
static void (*handler[LASTEvent]) (XEvent *) = {
|
static void (*handler[LASTEvent]) (XEvent *) = {
|
||||||
[ButtonPress] = buttonpress,
|
[ButtonPress] = buttonpress,
|
||||||
@@ -303,6 +313,7 @@
|
@@ -303,6 +314,7 @@
|
||||||
static Drw *drw;
|
static Drw *drw;
|
||||||
static Monitor *mons, *selmon;
|
static Monitor *mons, *selmon;
|
||||||
static Window root, wmcheckwin;
|
static Window root, wmcheckwin;
|
||||||
|
@ -121,7 +127,7 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
|
|
||||||
/* configuration, allows nested code to access above variables */
|
/* configuration, allows nested code to access above variables */
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
@@ -452,13 +463,13 @@
|
@@ -452,13 +464,13 @@
|
||||||
void
|
void
|
||||||
buttonpress(XEvent *e)
|
buttonpress(XEvent *e)
|
||||||
{
|
{
|
||||||
|
@ -137,7 +143,7 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
/* focus monitor if necessary */
|
/* focus monitor if necessary */
|
||||||
if ((m = wintomon(ev->window)) && m != selmon) {
|
if ((m = wintomon(ev->window)) && m != selmon) {
|
||||||
unfocus(selmon->sel, 1);
|
unfocus(selmon->sel, 1);
|
||||||
@@ -466,25 +477,34 @@
|
@@ -466,25 +478,29 @@
|
||||||
focus(NULL);
|
focus(NULL);
|
||||||
}
|
}
|
||||||
if (ev->window == selmon->barwin) {
|
if (ev->window == selmon->barwin) {
|
||||||
|
@ -154,27 +160,22 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
- click = ClkStatusText;
|
- click = ClkStatusText;
|
||||||
- else
|
- else
|
||||||
- click = ClkWinTitle;
|
- click = ClkWinTitle;
|
||||||
+ if (ev->x < ble) {
|
+ if (ev->x < ble - blw) {
|
||||||
+ if (ev->x < ble - blw) {
|
+ i = -1, x = -ev->x;
|
||||||
+ i = -1, x = -ev->x;
|
+ do
|
||||||
+ do
|
+ x += TEXTW(tags[++i]);
|
||||||
+ x += TEXTW(tags[++i]);
|
+ while (x <= 0);
|
||||||
+ while (x <= 0);
|
+ click = ClkTagBar;
|
||||||
+ click = ClkTagBar;
|
+ arg.ui = 1 << i;
|
||||||
+ arg.ui = 1 << i;
|
+ } else if (ev->x < ble)
|
||||||
+ } else
|
+ click = ClkLtSymbol;
|
||||||
+ click = ClkLtSymbol;
|
+ else if (ev->x < wsbar - wstext)
|
||||||
+ } else {
|
+ click = ClkWinTitle;
|
||||||
+ int wbar = showsystray && selmon == systraytomon(selmon) ? selmon->ww - stw : selmon->ww;
|
+ else if ((x = wsbar - lrpad / 2 - ev->x) > 0 && (x -= wstext - lrpad) <= 0) {
|
||||||
+
|
+ updatedwmblockssig(x);
|
||||||
+ if (ev->x < wbar - wstext)
|
+ click = ClkStatusText;
|
||||||
+ click = ClkWinTitle;
|
+ } else
|
||||||
+ else if ((x = wbar - lrpad / 2 - ev->x) > 0 && (x -= wstext - lrpad) <= 0) {
|
|
||||||
+ updatedwmblockssig(x);
|
|
||||||
+ click = ClkStatusText;
|
|
||||||
+ } else
|
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
|
||||||
} else if ((c = wintoclient(ev->window))) {
|
} else if ((c = wintoclient(ev->window))) {
|
||||||
focus(c);
|
focus(c);
|
||||||
restack(selmon);
|
restack(selmon);
|
||||||
|
@ -186,7 +187,7 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
for (i = 0; i < LENGTH(buttons); i++)
|
for (i = 0; i < LENGTH(buttons); i++)
|
||||||
if (click == buttons[i].click && buttons[i].func && buttons[i].button == ev->button
|
if (click == buttons[i].click && buttons[i].func && buttons[i].button == ev->button
|
||||||
&& CLEANMASK(buttons[i].mask) == CLEANMASK(ev->state))
|
&& CLEANMASK(buttons[i].mask) == CLEANMASK(ev->state))
|
||||||
@@ -789,23 +809,44 @@
|
@@ -789,23 +805,45 @@
|
||||||
void
|
void
|
||||||
drawbar(Monitor *m)
|
drawbar(Monitor *m)
|
||||||
{
|
{
|
||||||
|
@ -201,7 +202,7 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
- if(showsystray && m == systraytomon(m))
|
- if(showsystray && m == systraytomon(m))
|
||||||
- stw = getsystraywidth();
|
- stw = getsystraywidth();
|
||||||
+ if (showsystray && m == systraytomon(m))
|
+ if (showsystray && m == systraytomon(m))
|
||||||
+ wbar -= (stw = getsystraywidth());
|
+ wbar -= getsystraywidth();
|
||||||
|
|
||||||
/* 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 */
|
||||||
|
@ -212,6 +213,7 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
+ char *tp = stextc;
|
+ char *tp = stextc;
|
||||||
+ char ctmp;
|
+ char ctmp;
|
||||||
+
|
+
|
||||||
|
+ wsbar = wbar;
|
||||||
+ drw_setscheme(drw, scheme[SchemeNorm]);
|
+ drw_setscheme(drw, scheme[SchemeNorm]);
|
||||||
+ x = wbar - wstext;
|
+ x = wbar - wstext;
|
||||||
+ drw_rect(drw, x, 0, lrpad / 2, bh, 1, 1); x += lrpad / 2; /* to keep left padding clean */
|
+ drw_rect(drw, x, 0, lrpad / 2, bh, 1, 1); x += lrpad / 2; /* to keep left padding clean */
|
||||||
|
@ -238,7 +240,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)
|
||||||
@@ -822,11 +863,17 @@
|
@@ -822,11 +860,17 @@
|
||||||
urg & 1 << i);
|
urg & 1 << i);
|
||||||
x += w;
|
x += w;
|
||||||
}
|
}
|
||||||
|
@ -258,7 +260,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 +884,9 @@
|
@@ -837,7 +881,9 @@
|
||||||
drw_rect(drw, x, 0, w, bh, 1, 1);
|
drw_rect(drw, x, 0, w, bh, 1, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -269,7 +271,11 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -1246,14 +1295,25 @@
|
@@ -1243,17 +1289,24 @@
|
||||||
|
motionnotify(XEvent *e)
|
||||||
|
{
|
||||||
|
static Monitor *mon = NULL;
|
||||||
|
+ int x;
|
||||||
Monitor *m;
|
Monitor *m;
|
||||||
XMotionEvent *ev = &e->xmotion;
|
XMotionEvent *ev = &e->xmotion;
|
||||||
|
|
||||||
|
@ -288,22 +294,17 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
+ focus(NULL);
|
+ focus(NULL);
|
||||||
+ }
|
+ }
|
||||||
+ mon = m;
|
+ mon = m;
|
||||||
+ } else if (ev->window == selmon->barwin) {
|
+ } else if (ev->window == selmon->barwin && (x = wsbar - lrpad / 2 - ev->x) > 0
|
||||||
+ int x = selmon->ww - lrpad / 2 - ev->x;
|
+ && (x -= wstext - lrpad) <= 0)
|
||||||
+
|
+ updatedwmblockssig(x);
|
||||||
+ if (showsystray && selmon == systraytomon(selmon))
|
+ else if (selmon->statushandcursor) {
|
||||||
+ x -= stw;
|
+ selmon->statushandcursor = 0;
|
||||||
+ if (ev->x >= ble && x > 0 && (x -= wstext - lrpad) <= 0)
|
+ XDefineCursor(dpy, selmon->barwin, cursor[CurNormal]->cursor);
|
||||||
+ updatedwmblockssig(x);
|
|
||||||
+ else if (statushandcursor) {
|
|
||||||
+ statushandcursor = 0;
|
|
||||||
+ XDefineCursor(dpy, selmon->barwin, cursor[CurNormal]->cursor);
|
|
||||||
+ }
|
|
||||||
+ }
|
+ }
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -1750,6 +1810,7 @@
|
@@ -1750,6 +1803,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);
|
||||||
|
@ -311,7 +312,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 +1886,28 @@
|
@@ -1825,6 +1879,28 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -340,7 +341,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 +2094,7 @@
|
@@ -2011,7 +2087,7 @@
|
||||||
XSetWindowAttributes wa = {
|
XSetWindowAttributes wa = {
|
||||||
.override_redirect = True,
|
.override_redirect = True,
|
||||||
.background_pixmap = ParentRelative,
|
.background_pixmap = ParentRelative,
|
||||||
|
@ -349,7 +350,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 +2141,42 @@
|
@@ -2058,6 +2134,42 @@
|
||||||
(unsigned char *) &(c->win), 1);
|
(unsigned char *) &(c->win), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -372,8 +373,8 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
+ if (x >= 0) {
|
+ if (x >= 0) {
|
||||||
+ if (ctmp == DELIMITERENDCHAR)
|
+ if (ctmp == DELIMITERENDCHAR)
|
||||||
+ goto cursorondelim;
|
+ goto cursorondelim;
|
||||||
+ if (!statushandcursor) {
|
+ if (!selmon->statushandcursor) {
|
||||||
+ statushandcursor = 1;
|
+ selmon->statushandcursor = 1;
|
||||||
+ XDefineCursor(dpy, selmon->barwin, cursor[CurHand]->cursor);
|
+ XDefineCursor(dpy, selmon->barwin, cursor[CurHand]->cursor);
|
||||||
+ }
|
+ }
|
||||||
+ dwmblockssig = ctmp;
|
+ dwmblockssig = ctmp;
|
||||||
|
@ -382,8 +383,8 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
+ tp = ++ts;
|
+ tp = ++ts;
|
||||||
+ }
|
+ }
|
||||||
+cursorondelim:
|
+cursorondelim:
|
||||||
+ if (statushandcursor) {
|
+ if (selmon->statushandcursor) {
|
||||||
+ statushandcursor = 0;
|
+ selmon->statushandcursor = 0;
|
||||||
+ XDefineCursor(dpy, selmon->barwin, cursor[CurNormal]->cursor);
|
+ XDefineCursor(dpy, selmon->barwin, cursor[CurNormal]->cursor);
|
||||||
+ }
|
+ }
|
||||||
+ dwmblockssig = 0;
|
+ dwmblockssig = 0;
|
||||||
|
@ -392,7 +393,7 @@ diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
||||||
int
|
int
|
||||||
updategeom(void)
|
updategeom(void)
|
||||||
{
|
{
|
||||||
@@ -2198,10 +2317,27 @@
|
@@ -2198,10 +2310,27 @@
|
||||||
void
|
void
|
||||||
updatestatus(void)
|
updatestatus(void)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue