[wiki] [official] updated push.c in patches || nsz

From: <hg_AT_suckless.org>
Date: Sun, 1 Feb 2009 13:06:36 +0000 (GMT)

changeset: 202:7e061bc2559f
user: nsz <nszabolcs_AT_gmail.com>
date: Sat Jan 24 00:31:50 2009 +0100
files: dwm/patches/push-5.3.c dwm/patches/push.md
description:
updated push.c in patches


diff -r 9c326938dc9b -r 7e061bc2559f dwm/patches/push-5.3.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dwm/patches/push-5.3.c Sat Jan 24 00:31:50 2009 +0100
_AT_@ -0,0 +1,56 @@
+static Client *
+prevtiled(Client *c) {
+ Client *p, *r;
+
+ for(p = clients, r = NULL; p && p != c; p = p->next)
+ if(!p->isfloating && ISVISIBLE(p))
+ r = p;
+ return r;
+}
+
+static void
+pushup(const Arg *arg) {
+ Client *c;
+
+ if(!sel || sel->isfloating)
+ return;
+ if((c = prevtiled(sel))) {
+ /* attach before c */
+ detach(sel);
+ sel->next = c;
+ if(clients == c)
+ clients = sel;
+ else {
+ for(c = clients; c->next != sel->next; c = c->next);
+ c->next = sel;
+ }
+ } else {
+ /* move to the end */
+ for(c = sel; c->next; c = c->next);
+ detach(sel);
+ sel->next = NULL;
+ c->next = sel;
+ }
+ focus(sel);
+ arrange();
+}
+
+static void
+pushdown(const Arg *arg) {
+ Client *c;
+
+ if(!sel || sel->isfloating)
+ return;
+ if((c = nexttiled(sel->next))) {
+ /* attach after c */
+ detach(sel);
+ sel->next = c->next;
+ c->next = sel;
+ } else {
+ /* move to the front */
+ detach(sel);
+ attach(sel);
+ }
+ focus(sel);
+ arrange();
+}
diff -r 9c326938dc9b -r 7e061bc2559f dwm/patches/push.md
--- a/dwm/patches/push.md Mon Dec 22 19:11:41 2008 -0500
+++ b/dwm/patches/push.md Sat Jan 24 00:31:50 2009 +0100
_AT_@ -4,12 +4,13 @@
 
 This patch provides a way to move clients position inside the clients list.
 
- #include "push-4.7.c"
+ #include "push-5.3.c"
 
      { MODKEY|ControlMask, XK_j, pushdown, NULL }, \
      { MODKEY|ControlMask, XK_k, pushup, NULL }, \
 
 ## Download
 
+ * [push-5.3.c] (2K) (20090124)
   * [push-4.7.c](http://news.nopcode.org/push-4.7.c) (2K) (20071202)
 
Received on Sun Feb 01 2009 - 14:06:36 CET

This archive was generated by hypermail 2.3.0 : Thu Sep 13 2012 - 19:30:30 CEST