diff options
Diffstat (limited to 'patches_huge/dwm-winicon-6.3-v2.1.diff')
-rw-r--r-- | patches_huge/dwm-winicon-6.3-v2.1.diff | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/patches_huge/dwm-winicon-6.3-v2.1.diff b/patches_huge/dwm-winicon-6.3-v2.1.diff index 4278431..dc19dcc 100644 --- a/patches_huge/dwm-winicon-6.3-v2.1.diff +++ b/patches_huge/dwm-winicon-6.3-v2.1.diff @@ -16,12 +16,12 @@ index b6eb7e0..f3c01b0 100644 --- a/config.mk +++ b/config.mk @@ -22,7 +22,7 @@ FREETYPEINC = /usr/include/freetype2 - + # includes and libs INCS = -I${X11INC} -I${FREETYPEINC} -LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} +LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} -lXrender -lImlib2 - + # flags CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} diff --git a/drw.c b/drw.c @@ -33,7 +33,7 @@ index 4cdbcbe..9b474c5 100644 #include <X11/Xlib.h> #include <X11/Xft/Xft.h> +#include <Imlib2.h> - + #include "drw.h" #include "util.h" @@ -71,6 +72,7 @@ drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h @@ -43,9 +43,9 @@ index 4cdbcbe..9b474c5 100644 + drw->picture = XRenderCreatePicture(dpy, drw->drawable, XRenderFindVisualFormat(dpy, DefaultVisual(dpy, screen)), 0, NULL); drw->gc = XCreateGC(dpy, root, 0, NULL); XSetLineAttributes(dpy, drw->gc, 1, LineSolid, CapButt, JoinMiter); - + @@ -85,14 +87,18 @@ drw_resize(Drw *drw, unsigned int w, unsigned int h) - + drw->w = w; drw->h = h; + if (drw->picture) @@ -55,7 +55,7 @@ index 4cdbcbe..9b474c5 100644 drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, DefaultDepth(drw->dpy, drw->screen)); + drw->picture = XRenderCreatePicture(drw->dpy, drw->drawable, XRenderFindVisualFormat(drw->dpy, DefaultVisual(drw->dpy, drw->screen)), 0, NULL); } - + void drw_free(Drw *drw) { @@ -66,7 +66,7 @@ index 4cdbcbe..9b474c5 100644 @@ -236,6 +242,67 @@ drw_setscheme(Drw *drw, Clr *scm) drw->scheme = scm; } - + +Picture +drw_picture_create_resized(Drw *drw, char *src, unsigned int srcw, unsigned int srch, unsigned int dstw, unsigned int dsth) { + Pixmap pm; @@ -134,7 +134,7 @@ index 4cdbcbe..9b474c5 100644 @@ -379,6 +446,14 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp return x + (render ? w : 0); } - + +void +drw_pic(Drw *drw, int x, int y, unsigned int w, unsigned int h, Picture pic) +{ @@ -161,14 +161,14 @@ index 4bcd5ad..71aefa2 100644 @@ -49,9 +50,12 @@ void drw_cur_free(Drw *drw, Cur *cursor); void drw_setfontset(Drw *drw, Fnt *set); void drw_setscheme(Drw *drw, Clr *scm); - + +Picture drw_picture_create_resized(Drw *drw, char *src, unsigned int src_w, unsigned int src_h, unsigned int dst_w, unsigned int dst_h); + /* Drawing functions */ void drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert); int drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert); +void drw_pic(Drw *drw, int x, int y, unsigned int w, unsigned int h, Picture pic); - + /* Map functions */ void drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h); diff --git a/dwm.c b/dwm.c @@ -238,7 +238,7 @@ index a96f33c..033ccec 100644 @@ -875,6 +882,67 @@ getatomprop(Client *c, Atom prop) return atom; } - + +static uint32_t prealpha(uint32_t p) { + uint8_t a = p >> 24u; + uint32_t rb = (a * (p & 0xFF00FFu)) >> 8u; @@ -253,9 +253,9 @@ index a96f33c..033ccec 100644 + unsigned long n, extra, *p = NULL; + Atom real; + -+ if (XGetWindowProperty(dpy, win, netatom[NetWMIcon], 0L, LONG_MAX, False, AnyPropertyType, ++ if (XGetWindowProperty(dpy, win, netatom[NetWMIcon], 0L, LONG_MAX, False, AnyPropertyType, + &real, &format, &n, &extra, (unsigned char **)&p) != Success) -+ return None; ++ return None; + if (n == 0 || format != 32) { XFree(p); return None; } + + unsigned long *bstp = NULL; @@ -306,7 +306,7 @@ index a96f33c..033ccec 100644 @@ -1034,6 +1102,7 @@ manage(Window w, XWindowAttributes *wa) c->h = c->oldh = wa->height; c->oldbw = wa->border_width; - + + updateicon(c); updatetitle(c); if (XGetTransientForHint(dpy, w, &trans) && (t = wintoclient(trans))) { @@ -334,7 +334,7 @@ index a96f33c..033ccec 100644 @@ -1752,6 +1827,15 @@ toggleview(const Arg *arg) } } - + +void +freeicon(Client *c) +{ @@ -348,7 +348,7 @@ index a96f33c..033ccec 100644 unfocus(Client *c, int setfocus) { @@ -1773,6 +1857,7 @@ unmanage(Client *c, int destroyed) - + detach(c); detachstack(c); + freeicon(c); @@ -358,7 +358,7 @@ index a96f33c..033ccec 100644 @@ -2007,6 +2092,13 @@ updatetitle(Client *c) strcpy(c->name, broken); } - + +void +updateicon(Client *c) +{ |