Subject: FVWM: Focusing the top most window that accepts focus?

From: "Felix E. Klee" <[email-masked]>
Date: Mon, 5 Jan 2004 17:15:35 +0100

Hi,

I need a solution to give focus to the top most window that accepts
focus. Any ideas?

At first, I tried     
    Next (AcceptsFocus,Raised) Focus 
But this doesn't do what I want if the currently raised window is one
that doesn't accept focus. In this case I want the second highest window
to get focus, or, if the second highest doesn't accept focus, the third
highest, and so on.

Felix

-- 
To contact me off list don't reply but send mail to
    felix DOT klee AT inka DOT de
Otherwise your email to me might get automatically deleted!
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Marcus Lundblad <[email-masked]>
Date: Mon, 5 Jan 2004 19:12:31 +0100 (CET)

> to get focus, or, if the second highest doesn't accept focus, the third

I have thought about similar issues. Can't think of an easy way to do it
(guess writing a new module would be possible).
Maybe what would be needed is "Topmost" and "Bottommost" commands, like
this:
Topmost (AcceptsFocus) Focus
or maybe Topmost (CurrentPage,AcceptsFocus) Focus

//Marcus

---

From: Dan Espen <[email-masked]>
Date: Mon, 05 Jan 2004 13:28:53 -0500

> > I need a solution to give focus to the top most window that accepts
...
> or maybe Topmost (CurrentPage,AcceptsFocus) Focus

Are we using topmost in the visual sense?

It seems to me there are many "topmost" windows.
I know there are on my desktop.

I think we could do:

Next (!Obscured) Focus

but I don't see much point to it.

-- 
Dan Espen                           E-mail: [email-masked]

---

From: "Felix E. Klee" <[email-masked]>
Date: Mon, 5 Jan 2004 23:11:24 +0100

> > or maybe Topmost (CurrentPage,AcceptsFocus) Focus

Exactly. That would be nice.

> Are we using topmost in the visual sense?

Not necessarily. I assume FVWM manages a list internally in order to know in 
which order to draw windows, e.g. when a screen update happens. A command like
topmost would go through that list, starting from the highest window and 
proceed step by step to the lowest window if necessary.
 
> Next (!Obscured) Focus

No, that's not what I want. For example, I often have the problem that a
nonfocusable button bar obscures the topmost focusable window. Then I
want that window to be focused (and maybe raised). Here's a little illustration:

                    +-----------+
                    |some window|
              +-------------+   |
              | some window |----------+
        +---------------+   | currently|
        |Topmost        |---+ focused  |
     +-------+ focusable| |   window   |
     |BUTTONS| window   | +------------+
     +-------+----------+

Felix

---

From: "Felix E. Klee" <[email-masked]>
Date: Thu, 8 Jan 2004 13:07:05 +0100

On Mon, 5 Jan 2004 23:11:24 +0100 Felix E. Klee wrote:
> For example, I often have the problem that a
> nonfocusable button bar obscures the topmost focusable window.

FYI, I finally solved that problem by creating a function

    AddToFunc LowerPanel 
    + I Next (FvwmButtons,CurrentDesk) Lower 

After executing it by pressing a key combination, I can execute

    AddToFunc FocusRaised
    + I Next (AcceptsFocus,Raised,CurrentDesk) Focus

to focus a focusable window that was originally below the button bar.

Still, TopMost and BottomMost commands would be nice to have in reserve.

Felix