sites

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

commit 494e7e9d2d449e4508c542a40565bf46c83e22c1
parent 37ae5064b96234cf56167193b33924b068002f3f
Author: Wolfgang E. Sanyer <ezzieyguywuf@gmail.com>
Date:   Mon, 13 Dec 2010 08:37:11 -0500

Added new patch to dwm site.

My md file provides a pretty thorough description of the patch. Feel free to
email with any questions.
Diffstat:
Adwm.suckless.org/patches/current_desktop.md | 30++++++++++++++++++++++++++++++
Adwm.suckless.org/patches/dwm-5.8.2-current_desktop.patch | 109+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 139 insertions(+), 0 deletions(-)

diff --git a/dwm.suckless.org/patches/current_desktop.md b/dwm.suckless.org/patches/current_desktop.md @@ -0,0 +1,30 @@ +# FOCUSONCLICK + +## Description + + Sets _NET_NUMBER_OF_DESKTOPS and _NET_CURRENT_DESKTOP on root to appropriate + values. Note that 'appropriate' for these values don't make sense as xprop + -root output, since dwm uses them at bitwise but xprop displays them in base + ten. In other words, if you have 4 desktops, _NET_NUMBER_OF_DESKTOPS is actualy + 0b1111 but xprop displays this as 15. I'm ok with this, because the end-user + (program, script, w/e) can always parse this appropriately. The same goes for + _NET_CURRENT_DESKTOP: if you have desktops 1 and 3 selected, the value is + 0b1010, but xprop shows this as 10. This isn't a problem. + + I should note that in this case, _NET_NUMBER_OF_DESKTOPS does not exactly + conform to EWMH specifications: in reality, there are many more 'desktops' than + 15 (in the above example), as any combination of 1, 2, 3 or 4 of the availables + tags can be considered one desktop. _CURRENT_DESKTOP will, however, always be + less that _NET_NUMBER_OF_DESKTOPS, so I'm happy with that. + + I wrote this patch mainly for myself, as I have a script for tabbed that uses + it (I will upload this later). I am open to feedback/contstructive criticism. + Email is at the bottom. + +## Download + + * [dwm-5.8.2-current_desktop.diff](dwm-5.8.2-current_desktop.diff) (dwm 2010604) + +## Author + + * Wolfgang S. - ezzieyguywuf at gmail period com diff --git a/dwm.suckless.org/patches/dwm-5.8.2-current_desktop.patch b/dwm.suckless.org/patches/dwm-5.8.2-current_desktop.patch @@ -0,0 +1,109 @@ +diff -r 23b71491e149 dwm.c +--- a/dwm.c Thu Dec 02 10:16:47 2010 +0000 ++++ b/dwm.c Mon Dec 13 08:18:03 2010 -0500 +@@ -57,8 +57,8 @@ + /* enums */ + enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ + enum { ColBorder, ColFG, ColBG, ColLast }; /* color */ +-enum { NetSupported, NetWMName, NetWMState, +- NetWMFullscreen, NetLast }; /* EWMH atoms */ ++enum { NetSupported, NetWMName, NetWMState, NetWMFullscreen, ++ NetNumberOfDesktops, NetCurrentDesktop, NetLast }; /* EWMH atoms */ + enum { WMProtocols, WMDelete, WMState, WMLast }; /* default atoms */ + enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, + ClkClientWin, ClkRootWin, ClkLast }; /* clicks */ +@@ -212,6 +212,7 @@ + static void setclientstate(Client *c, long state); + static void setlayout(const Arg *arg); + static void setmfact(const Arg *arg); ++static void setnumbdesktops(void); + static void setup(void); + static void showhide(Client *c); + static void sigchld(int unused); +@@ -227,6 +228,7 @@ + static void unfocus(Client *c, Bool setfocus); + static void unmanage(Client *c, Bool destroyed); + static void unmapnotify(XEvent *e); ++static void updatecurrenddesktop(void); + static Bool updategeom(void); + static void updatebarpos(Monitor *m); + static void updatebars(void); +@@ -1467,6 +1469,13 @@ + } + + void ++setcurrentdesktop(void){ ++ long data[] = { 0 }; ++ XChangeProperty(dpy, root, netatom[NetCurrentDesktop], XA_CARDINAL, 32, ++ PropModeReplace, (unsigned char *)data, 1); ++} ++ ++void + setclientstate(Client *c, long state) { + long data[] = { state, None }; + +@@ -1502,6 +1511,13 @@ + } + + void ++setnumbdesktops(void){ ++ long data[] = { TAGMASK }; ++ XChangeProperty(dpy, root, netatom[NetNumberOfDesktops], XA_CARDINAL, 32, ++ PropModeReplace, (unsigned char *)data, 1); ++} ++ ++void + setup(void) { + XSetWindowAttributes wa; + +@@ -1524,6 +1540,8 @@ + netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False); + netatom[NetWMState] = XInternAtom(dpy, "_NET_WM_STATE", False); + netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False); ++ netatom[NetNumberOfDesktops] = XInternAtom(dpy, "_NET_NUMBER_OF_DESKTOPS", False); ++ netatom[NetCurrentDesktop] = XInternAtom(dpy, "_NET_CURRENT_DESKTOP", False); + /* init cursors */ + cursor[CurNormal] = XCreateFontCursor(dpy, XC_left_ptr); + cursor[CurResize] = XCreateFontCursor(dpy, XC_sizing); +@@ -1546,6 +1564,10 @@ + /* EWMH support per view */ + XChangeProperty(dpy, root, netatom[NetSupported], XA_ATOM, 32, + PropModeReplace, (unsigned char *) netatom, NetLast); ++ /* set EWMH NUMBER_OF_DESKTOPS */ ++ setnumbdesktops(); ++ /* initialize EWMH CURRENT_DESKTOP */ ++ setcurrentdesktop(); + /* select for events */ + wa.cursor = cursor[CurNormal]; + wa.event_mask = SubstructureRedirectMask|SubstructureNotifyMask|ButtonPressMask +@@ -1688,6 +1710,7 @@ + selmon->tagset[selmon->seltags] = newtagset; + arrange(selmon); + } ++ updatecurrenddesktop(); + } + + void +@@ -1763,6 +1786,14 @@ + m->by = -bh; + } + ++void ++updatecurrenddesktop(){ ++ long data[] = { selmon->tagset[selmon->seltags] }; ++ ++ XChangeProperty(dpy, root, netatom[NetCurrentDesktop], XA_CARDINAL, 32, ++ PropModeReplace, (unsigned char *)data, 1); ++} ++ + Bool + updategeom(void) { + Bool dirty = False; +@@ -1948,6 +1979,7 @@ + if(arg->ui & TAGMASK) + selmon->tagset[selmon->seltags] = arg->ui & TAGMASK; + arrange(selmon); ++ updatecurrenddesktop(); + } + + Client *