Re: [dwm] [patch] Minor code cleanup, part 2

From: Martin Hurton <martin.hurton_AT_gmail.com>
Date: Thu, 14 Aug 2008 15:36:06 +0200

On Thu, Aug 14, 2008 at 12:41:30PM +0200, Premysl Hruby wrote:
> On (14/08/08 09:52), Szabolcs Nagy wrote:
> > To: dwm mail list <dwm_AT_suckless.org>
> > From: Szabolcs Nagy <nszabolcs_AT_gmail.com>
> > Subject: Re: [dwm] [patch] Minor code cleanup, part 2
> > Reply-To: dwm mail list <dwm_AT_suckless.org>
> > List-Id: dwm mail list <dwm.suckless.org>
> >
> > On 8/14/08, Martin Hurton <martin.hurton_AT_gmail.com> wrote:
> > > if((rettrans = XGetTransientForHint(dpy, w, &trans) == Success))
> > > - for(t = clients; t && t->win != trans; t = t->next);
> > > + t = getclient(trans);
> > nice
> >
> > what about
> > - if((rettrans = XGetTransientForHint(dpy, w, &trans) == Success))
> > + if((rettrans = XGetTransientForHint(dpy, w, &trans)) == Success)
> >
>
> Applied both changes, thanks.

Can you apply the following patch too? According to spec the
XGetTransientForHint() function returns non zero value on success
while the Success value is defined as zero (see /usr/include/X11/X.h).

Cheers,
/Martin

diff -r a63cb246f35c dwm.c
--- a/dwm.c Thu Aug 14 12:36:49 2008 +0200
+++ b/dwm.c Thu Aug 14 15:29:20 2008 +0200
@@ -903,14 +903,14 @@
         XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask);
         grabbuttons(c, False);
         updatetitle(c);
- if((rettrans = XGetTransientForHint(dpy, w, &trans)) == Success)
+ if((rettrans = XGetTransientForHint(dpy, w, &trans)))
                 t = getclient(trans);
         if(t)
                 c->tags = t->tags;
         else
                 applyrules(c);
         if(!c->isfloating)
- c->isfloating = (rettrans == Success) || c->isfixed;
+ c->isfloating = rettrans || c->isfixed;
         if(c->isfloating)
                 XRaiseWindow(dpy, c->win);
         attach(c);
Received on Thu Aug 14 2008 - 13:36:06 UTC

This archive was generated by hypermail 2.2.0 : Thu Aug 14 2008 - 13:48:04 UTC