t* dwm + patches URI git clone git://git.codevoid.de/dwm-sdk DIR Log DIR Files DIR Refs DIR README DIR LICENSE --- DIR commit 4d9e30fc5c6eee9ebab4bf5c8de1450b1ceef557 DIR parent 2fc02334c971485d52e007a3c0a5de834e7c98c0 URI Author: Stefan Hagen <sh+git[at]codevoid[dot]de> Date: Sun, 3 Feb 2019 13:41:31 +0100 Fix resizebarwin crash on resolution change + fs restore Diffstat: M config.h | 23 ++++++++++++++++++----- M dwm.c | 3 +++ M maximize.c | 17 +++++++++++++++++ 3 files changed, 38 insertions(+), 5 deletions(-) --- DIR diff --git a/config.h b/config.h t@@ -26,9 +26,18 @@ static const Bool extrabar = True; // False means no extra ba static const char *tags[] = { "1-CODE", "2-BUILD", "3-DOC", "4-SHELL", "5-WEB", "6-NOTES", "7-IRSSI" }; static const Rule rules[] = { - /* class instance title tags mask isfloating monitor */ - { "Gimp", NULL, NULL, 0, True, -1 }, - { "Firefox", NULL, NULL, 1 << 8, False, -1 }, + + // WM_CLASS(STRING) = "Pidgin", "Pidgin" + // WM_ICON_NAME(STRING) = "Buddy List" + // _NET_WM_ICON_NAME(UTF8_STRING) = "Buddy List" + + /* class instance title tags mask isfloating monitor */ + { "TelegramDesktop", NULL, NULL, 1 << 8, True, -1 }, + { "mpv", NULL, NULL, 1 << 8, True, -1 }, + { "Gimp", NULL, NULL, 1 << 8, True, -1 }, + { "Pidgin", NULL, NULL, 1 << 8, True, -1 }, + { "Seafile Client", NULL, NULL, 1 << 8, True, -1 }, + { "QSyncthingTray", NULL, NULL, 1 << 8, True, -1 }, }; /* layout(s) */ t@@ -66,10 +75,16 @@ static const char *browsercmd[] = { ".dwm/browser", DMENUOPTS, NULL }; static const char *passmenucmd[] = { ".dwm/passmenu", DMENUOPTS, NULL }; static const char *sshot[] = { ".dwm/sshot", NULL }; +static const char *updateStatus[] = { "pkill", "-SIGUSR1", "dwmstatus", NULL }; +static const char *unMute[] = { "mixerctl", "outputs.spkr_mute=off", NULL }; + #include "maximize.c" static Key keys[] = { /* modifier key function argument */ + { 0, 0x1008ff13,spawn, {.v = updateStatus } }, + { 0, 0x1008ff11,spawn, {.v = updateStatus } }, + { 0, 0x1008ff12,spawn, {.v = unMute } }, { MODKEY, XK_d, spawn, {.v = dmenucmd } }, { MODKEY, XK_Return, spawn, {.v = termcmd } }, t@@ -105,8 +120,6 @@ static Key keys[] = { { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, { MODKEY, XK_Left, viewtoleft, {0} }, { MODKEY, XK_Right, viewtoright, {0} }, - // { MODKEY|ShiftMask, XK_Left, tagtoleft, {0} }, - // { MODKEY|ShiftMask, XK_Right, tagtoright, {0} }, TAGKEYS( XK_1, 0) TAGKEYS( XK_2, 1) TAGKEYS( XK_3, 2) DIR diff --git a/dwm.c b/dwm.c t@@ -1544,6 +1544,8 @@ resize(Client *c, int x, int y, int w, int h, Bool interact) { void resizebarwin(Monitor *m) { + if(m == NULL) + m = 0; unsigned int w = m->ww; if(showsystray && m == selmon) w -= getsystraywidth(); t@@ -1902,6 +1904,7 @@ sigchld(int unused) { void spawn(const Arg *arg) { + restore(); if(fork() == 0) { if(dpy) close(ConnectionNumber(dpy)); DIR diff --git a/maximize.c b/maximize.c t@@ -30,6 +30,23 @@ maximize(int x, int y, int w, int h) { } void +restore() { + XEvent ev; + + if(!selmon->sel || selmon->sel->isfixed) + return; + XRaiseWindow(dpy, selmon->sel->win); + if(selmon->sel->ismax) { + resize(selmon->sel, selmon->sel->oldx, selmon->sel->oldy, selmon->sel->oldw, selmon->sel->oldh, True); + if(!selmon->sel->wasfloating) + togglefloating(NULL); + selmon->sel->ismax = False; + } + drawbar(selmon); + while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); +} + +void togglemaximize(const Arg *arg) { maximize(selmon->wx, selmon->wy, selmon->ww - 2 * borderpx, selmon->wh - 2 * borderpx); }