[wiki] [sites] update systray patches to redraw the background properly || Jan Christoph Ebersbach
commit 8ac37c03d73c522293441f12fc9213b8e40fafaf
Author: Jan Christoph Ebersbach <jceb_AT_e-jc.de>
Date: Sat Feb 16 13:13:47 2013 +0100
update systray patches to redraw the background properly
diff --git a/dwm.suckless.org/patches/dwm-6.0-systray.diff b/dwm.suckless.org/patches/dwm-6.0-systray.diff
index 663d7dc..f20d31e 100644
--- a/dwm.suckless.org/patches/dwm-6.0-systray.diff
+++ b/dwm.suckless.org/patches/dwm-6.0-systray.diff
_AT_@ -143,7 +143,7 @@ diff -r ec4baab78314 dwm.c
XSync(dpy, False);
XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime);
}
-_AT_@ -530,9 +571,48 @@
+_AT_@ -530,9 +572,49 @@
void
clientmessage(XEvent *e) {
_AT_@ -177,7 +177,8 @@ diff -r ec4baab78314 dwm.c
+ XReparentWindow(dpy, c->win, systray->win, 0, 0);
+ /* use parents background pixmap */
+ swa.background_pixmap = ParentRelative;
-+ XChangeWindowAttributes(dpy, c->win, CWBackPixmap, &swa);
++ swa.background_pixel = dc.norm[ColBG];
++ XChangeWindowAttributes(dpy, c->win, CWBackPixmap|CWBackPixel, &swa);
+ sendevent(c->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_EMBEDDED_NOTIFY, 0 , systray->win, XEMBED_EMBEDDED_VERSION);
+ /* FIXME not sure if I have to send these events, too */
+ sendevent(c->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_FOCUS_IN, 0 , systray->win, XEMBED_EMBEDDED_VERSION);
_AT_@ -499,7 +500,7 @@ diff -r ec4baab78314 dwm.c
CopyFromParent, DefaultVisual(dpy, screen),
CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa);
XDefineCursor(dpy, m->barwin, cursor[CurNormal]);
-_AT_@ -2011,6 +2205,104 @@
+_AT_@ -2011,6 +2208,107 @@
}
void
_AT_@ -597,6 +598,9 @@ diff -r ec4baab78314 dwm.c
+ w = w ? w + systrayspacing : 1;
+ x -= w;
+ XMoveResizeWindow(dpy, systray->win, x, selmon->by, w, bh);
++ /* redraw background */
++ XSetForeground(dpy, dc.gc, dc.norm[ColBG]);
++ XFillRectangle(dpy, systray->win, dc.gc, 0, 0, w, bh);
+ XSync(dpy, False);
+}
+
diff --git a/dwm.suckless.org/patches/dwm-c794a9f5ae5e-systray.diff b/dwm.suckless.org/patches/dwm-c794a9f5ae5e-systray.diff
index 1c5224b..4afe14e 100644
--- a/dwm.suckless.org/patches/dwm-c794a9f5ae5e-systray.diff
+++ b/dwm.suckless.org/patches/dwm-c794a9f5ae5e-systray.diff
_AT_@ -143,7 +143,7 @@ diff -r c794a9f5ae5e dwm.c
XSync(dpy, False);
XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime);
XDeleteProperty(dpy, root, netatom[NetActiveWindow]);
-_AT_@ -533,9 +574,48 @@
+_AT_@ -533,9 +575,49 @@
void
clientmessage(XEvent *e) {
_AT_@ -177,7 +177,8 @@ diff -r c794a9f5ae5e dwm.c
+ XReparentWindow(dpy, c->win, systray->win, 0, 0);
+ /* use parents background pixmap */
+ swa.background_pixmap = ParentRelative;
-+ XChangeWindowAttributes(dpy, c->win, CWBackPixmap, &swa);
++ swa.background_pixel = dc.norm[ColBG];
++ XChangeWindowAttributes(dpy, c->win, CWBackPixmap|CWBackPixel, &swa);
+ sendevent(c->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_EMBEDDED_NOTIFY, 0 , systray->win, XEMBED_EMBEDDED_VERSION);
+ /* FIXME not sure if I have to send these events, too */
+ sendevent(c->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_FOCUS_IN, 0 , systray->win, XEMBED_EMBEDDED_VERSION);
_AT_@ -506,7 +507,7 @@ diff -r c794a9f5ae5e dwm.c
XMapRaised(dpy, m->barwin);
}
}
-_AT_@ -2051,6 +2247,104 @@
+_AT_@ -2051,6 +2250,107 @@
}
void
_AT_@ -604,6 +605,9 @@ diff -r c794a9f5ae5e dwm.c
+ w = w ? w + systrayspacing : 1;
+ x -= w;
+ XMoveResizeWindow(dpy, systray->win, x, selmon->by, w, bh);
++ /* redraw background */
++ XSetForeground(dpy, dc.gc, dc.norm[ColBG]);
++ XFillRectangle(dpy, systray->win, dc.gc, 0, 0, w, bh);
+ XSync(dpy, False);
+}
+
Received on Sat Feb 16 2013 - 13:14:08 CET
This archive was generated by hypermail 2.3.0
: Thu Feb 21 2013 - 19:27:17 CET