apply patch dwm-winview-gaplessgrid-gridall-6.5.diff
This commit is contained in:
38
dwm.c
38
dwm.c
@@ -250,10 +250,13 @@ static void view(const Arg *arg);
|
||||
static void warp(const Client *c);
|
||||
static Client *wintoclient(Window w);
|
||||
static Monitor *wintomon(Window w);
|
||||
static void winview(const Arg* arg);
|
||||
static int xerror(Display *dpy, XErrorEvent *ee);
|
||||
static int xerrordummy(Display *dpy, XErrorEvent *ee);
|
||||
static int xerrorstart(Display *dpy, XErrorEvent *ee);
|
||||
static void zoom(const Arg *arg);
|
||||
static void gridall(const Arg *arg);
|
||||
static void winviewmono(const Arg *arg);
|
||||
|
||||
/* variables */
|
||||
static const char broken[] = "broken";
|
||||
@@ -2496,6 +2499,41 @@ wintomon(Window w)
|
||||
return selmon;
|
||||
}
|
||||
|
||||
/* Selects for the view of the focused window. The list of tags */
|
||||
/* to be displayed is matched to the focused window tag list. */
|
||||
void
|
||||
winview(const Arg* arg){
|
||||
Window win, win_r, win_p, *win_c;
|
||||
unsigned nc;
|
||||
int unused;
|
||||
Client* c;
|
||||
Arg a;
|
||||
|
||||
if (!XGetInputFocus(dpy, &win, &unused)) return;
|
||||
while(XQueryTree(dpy, win, &win_r, &win_p, &win_c, &nc)
|
||||
&& win_p != win_r) win = win_p;
|
||||
|
||||
if (!(c = wintoclient(win))) return;
|
||||
|
||||
a.ui = c->tags;
|
||||
view(&a);
|
||||
}
|
||||
|
||||
/* by desgua */
|
||||
void
|
||||
gridall(const Arg *arg)
|
||||
{
|
||||
setlayout(&(Arg){.v = &layouts[3]});
|
||||
view(&(Arg){.ui = ~0});
|
||||
}
|
||||
|
||||
void
|
||||
winviewmono(const Arg *arg)
|
||||
{
|
||||
winview(&(Arg){0});
|
||||
setlayout(&(Arg){.v = &layouts[2]});
|
||||
}
|
||||
|
||||
/* There's no way to check accesses to destroyed windows, thus those cases are
|
||||
* ignored (especially on UnmapNotify's). Other types of errors call Xlibs
|
||||
* default error handler, which may call exit. */
|
||||
|
||||
Reference in New Issue
Block a user