commit 20fd05a46c7bffdf54dcb1aa5cab16d824602186
parent da036081cd648a46b9779275c0b590d23b1c0664
Author: Stefan Mark <0mark@unserver.de>
Date: Wed, 25 Nov 2009 09:09:15 +0100
Trancparency update. Sorry for the double post. Patch file now links directly to svn.
Diffstat:
2 files changed, 2 insertions(+), 119 deletions(-)
diff --git a/dwm.suckless.org/patches/dwm-transparency.diff b/dwm.suckless.org/patches/dwm-transparency.diff
@@ -1,115 +0,0 @@
-diff -up -x '.*' ../../dwm-upstream/config.def.h ./config.def.h
---- ../../dwm-upstream/config.def.h 2009-11-10 00:08:09.000000000 +0100
-+++ ./config.def.h 2009-11-24 22:59:19.000000000 +0100
-@@ -10,6 +10,7 @@ static const char selbgcolor[] = "#
- static const char selfgcolor[] = "#ffffff";
- static const unsigned int borderpx = 1; /* border pixel of windows */
- static const unsigned int snap = 32; /* snap pixel */
-+static const double shade = 0.6; /* opacity of unfocussed clients */
- static const Bool showbar = True; /* False means no bar */
- static const Bool topbar = True; /* False means bottom bar */
-
-@@ -17,9 +18,10 @@ static const Bool topbar = Tr
- static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
-
- static const Rule rules[] = {
-- /* class instance title tags mask isfloating monitor */
-- { "Gimp", NULL, NULL, 0, True, -1 },
-- { "Firefox", NULL, NULL, 1 << 8, False, -1 },
-+ /* class instance title tags mask isfloating monitor opacity */
-+ { "Gimp", NULL, NULL, 0, True, -1, -1 },
-+ { "Firefox", NULL, NULL, 1 << 8, False, -1, -1 },
-+ { "URxvt", NULL, NULL, 0, False, -1, 0.95 },
- };
-
- /* layout(s) */
-diff -up -x '.*' ../../dwm-upstream/dwm.c ./dwm.c
---- ../../dwm-upstream/dwm.c 2009-11-10 00:08:09.000000000 +0100
-+++ ./dwm.c 2009-11-24 23:29:22.000000000 +0100
-@@ -57,7 +57,7 @@
- /* enums */
- enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
- enum { ColBorder, ColFG, ColBG, ColLast }; /* color */
--enum { NetSupported, NetWMName, NetLast }; /* EWMH atoms */
-+enum { NetSupported, NetWMName, NetWMWindowOpacity, NetLast }; /* EWMH atoms */
- enum { WMProtocols, WMDelete, WMState, WMLast }; /* default atoms */
- enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle,
- ClkClientWin, ClkRootWin, ClkLast }; /* clicks */
-@@ -91,6 +91,7 @@ struct Client {
- Client *snext;
- Monitor *mon;
- Window win;
-+ double opacity;
- };
-
- typedef struct {
-@@ -147,6 +148,7 @@ typedef struct {
- unsigned int tags;
- Bool isfloating;
- int monitor;
-+ double opacity;
- } Rule;
-
- /* function declarations */
-@@ -176,6 +178,7 @@ static void drawsquare(Bool filled, Bool
- static void drawtext(const char *text, unsigned long col[ColLast], Bool invert);
- static void enternotify(XEvent *e);
- static void expose(XEvent *e);
-+static void window_opacity_set(Client *c, double opacity);
- static void focus(Client *c);
- static void focusin(XEvent *e);
- static void focusmon(const Arg *arg);
-@@ -297,6 +300,7 @@ applyrules(Client *c) {
- && (!r->instance || strstr(instance, r->instance)))
- {
- c->isfloating = r->isfloating;
-+ c->opacity = r->opacity;
- c->tags |= r->tags;
- for(m = mons; m && m->num != r->monitor; m = m->next);
- if(m)
-@@ -811,7 +815,20 @@ expose(XEvent *e) {
- }
-
- void
-+window_opacity_set(Client *c, double opacity)
-+{
-+ if(opacity >= 0 && opacity <= 1)
-+ {
-+ unsigned long real_opacity[] = { opacity * 0xffffffff };
-+ XChangeProperty(dpy, c->win, netatom[NetWMWindowOpacity], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)real_opacity, 1);
-+ }
-+ else
-+ XDeleteProperty(dpy, c->win, netatom[NetWMWindowOpacity]);
-+}
-+
-+void
- focus(Client *c) {
-+ if(selmon->sel) window_opacity_set(selmon->sel, shade);
- if(!c || !ISVISIBLE(c))
- for(c = selmon->stack; c && !ISVISIBLE(c); c = c->snext);
- if(selmon->sel)
-@@ -831,6 +848,7 @@ focus(Client *c) {
- XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
- selmon->sel = c;
- drawbars();
-+ if(c) window_opacity_set(c, c->opacity);
- }
-
- void
-@@ -1100,6 +1118,7 @@ manage(Window w, XWindowAttributes *wa)
- updatetitle(c);
- if(XGetTransientForHint(dpy, w, &trans))
- t = wintoclient(trans);
-+ c->opacity=-1;
- if(t) {
- c->mon = t->mon;
- c->tags = t->tags;
-@@ -1493,6 +1512,7 @@ setup(void) {
- wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False);
- netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False);
- netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False);
-+ netatom[NetWMWindowOpacity] = XInternAtom(dpy, "_NET_WM_WINDOW_OPACITY", False);
- /* init cursors */
- cursor[CurNormal] = XCreateFontCursor(dpy, XC_left_ptr);
- cursor[CurResize] = XCreateFontCursor(dpy, XC_sizing);
-Nur in ./: transp.diff.
diff --git a/dwm.suckless.org/patches/transparency.md b/dwm.suckless.org/patches/transparency.md
@@ -4,13 +4,11 @@
This patch provides rudimentary experimentel transparency (xcompmgr needed).
Opacity is set for every not focused client, and also for focused client
-when a rule is found.
-
-This patch is very experimental. There are Bugs.
+when a rule is found. There may be Bugs. A lot of them. Creeeeepy!
## Download
- * [dwm-transparency.diff](dwm-transparency.diff) (dwm 5.7.2) (20091124)
+ * [http://0mark.unserver.de/dwm-sprinkles/export/31/trunk/patches/dwm-transparency.diff](dwm-transparency.diff) latest transparency patch
## Author