Re: [dev] Focus after closing a window

From: Donald Allen <donaldcallen_AT_gmail.com>
Date: Thu, 27 Aug 2009 11:14:44 -0400

On Thu, Aug 27, 2009 at 9:27 AM, Anselm R Garbe <garbeam_AT_gmail.com> wrote:

> Hi Donald,
>
> 2009/8/27 Donald Allen <donaldcallen_AT_gmail.com>:
> > I'm seeing what I think is non-intuitive behavior of the focus after
> closing
> > a window in tiled mode. Here's the situation:
> >
> > I use rox as my file-system browser. Let's assume rox is by itself in tag
> 6
> > and dwm is in tile mode. Now suppose I open a .pdf file and then another
> by
> > clicking them in rox, having specified xpdf (in rox) as the program to
> deal
> > with .pdf extensions. Now I've got two xpdfs windows in addition to the
> rox
> > window, all with tag 6. The second xpdf is in the master area and has the
> > focus. The first xpdf and rox are in the stacking area. Now I do
> > mod1-shift-c, which closes the second xpdf, the one in the master area.
> This
> > causes the first xpdf to move to the master area, with rox now the only
> > window in the stacking area. But the rox window gets the focus at this
> > point. If I fail to notice that and do another mod1-shift-c with the
> > intention of closing the first xpdf, I will close the rox window by
> mistake.
>
> dwm remebers the focus history in a focus stack, since rox was focused
> before your second pdf window appeared, it will revert to the window
> that had the focus before the second xpdf appeared, which is rox in
> your case.

>
> > It seems to me that, before the first close, the focus was in the master
> > area and after the close, it should remain there. Having it move at all
> is a
> > surprise and having it move away from the master area, which contains the
> > window you just popped off the stack, is a double surprise.
>
> Well it might be less a surprise with the above constraint in mind.

Perhaps less of a surprise now that I know what you are doing, but still
unintuitive, in my opinion. I would expect the relative position in the
window stack to remain constant as windows get closed regardless of the
focus path I traversed to get there. So, if the focus is in the window in
the master area and I close that window, I would expect the window that gets
popped from the stack into the master area to receive the focus.

There's something else going on here that strikes me as odd:

When I begin, I have a rox window alone in tag 6. Rox is displaying a
directory that contains multiple .pdf files. I click the first one I want to
display and an xpdf window appears in the master area. It gets the focus,
but the cursor does not move. It may be in the focused window, it may not
be, depending on where the file icon was in the rox window. Then, I move the
cursor to the rox window, which is now in the stack area. I click another
pdf file and a new xpdf window appears in the master area and has the focus,
but the cursor is still in the rox window, so the focus is in one place and
the cursor is in another.

>
> > I am running 5.6.1 without xinerama (which still does not work correctly
> on
> > my system; I'll detail in another message) on OpenBSD 4.5.
>
> Let us know the issues,

I will.

> and also check if the issues also happen with
> other WMs that support xinerama.

I doubt that I will have time to do that kind of experimenting, but if I
can, I will.

/Don

>
>
> Kind regards,
> Anselm
>
>
Received on Thu Aug 27 2009 - 15:14:44 UTC

This archive was generated by hypermail 2.2.0 : Thu Aug 27 2009 - 15:24:01 UTC