[hackers] [tabbed] sorting functions alphabeticly || Enno Boland (tox)

From: <hg_AT_suckless.org>
Date: Wed, 28 Oct 2009 19:31:41 +0000 (UTC)

changeset: 126:0c241a3682d7
tag: tip
user: Enno Boland (tox) <tox_AT_s01.de>
date: Wed Oct 28 20:31:34 2009 +0100
files: tabbed.c
description:
sorting functions alphabeticly

diff -r 5dc2eceb0a98 -r 0c241a3682d7 tabbed.c
--- a/tabbed.c Wed Oct 28 20:11:51 2009 +0100
+++ b/tabbed.c Wed Oct 28 20:31:34 2009 +0100
@@ -117,8 +117,8 @@
 static void resize(Client *c, int w, int h);
 static void rotate(const Arg *arg);
 static void run(void);
+static void sendxembed(Client *c, long msg, long detail, long d1, long d2);
 static void setup(void);
-static void sendxembed(Client *c, long msg, long detail, long d1, long d2);
 static void sigchld(int unused);
 static void spawn(const Arg *arg);
 static int textnw(const char *text, unsigned int len);
@@ -206,15 +206,14 @@
 void
 configurenotify(const XEvent *e) {
         const XConfigureEvent *ev = &e->xconfigure;
- Client *c;
 
         if(ev->window == win && (ev->width != ww || ev->height != wh)) {
                 ww = ev->width;
                 wh = ev->height;
                 XFreePixmap(dpy, dc.drawable);
                 dc.drawable = XCreatePixmap(dpy, root, ww, wh, DefaultDepth(dpy, screen));
- for(c = clients; c; c = c->next)
- resize(c, ww, wh - bh);
+ if(sel)
+ resize(sel, ww, wh - bh);
                 XSync(dpy, False);
         }
 }
@@ -375,6 +374,7 @@
         }
         if(!c)
                 return;
+ resize(c, ww, wh - bh);
         XRaiseWindow(dpy, c->win);
         XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
         sendxembed(c, XEMBED_FOCUS_IN, XEMBED_FOCUS_CURRENT, 0, 0);
@@ -565,7 +565,6 @@
                 c->win = w;
                 clients = c;
                 updatetitle(c);
- resize(c, ww, wh - bh);
                 drawbar();
                 XMapRaised(dpy, w);
                 e.xclient.window = w;
@@ -631,7 +630,6 @@
         ce.border_width = 0;
         XConfigureWindow(dpy, c->win, CWWidth|CWHeight, &wc);
         XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&ce);
- XSync(dpy, False);
 }
 
 void
@@ -666,6 +664,22 @@
 }
 
 void
+sendxembed(Client *c, long msg, long detail, long d1, long d2) {
+ XEvent e = { 0 };
+
+ e.xclient.window = c->win;
+ e.xclient.type = ClientMessage;
+ e.xclient.message_type = xembedatom;
+ e.xclient.format = 32;
+ e.xclient.data.l[0] = CurrentTime;
+ e.xclient.data.l[1] = msg;
+ e.xclient.data.l[2] = detail;
+ e.xclient.data.l[3] = d1;
+ e.xclient.data.l[4] = d2;
+ XSendEvent(dpy, c->win, False, NoEventMask, &e);
+}
+
+void
 setup(void) {
         /* clean up any zombies immediately */
         sigchld(0);
@@ -708,22 +722,6 @@
 }
 
 void
-sendxembed(Client *c, long msg, long detail, long d1, long d2) {
- XEvent e = { 0 };
-
- e.xclient.window = c->win;
- e.xclient.type = ClientMessage;
- e.xclient.message_type = xembedatom;
- e.xclient.format = 32;
- e.xclient.data.l[0] = CurrentTime;
- e.xclient.data.l[1] = msg;
- e.xclient.data.l[2] = detail;
- e.xclient.data.l[3] = d1;
- e.xclient.data.l[4] = d2;
- XSendEvent(dpy, c->win, False, NoEventMask, &e);
-}
-
-void
 sigchld(int unused) {
         if(signal(SIGCHLD, sigchld) == SIG_ERR)
                 die("Can't install SIGCHLD handler");
Received on Wed Oct 28 2009 - 19:31:41 UTC

This archive was generated by hypermail 2.2.0 : Wed Oct 28 2009 - 19:36:05 UTC