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 <[email protected]>
> > From: Szabolcs Nagy <[EMAIL PROTECTED]>
> > Subject: Re: [dwm] [patch] Minor code cleanup, part 2
> > Reply-To: dwm mail list <[email protected]>
> > List-Id: dwm mail list <dwm.suckless.org>
> >
> > On 8/14/08, Martin Hurton <[EMAIL PROTECTED]> 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);