Julien Jehannet avatar Julien Jehannet committed ca1dad6

dwm: save patch current_desktop.diff

Comments (0)

Files changed (3)

dwm-current_desktop.diff

+# HG changeset patch
+# changeset: 660:7b26aa3e3fe9
+Added new patch to dwm site.
+
+My md file provides a pretty thorough description of the patch. Feel free to
+email with any questions.
+
+diff -r e6f26b6184e9 -r 7b26aa3e3fe9 dwm.suckless.org/patches/current_desktop.md
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ b/dwm.suckless.org/patches/current_desktop.md Mon Dec 13 08:37:11 2010 -0500
+@@ -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 -r e6f26b6184e9 -r 7b26aa3e3fe9 dwm.suckless.org/patches/dwm-5.8.2-current_desktop.patch
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ b/dwm.suckless.org/patches/dwm-5.8.2-current_desktop.patch Mon Dec 13 08:37:11 2010 -0500
+@@ -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 * 
 dmenu-xresources.diff
+dwm-current_desktop.diff
 dwm-config.diff
 dwm-config.h
 dwm-panel.diff
-a981ed41a05019836c75edacb612ba504af80607:dmenu-xresources.diff
+e8e25c2c6db89368bb2e99b271f74443fc48fc65:dwm-current_desktop.diff
+a40a8cb353552ed0e895800c74834a0404c42a10:dwm-config.diff
+7322ad2614e08b58547c6797cc796606a10e1a22:dwm-config.h
+8ca8dc1b0d16c9f4be5d9e13c85019454940c0ee:dwm-panel.diff
+d38fa97935ac47d189e9debfd707c87855cf9b8b:dwm-5.9-bstack.diff
+1751cc0348e3d13e2c0f9fb4bf478b06677ca135:dwm-5.7.2-urgentborder.diff
+f25b9d0164b014ef6d82c47e37c574e54ddef0e3:dwm-r1522-viewontag.diff
+29b5a383236be6e0b1366a9d2fb3874a2b640e45:dwm-nextprevtag.inc
+e8ce1d8315e63b6dc82f721cd410cde1b4898b7d:dwm-5.8.2-monocle_count.diff
+2744acbc0ba753596f58f7fc85483b54862270e4:dwm-r1507-focusatom.diff
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.