vene files and dwm changes
This commit is contained in:
@@ -186,7 +186,6 @@ static void movemouse(const Arg *arg);
|
||||
static Client *nexttiled(Client *c);
|
||||
static void pop(Client *c);
|
||||
static void propertynotify(XEvent *e);
|
||||
static void quit(const Arg *arg);
|
||||
static Monitor *recttomon(int x, int y, int w, int h);
|
||||
static void resize(Client *c, int x, int y, int w, int h, int interact);
|
||||
static void resizeclient(Client *c, int x, int y, int w, int h);
|
||||
@@ -221,11 +220,11 @@ static void updateclientlist(void);
|
||||
static int updategeom(void);
|
||||
static void updatenumlockmask(void);
|
||||
static void updatesizehints(Client *c);
|
||||
static void updatestatus(void);
|
||||
void updatestatus(void);
|
||||
static void updatetitle(Client *c);
|
||||
static void updatewindowtype(Client *c);
|
||||
static void updatewmhints(Client *c);
|
||||
static void view(const Arg *arg);
|
||||
void view(const Arg *arg);
|
||||
static Client *wintoclient(Window w);
|
||||
static Monitor *wintomon(Window w);
|
||||
static int xerror(Display *dpy, XErrorEvent *ee);
|
||||
@@ -259,7 +258,6 @@ static void (*handler[LASTEvent]) (XEvent *) = {
|
||||
[UnmapNotify] = unmapnotify
|
||||
};
|
||||
static Atom wmatom[WMLast], netatom[NetLast];
|
||||
static int running = 1;
|
||||
static Cur *cursor[CurLast];
|
||||
static Clr **scheme;
|
||||
static Display *dpy;
|
||||
@@ -268,6 +266,7 @@ static Monitor *mons, *selmon;
|
||||
static Window root, wmcheckwin;
|
||||
|
||||
/* configuration, allows nested code to access above variables */
|
||||
#include "vene.h"
|
||||
#include "config.h"
|
||||
|
||||
/* compile-time check if all tags fit into an unsigned int bit array. */
|
||||
@@ -527,6 +526,9 @@ clientmessage(XEvent *e)
|
||||
} else if (cme->message_type == netatom[NetActiveWindow]) {
|
||||
if (c != selmon->sel && !c->isurgent)
|
||||
seturgent(c, 1);
|
||||
|
||||
const Arg tag = {.ui = c->tags}; /* switch to show highlighted window*/
|
||||
view(&tag);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1225,9 +1227,8 @@ propertynotify(XEvent *e)
|
||||
Window trans;
|
||||
XPropertyEvent *ev = &e->xproperty;
|
||||
|
||||
if ((ev->window == root) && (ev->atom == XA_WM_NAME))
|
||||
updatestatus();
|
||||
else if (ev->state == PropertyDelete)
|
||||
|
||||
if (ev->state == PropertyDelete)
|
||||
return; /* ignore */
|
||||
else if ((c = wintoclient(ev->window))) {
|
||||
switch(ev->atom) {
|
||||
@@ -1255,12 +1256,6 @@ propertynotify(XEvent *e)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
quit(const Arg *arg)
|
||||
{
|
||||
running = 0;
|
||||
}
|
||||
|
||||
Monitor *
|
||||
recttomon(int x, int y, int w, int h)
|
||||
{
|
||||
@@ -1385,9 +1380,13 @@ run(void)
|
||||
XEvent ev;
|
||||
/* main event loop */
|
||||
XSync(dpy, False);
|
||||
while (running && !XNextEvent(dpy, &ev))
|
||||
while (!XNextEvent(dpy, &ev))
|
||||
{
|
||||
if (handler[ev.type])
|
||||
handler[ev.type](&ev); /* call handler */
|
||||
|
||||
vene_run();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1539,6 +1538,8 @@ setmfact(const Arg *arg)
|
||||
void
|
||||
setup(void)
|
||||
{
|
||||
vene_setup();
|
||||
|
||||
int i;
|
||||
XSetWindowAttributes wa;
|
||||
Atom utf8string;
|
||||
@@ -1649,8 +1650,6 @@ spawn(const Arg *arg)
|
||||
{
|
||||
struct sigaction sa;
|
||||
|
||||
if (arg->v == dmenucmd)
|
||||
dmenumon[0] = '0' + selmon->num;
|
||||
if (fork() == 0) {
|
||||
if (dpy)
|
||||
close(ConnectionNumber(dpy));
|
||||
@@ -1662,7 +1661,6 @@ spawn(const Arg *arg)
|
||||
sigaction(SIGCHLD, &sa, NULL);
|
||||
|
||||
execvp(((char **)arg->v)[0], (char **)arg->v);
|
||||
die("dwm: execvp '%s' failed:", ((char **)arg->v)[0]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2005,8 +2003,8 @@ updatesizehints(Client *c)
|
||||
void
|
||||
updatestatus(void)
|
||||
{
|
||||
if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext)))
|
||||
strcpy(stext, "dwm-"VERSION);
|
||||
vene_updatestatus(stext);
|
||||
|
||||
drawbar(selmon);
|
||||
}
|
||||
|
||||
@@ -2143,10 +2141,6 @@ zoom(const Arg *arg)
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
if (argc == 2 && !strcmp("-v", argv[1]))
|
||||
die("dwm-"VERSION);
|
||||
else if (argc != 1)
|
||||
die("usage: dwm [-v]");
|
||||
if (!setlocale(LC_CTYPE, "") || !XSupportsLocale())
|
||||
fputs("warning: no locale support\n", stderr);
|
||||
if (!(dpy = XOpenDisplay(NULL)))
|
||||
|
||||
Reference in New Issue
Block a user