From 36672d0401299a5230b516ca4575365d9f45dd35 Mon Sep 17 00:00:00 2001 From: "Anselm R. Garbe" Date: Wed, 22 Aug 2007 19:01:05 +0200 Subject: removed the _DWM_PROPERTIES handling, reverted ban/unban to XMoveWindow(), and changed argument of setlayout to layout[N].symbol check --- client.c | 50 +++++++------------------------------------------- 1 file changed, 7 insertions(+), 43 deletions(-) (limited to 'client.c') diff --git a/client.c b/client.c index c03770b5..9dd08b1c 100644 --- a/client.c +++ b/client.c @@ -1,14 +1,11 @@ /* See LICENSE file for copyright and license details. */ #include "dwm.h" #include -#include #include #include /* static */ -static char buf[128]; - static void attachstack(Client *c) { c->snext = stack; @@ -102,10 +99,8 @@ void ban(Client *c) { if(c->isbanned) return; - XUnmapWindow(dpy, c->win); - setclientstate(c, IconicState); + XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); c->isbanned = True; - c->unmapped++; } void @@ -181,21 +176,6 @@ killclient(const char *arg) { XKillClient(dpy, sel->win); } -Bool -getprops(Client *c) { - unsigned int i; - Bool result = False; - - if(gettextprop(c->win, dwmprops, buf, sizeof buf)) { - for(i = 0; i < ntags && i < sizeof buf - 1 && buf[i] != '\0'; i++) - if((c->tags[i] = buf[i] == '1')) - result = True; - if(i < sizeof buf - 1 && buf[i] != '\0') - c->isfloating = buf[i] == '1'; - } - return result; -} - void manage(Window w, XWindowAttributes *wa) { unsigned int i; @@ -242,15 +222,14 @@ manage(Window w, XWindowAttributes *wa) { if(t) for(i = 0; i < ntags; i++) c->tags[i] = t->tags[i]; - if(!getprops(c)) - applyrules(c); + applyrules(c); if(!c->isfloating) c->isfloating = (rettrans == Success) || c->isfixed; - setprops(c); attach(c); attachstack(c); XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); /* some windows require this */ ban(c); + XMapWindow(dpy, c->win); arrange(); } @@ -317,30 +296,16 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) { } } -void -setprops(Client *c) { - unsigned int i; - - for(i = 0; i < ntags && i < sizeof buf - 1; i++) - buf[i] = c->tags[i] ? '1' : '0'; - if(i < sizeof buf - 1) - buf[i++] = c->isfloating ? '1' : '0'; - buf[i] = '\0'; - XChangeProperty(dpy, c->win, dwmprops, XA_STRING, 8, - PropModeReplace, (unsigned char *)buf, i); -} - void unban(Client *c) { if(!c->isbanned) return; - XMapWindow(dpy, c->win); - setclientstate(c, NormalState); + XMoveWindow(dpy, c->win, c->x, c->y); c->isbanned = False; } void -unmanage(Client *c, long state) { +unmanage(Client *c) { XWindowChanges wc; wc.border_width = c->oldborder; @@ -353,14 +318,13 @@ unmanage(Client *c, long state) { if(sel == c) focus(NULL); XUngrabButton(dpy, AnyButton, AnyModifier, c->win); - setclientstate(c, state); + setclientstate(c, WithdrawnState); free(c->tags); free(c); XSync(dpy, False); XSetErrorHandler(xerror); XUngrabServer(dpy); - if(state != NormalState) - arrange(); + arrange(); } void -- cgit v1.2.3