Adding README.md

This commit is contained in:
bakkeby
2019-09-05 00:32:39 +02:00
parent c34c536f3e
commit 2c9a889b22
8 changed files with 93 additions and 58 deletions

62
dwm.c
View File

@ -41,12 +41,7 @@
#endif /* XINERAMA */
#include <X11/Xft/Xft.h>
/* patch options */
#define ALPHA_PATCH 0
#include "patches.h"
#include "drw.h"
#include "util.h"
@ -63,10 +58,6 @@
#define TAGMASK ((1 << LENGTH(tags)) - 1)
#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
#if ALPHA_PATCH
#define OPAQUE 0xffU
#endif // ALPHA_PATCH
/* enums */
enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
enum { SchemeNorm, SchemeSel }; /* color schemes */
@ -242,9 +233,6 @@ static Monitor *wintomon(Window w);
static int xerror(Display *dpy, XErrorEvent *ee);
static int xerrordummy(Display *dpy, XErrorEvent *ee);
static int xerrorstart(Display *dpy, XErrorEvent *ee);
#if ALPHA_PATCH
static void xinitvisual();
#endif // ALPHA_PATCH
static void zoom(const Arg *arg);
/* variables */
@ -281,16 +269,13 @@ static Drw *drw;
static Monitor *mons, *selmon;
static Window root, wmcheckwin;
#if ALPHA_PATCH
static int useargb = 0;
static Visual *visual;
static int depth;
static Colormap cmap;
#endif // ALPHA_PATCH
#include "patch/include.h"
/* configuration, allows nested code to access above variables */
#include "config.h"
#include "patch/include.c"
/* compile-time check if all tags fit into an unsigned int bit array. */
struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
@ -2151,45 +2136,6 @@ xerrorstart(Display *dpy, XErrorEvent *ee)
return -1;
}
#if ALPHA_PATCH
void
xinitvisual()
{
XVisualInfo *infos;
XRenderPictFormat *fmt;
int nitems;
int i;
XVisualInfo tpl = {
.screen = screen,
.depth = 32,
.class = TrueColor
};
long masks = VisualScreenMask | VisualDepthMask | VisualClassMask;
infos = XGetVisualInfo(dpy, masks, &tpl, &nitems);
visual = NULL;
for(i = 0; i < nitems; i ++) {
fmt = XRenderFindVisualFormat(dpy, infos[i].visual);
if (fmt->type == PictTypeDirect && fmt->direct.alphaMask) {
visual = infos[i].visual;
depth = infos[i].depth;
cmap = XCreateColormap(dpy, root, visual, AllocNone);
useargb = 1;
break;
}
}
XFree(infos);
if (! visual) {
visual = DefaultVisual(dpy, screen);
depth = DefaultDepth(dpy, screen);
cmap = DefaultColormap(dpy, screen);
}
}
#endif // ALPHA_PATCH
void
zoom(const Arg *arg)
{