Subject: FVWM: WindowId "$w" FlipFocus doesn't work

From: Johannes Zellner <[email-masked]>
Date: Thu, 13 Sep 2001 19:02:09 +0200

Hi,

I tried

Style "*"		SloppyFocus, GrabFocus

DestroyFunc Fred
AddToFunc   Fred
+ I WindowId "$w" Maximize false
+ I WindowId "$w" FlipFocus

Key Next	A	C	Current (CurrentPage) Fred

The "Maximize false" might result in the focus beeing on
another window, as I've SloppyFocus. The second line of
the function should bring the focus back to the original
window, but that doesn't work apparently.

Is there something wrong with the above function ?

-- 
   Johannes
--
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: Dominik Vogt <[email-masked]>
Date: Fri, 14 Sep 2001 00:12:25 +0200

> window, but that doesn't work apparently.

All lines of the function are executed before the focus transition
caused by the "maximize false" is handled.  The "flipfocus" part
*does* actually work, but its immediately undone.  To make this
work, the FlipFocus command has to be delayed until after all
events have been handled.  The easiest way I could find is to
use FvwmCommand:

  DestroyFunc Fred
  AddToFunc   Fred
  + I WindowId "$w" Maximize false
  + I Exec FvwmCommand "WindowId $w FlipFocus"

This starts an FvwmCommand process in parallel to fvwm.  Usually,
fvwm handles its events faster than FvwmCommand can deliver the
FlipFocus command (although this may fail if the connection to the
server is slow) since starting a new process and sending the
commands to the FvwmCommandS daemon is involved.

Make sure you start the FvwmCommandS module in your StartFunction
and that you have FvwmCommand in the PATH.

Bye

Dominik ^_^  ^_^

 --
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
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].