Re: [dwm] place floating windows at cardinal points

From: Anselm R. Garbe <arg_AT_suckless.org>
Date: Thu, 10 May 2007 13:53:17 +0200

On Thu, May 10, 2007 at 01:51:57PM +0200, Anselm R. Garbe wrote:
> Hi Riccardo,
>
> On Wed, May 09, 2007 at 05:29:08PM +0200, Riccardo Murri wrote:
> > - the "place" patch adds a `place()` function that can be used to
> > instantly move a floating window to a "cardinal point" of the
> > window area.
> >
> > There's a bug with this: the moved window will at times loose
> > focus. I could not identify the culprit, as the bug seems to
> > manifest itself at random... Any clue will be appreciated :-)
>
> > +static void
> > +_place(const vertical_placement_t vpos, const horizontal_placement_t hpos)
> > +{
> > + unsigned int nx, ny;
       XEvent ev;
> > +
> > + if(NULL == sel || !sel->isfloating)
> > + return;
> > +
> > + /* FIXME: should we take window gravity into account here? */
> > + nx = wax + hpos*(waw - sel->w)/2;
> > + ny = way + vpos*(wah - sel->h)/2;
> > +
> > + XMoveWindow(dpy, sel->win, nx, ny);
> XSync(dpy, False);
> while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
> > +}
>
> If you'll add those two lines to your patch, I believe the bug
> you describe might be fixed.

Of course I forgot to declare ev ;)

-- 
 Anselm R. Garbe >< http://www.suckless.org/ >< GPG key: 0D73F361
Received on Thu May 10 2007 - 13:53:17 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:41:13 UTC