Subject: FVWM: FvwmEvent and focusing on Netscape popups

From: Danek Duvall <[email-masked]>
Date: Thu, 7 Jan 1999 22:04:56 -0800

Here's what I want to do.  Whenever a popup window appears in Netscape (say
I pressed M-l or M-f or it's asking me if I really want to submit the
form), I want the keyboard focus to go to the popup.  When the popup
disappears, I want the focus to return to whatever window it was in before
(though I'd settle for a Netscape window, as long as it was the one I came
from).

As far as I can tell, the tool to use here is FvwmEvent.  What I've gotten
is the following.

    AddToFunc FocusIfTransient    "I" Next (*_popup) Focus
    
    *FvwmEventCmd FocusIfTransient
    *FvwmEvent add_window FocusIfTransient

This works just fine.  The popup appears, and it immediately gets focus.
However, when it disappears, although the mouse pointer is still in the
Netscape window (I use focus follows mouse), it doesn't get the focus (no
window does, as far as I can tell) unless the pointer was inside the popup
to begin with (a situation in which all this rigmarole is unnecessary).

I can't for the life of me, though, figure out how to do the second half
here.  I've tried putting in the appropriate FvwmEvent stuff:

    *FvwmEventCmd UnFocusIfTransient
    *FvwmEvent destroy_window UnFocusIfTransient

But I can't figure out what to put in UnFocusIfTransient, particularly so
that it doesn't get called on *every* window destroy.

So -- is there a way to do it without making any modifications?  Also, is
it a bug that focus does not return to the original window on its own?

This is using the CVS version dated Dec 19 21:31.

Please cc: me on any responses, as I'm not subscribed to this list.

Thanks,
Danek
--
Visit the official FVWM web page at <URL: http://fvwm.math.uh.edu/>.
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: Dominik Vogt <[email-masked]>
Date: Fri, 8 Jan 1999 10:22:17 +0100

> it a bug that focus does not return to the original window on its own?

I think the problem is that no event is triggered when you
destroy a window, even the one with the focus. In general it
is correct that no window receives the focus when the one
that had it is destroyed. The focus is given to a new window
only when you enter a new window with the pointer (with
SloppyFocus and Mouse Focus). This generates an EnterNotify
event that takes care of the focus.

> Please cc: me on any responses, as I'm not subscribed to this list.

Bye

Dominik

-- 
Dominik Vogt, Hewlett-Packard GmbH, Dept. BVS
Herrenberger Str.130, 71034 Boeblingen, Germany
phone: 07031/14-4596, fax: 07031/14-3883, [email-masked]
--
Visit the official FVWM web page at <URL: http://fvwm.math.uh.edu/>.
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].