sites

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 0a5fe8620b8f7657582ec6cdf28e778e6515e5ed
parent ee822c9ee09153801a986f99c69b297342f9127b
Author: xulfer <xulfer@cheapbsd.net>
Date:   Thu,  5 Apr 2012 12:15:12 -0500

Updated systray patch to apply cleanly with 6.0.
Diffstat:
Mdwm.suckless.org/patches/dwm-6.0-systray.diff | 141++++++++++++++++++++++++++++++++++++++++++++-----------------------------------
Mdwm.suckless.org/patches/systray.md | 2+-
2 files changed, 80 insertions(+), 63 deletions(-)

diff --git a/dwm.suckless.org/patches/dwm-6.0-systray.diff b/dwm.suckless.org/patches/dwm-6.0-systray.diff @@ -1,27 +1,45 @@ -Author: Jan Christoph Ebersbach <jceb@e-jc.de>, inspired by http://code.google.com/p/dwm-plus -URL: http://dwm.suckless.org/patches/systray -Implements a system tray for dwm. - -diff -r 10e232f9ace7 config.def.h ---- a/config.def.h Sun Mar 25 17:49:35 2012 +0200 -+++ b/config.def.h Wed Apr 04 22:18:50 2012 +0200 -@@ -10,6 +10,8 @@ - static const char selfgcolor[] = "#eeeeee"; - static const unsigned int borderpx = 1; /* border pixel of windows */ - static const unsigned int snap = 32; /* snap pixel */ -+static const unsigned int systrayspacing = 2; /* systray spacing */ -+static const Bool showsystray = True; /* False means no systray */ - static const Bool showbar = True; /* False means no bar */ - static const Bool topbar = True; /* False means bottom bar */ +diff -rupN dwm-6.0/config.def.h dwm/config.def.h +--- dwm-6.0/config.def.h 2011-12-19 09:02:46.000000000 -0600 ++++ dwm/config.def.h 2012-04-04 22:04:37.895074163 -0500 +@@ -1,17 +1,19 @@ + /* See LICENSE file for copyright and license details. */ -diff -r 10e232f9ace7 dwm.c ---- a/dwm.c Sun Mar 25 17:49:35 2012 +0200 -+++ b/dwm.c Wed Apr 04 22:18:50 2012 +0200 -@@ -55,12 +55,30 @@ + /* appearance */ +-static const char font[] = "-*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*"; +-static const char normbordercolor[] = "#444444"; +-static const char normbgcolor[] = "#222222"; +-static const char normfgcolor[] = "#bbbbbb"; +-static const char selbordercolor[] = "#005577"; +-static const char selbgcolor[] = "#005577"; +-static const char selfgcolor[] = "#eeeeee"; +-static const unsigned int borderpx = 1; /* border pixel of windows */ +-static const unsigned int snap = 32; /* snap pixel */ +-static const Bool showbar = True; /* False means no bar */ +-static const Bool topbar = True; /* False means bottom bar */ ++static const char font[] = "-*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*"; ++static const char normbordercolor[] = "#444444"; ++static const char normbgcolor[] = "#222222"; ++static const char normfgcolor[] = "#bbbbbb"; ++static const char selbordercolor[] = "#005577"; ++static const char selbgcolor[] = "#005577"; ++static const char selfgcolor[] = "#eeeeee"; ++static const unsigned int borderpx = 1; /* border pixel of windows */ ++static const unsigned int systrayspacing = 2; /* systray spacing */ ++static const Bool showsystray = True; ++static const unsigned int snap = 32; /* snap pixel */ ++static const Bool showbar = True; /* False means no bar */ ++static const Bool topbar = True; /* False means bottom bar */ + + /* tagging */ + static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; +diff -rupN dwm-6.0/dwm.c dwm/dwm.c +--- dwm-6.0/dwm.c 2011-12-19 09:02:46.000000000 -0600 ++++ dwm/dwm.c 2012-04-04 22:02:49.605076986 -0500 +@@ -54,13 +54,30 @@ + #define HEIGHT(X) ((X)->h + 2 * (X)->bw) #define TAGMASK ((1 << LENGTH(tags)) - 1) #define TEXTW(X) (textnw(X, strlen(X)) + dc.font.height) - -+#define SYSTEM_TRAY_REQUEST_DOCK 0 ++#define SYSTEM_TRAY_REQUEST_DOCK 0 +#define _NET_SYSTEM_TRAY_ORIENTATION_HORZ 0 + +/* XEMBED messages */ @@ -37,13 +55,13 @@ diff -r 10e232f9ace7 dwm.c +#define VERSION_MAJOR 0 +#define VERSION_MINOR 0 +#define XEMBED_EMBEDDED_VERSION (VERSION_MAJOR << 16) | VERSION_MINOR -+ + /* enums */ enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ enum { ColBorder, ColFG, ColBG, ColLast }; /* color */ -enum { NetSupported, NetWMName, NetWMState, - NetWMFullscreen, NetActiveWindow, NetWMWindowType, -- NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */ +- NetWMWindowTypeDialog, NetLast }; /* EWMH atoms */ +enum { NetSupported, NetSystemTray, NetSystemTrayOP, NetSystemTrayOrientation, + NetWMName, NetWMState, NetWMFullscreen, NetActiveWindow, NetWMWindowType, + NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */ @@ -51,7 +69,7 @@ diff -r 10e232f9ace7 dwm.c enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */ enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, ClkRootWin, ClkLast }; /* clicks */ -@@ -154,6 +172,12 @@ +@@ -154,6 +171,12 @@ typedef struct { int monitor; } Rule; @@ -64,7 +82,7 @@ diff -r 10e232f9ace7 dwm.c /* function declarations */ static void applyrules(Client *c); static Bool applysizehints(Client *c, int *x, int *y, int *w, int *h, Bool interact); -@@ -186,9 +210,11 @@ +@@ -186,9 +209,11 @@ static void focus(Client *c); static void focusin(XEvent *e); static void focusmon(const Arg *arg); static void focusstack(const Arg *arg); @@ -76,7 +94,7 @@ diff -r 10e232f9ace7 dwm.c static Bool gettextprop(Window w, Atom atom, char *text, unsigned int size); static void grabbuttons(Client *c, Bool focused); static void grabkeys(void); -@@ -207,13 +233,16 @@ +@@ -207,13 +232,16 @@ static void pop(Client *); static void propertynotify(XEvent *e); static void quit(const Arg *arg); static Monitor *recttomon(int x, int y, int w, int h); @@ -94,7 +112,7 @@ diff -r 10e232f9ace7 dwm.c static void sendmon(Client *c, Monitor *m); static void setclientstate(Client *c, long state); static void setfocus(Client *c); -@@ -242,18 +271,24 @@ +@@ -241,18 +269,24 @@ static void updatebars(void); static void updatenumlockmask(void); static void updatesizehints(Client *c); static void updatestatus(void); @@ -119,7 +137,7 @@ diff -r 10e232f9ace7 dwm.c static const char broken[] = "broken"; static char stext[256]; static int screen; -@@ -275,9 +310,10 @@ +@@ -274,9 +308,10 @@ static void (*handler[LASTEvent]) (XEven [MapRequest] = maprequest, [MotionNotify] = motionnotify, [PropertyNotify] = propertynotify, @@ -131,7 +149,7 @@ diff -r 10e232f9ace7 dwm.c static Bool running = True; static Cursor cursor[CurLast]; static Display *dpy; -@@ -498,6 +534,11 @@ +@@ -497,6 +532,11 @@ cleanup(void) { XFreeCursor(dpy, cursor[CurMove]); while(mons) cleanupmon(mons); @@ -142,8 +160,8 @@ diff -r 10e232f9ace7 dwm.c + } XSync(dpy, False); XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime); - XDeleteProperty(dpy, root, netatom[NetActiveWindow]); -@@ -532,9 +573,48 @@ + } +@@ -530,9 +570,48 @@ clearurgent(Client *c) { void clientmessage(XEvent *e) { @@ -192,7 +210,7 @@ diff -r 10e232f9ace7 dwm.c if(!c) return; if(cme->message_type == netatom[NetWMState]) { -@@ -585,7 +665,7 @@ +@@ -583,7 +662,7 @@ configurenotify(XEvent *e) { dc.drawable = XCreatePixmap(dpy, root, sw, bh, DefaultDepth(dpy, screen)); updatebars(); for(m = mons; m; m = m->next) @@ -201,7 +219,7 @@ diff -r 10e232f9ace7 dwm.c focus(NULL); arrange(NULL); } -@@ -669,6 +749,11 @@ +@@ -667,6 +746,11 @@ destroynotify(XEvent *e) { if((c = wintoclient(ev->window))) unmanage(c, True); @@ -213,7 +231,7 @@ diff -r 10e232f9ace7 dwm.c } void -@@ -724,6 +809,7 @@ +@@ -722,6 +806,7 @@ drawbar(Monitor *m) { unsigned long *col; Client *c; @@ -221,7 +239,7 @@ diff -r 10e232f9ace7 dwm.c for(c = m->clients; c; c = c->next) { occ |= c->tags; if(c->isurgent) -@@ -745,6 +831,9 @@ +@@ -743,6 +828,9 @@ drawbar(Monitor *m) { if(m == selmon) { /* status is only drawn on selected monitor */ dc.w = TEXTW(stext); dc.x = m->ww - dc.w; @@ -231,7 +249,7 @@ diff -r 10e232f9ace7 dwm.c if(dc.x < x) { dc.x = x; dc.w = m->ww - x; -@@ -773,6 +862,7 @@ +@@ -771,6 +859,7 @@ drawbars(void) { for(m = mons; m; m = m->next) drawbar(m); @@ -239,7 +257,7 @@ diff -r 10e232f9ace7 dwm.c } void -@@ -921,10 +1011,17 @@ +@@ -917,10 +1006,17 @@ getatomprop(Client *c, Atom prop) { unsigned long dl; unsigned char *p = NULL; Atom da, atom = None; @@ -258,7 +276,7 @@ diff -r 10e232f9ace7 dwm.c XFree(p); } return atom; -@@ -966,6 +1063,15 @@ +@@ -962,6 +1058,16 @@ getstate(Window w) { return result; } @@ -271,10 +289,11 @@ diff -r 10e232f9ace7 dwm.c + return w ? w + systrayspacing : 1; +} + ++ Bool gettextprop(Window w, Atom atom, char *text, unsigned int size) { char **list = NULL; -@@ -1100,7 +1206,7 @@ +@@ -1096,7 +1202,7 @@ void killclient(const Arg *arg) { if(!selmon->sel) return; @@ -283,7 +302,7 @@ diff -r 10e232f9ace7 dwm.c XGrabServer(dpy); XSetErrorHandler(xerrordummy); XSetCloseDownMode(dpy, DestroyAll); -@@ -1186,6 +1292,12 @@ +@@ -1180,6 +1286,12 @@ void maprequest(XEvent *e) { static XWindowAttributes wa; XMapRequestEvent *ev = &e->xmaprequest; @@ -296,7 +315,7 @@ diff -r 10e232f9ace7 dwm.c if(!XGetWindowAttributes(dpy, ev->window, &wa)) return; -@@ -1303,6 +1415,16 @@ +@@ -1293,6 +1405,16 @@ propertynotify(XEvent *e) { Window trans; XPropertyEvent *ev = &e->xproperty; @@ -313,7 +332,7 @@ diff -r 10e232f9ace7 dwm.c if((ev->window == root) && (ev->atom == XA_WM_NAME)) updatestatus(); else if(ev->state == PropertyDelete) -@@ -1352,12 +1474,33 @@ +@@ -1342,12 +1464,34 @@ recttomon(int x, int y, int w, int h) { } void @@ -329,6 +348,7 @@ diff -r 10e232f9ace7 dwm.c +} + + ++ +void resize(Client *c, int x, int y, int w, int h, Bool interact) { if(applysizehints(c, &x, &y, &w, &h, interact)) @@ -347,7 +367,7 @@ diff -r 10e232f9ace7 dwm.c resizeclient(Client *c, int x, int y, int w, int h) { XWindowChanges wc; -@@ -1425,6 +1568,18 @@ +@@ -1412,6 +1556,18 @@ resizemouse(const Arg *arg) { } void @@ -366,7 +386,7 @@ diff -r 10e232f9ace7 dwm.c restack(Monitor *m) { Client *c; XEvent ev; -@@ -1508,25 +1663,35 @@ +@@ -1495,25 +1651,35 @@ setclientstate(Client *c, long state) { } Bool @@ -398,12 +418,12 @@ diff -r 10e232f9ace7 dwm.c ev.type = ClientMessage; - ev.xclient.window = c->win; - ev.xclient.message_type = wmatom[WMProtocols]; -+ ev.xclient.window = w; -+ ev.xclient.message_type = mt; ev.xclient.format = 32; - ev.xclient.data.l[0] = proto; - ev.xclient.data.l[1] = CurrentTime; - XSendEvent(dpy, c->win, False, NoEventMask, &ev); ++ ev.xclient.window = w; ++ ev.xclient.message_type = mt; + ev.xclient.data.l[0] = d0; + ev.xclient.data.l[1] = d1; + ev.xclient.data.l[2] = d2; @@ -413,16 +433,16 @@ diff -r 10e232f9ace7 dwm.c } return exists; } -@@ -1539,7 +1704,7 @@ - XA_WINDOW, 32, PropModeReplace, - (unsigned char *) &(c->win), 1); - } +@@ -1522,7 +1688,7 @@ void + setfocus(Client *c) { + if(!c->neverfocus) + XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); - sendevent(c, wmatom[WMTakeFocus]); + sendevent(c->win, wmatom[WMTakeFocus], NoEventMask, wmatom[WMTakeFocus], CurrentTime, 0, 0, 0); } void -@@ -1619,12 +1784,18 @@ +@@ -1602,11 +1768,17 @@ setup(void) { wmatom[WMTakeFocus] = XInternAtom(dpy, "WM_TAKE_FOCUS", False); netatom[NetActiveWindow] = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False); netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False); @@ -434,14 +454,13 @@ diff -r 10e232f9ace7 dwm.c netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False); netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False); netatom[NetWMWindowTypeDialog] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False); - netatom[NetClientList] = XInternAtom(dpy, "_NET_CLIENT_LIST", False); + xatom[Manager] = XInternAtom(dpy, "MANAGER", False); + xatom[Xembed] = XInternAtom(dpy, "_XEMBED", False); + xatom[XembedInfo] = XInternAtom(dpy, "_XEMBED_INFO", False); /* init cursors */ cursor[CurNormal] = XCreateFontCursor(dpy, XC_left_ptr); cursor[CurResize] = XCreateFontCursor(dpy, XC_sizing); -@@ -1641,6 +1812,8 @@ +@@ -1623,6 +1795,8 @@ setup(void) { XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter); if(!dc.font.set) XSetFont(dpy, dc.gc, dc.font.xfont->fid); @@ -450,7 +469,7 @@ diff -r 10e232f9ace7 dwm.c /* init bars */ updatebars(); updatestatus(); -@@ -1750,7 +1923,18 @@ +@@ -1731,7 +1905,18 @@ void togglebar(const Arg *arg) { selmon->showbar = !selmon->showbar; updatebarpos(selmon); @@ -470,7 +489,7 @@ diff -r 10e232f9ace7 dwm.c arrange(selmon); } -@@ -1840,11 +2024,18 @@ +@@ -1816,10 +2001,16 @@ unmapnotify(XEvent *e) { else unmanage(c, False); } @@ -485,14 +504,12 @@ diff -r 10e232f9ace7 dwm.c updatebars(void) { + unsigned int w; Monitor *m; -+ XSetWindowAttributes wa = { .override_redirect = True, - .background_pixmap = ParentRelative, -@@ -1853,7 +2044,10 @@ +@@ -1827,7 +2018,10 @@ updatebars(void) { + .event_mask = ButtonPressMask|ExposureMask + }; for(m = mons; m; m = m->next) { - if (m->barwin) - continue; - m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, DefaultDepth(dpy, screen), + w = m->ww; + if(showsystray && m == selmon) @@ -501,7 +518,7 @@ diff -r 10e232f9ace7 dwm.c CopyFromParent, DefaultVisual(dpy, screen), CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa); XDefineCursor(dpy, m->barwin, cursor[CurNormal]); -@@ -2050,6 +2244,104 @@ +@@ -2011,6 +2205,104 @@ updatestatus(void) { } void @@ -606,7 +623,7 @@ diff -r 10e232f9ace7 dwm.c updatewindowtype(Client *c) { Atom state = getatomprop(c, netatom[NetWMState]); Atom wtype = getatomprop(c, netatom[NetWMWindowType]); -@@ -2118,6 +2410,16 @@ +@@ -2080,6 +2372,16 @@ wintomon(Window w) { return selmon; } diff --git a/dwm.suckless.org/patches/systray.md b/dwm.suckless.org/patches/systray.md @@ -8,7 +8,7 @@ is following the selected monitor. Download -------- -* [dwm-6.0-systray.diff](dwm-6.0-systray.diff) (18K) (20120404) +* [dwm-6.0-systray.diff](dwm-6.0-systray.diff) (20K) (20120405) Author ------