Subject: FVWM: stupid problem with new windows ...

From: Andre Bonhote <[email-masked]>
Date: Wed, 23 May 2001 11:07:36 +0200

hi there, ol' list!

i've got a very annoying problem on which i worked already some years
ago (yes, YEARS).

i have a keyboard fetish. i only use my mouse when necessary. now i've
got my windoze key assigned to pop up a new xterm window using smart
placement. this works great, as expected. the problem now is, that i'd
like to automatically warp my pointer (sloppy focus) to the new window
and focus it there. i tried this:

AddToFunc TermFunc
+ I exec xterm
+ I next (*) focus

and

+ I next flipfocus

and

+ I warptowindow 5p 5p

but nothing works ... flipfocus brings me to somewhere else in my
virtual desktops ... 

can you help me out here?

thx a lot!

andré
-- 
My forefathers's gems!
--
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: Wed, 23 May 2001 12:11:27 +0200

> and focus it there. i tried this:

Your problem is that the xterm is started asynchronously.  Thus,
the window does not yet exist when the warptowindow or flipfocus
line is executed.  Try this function instead:

  AddToFunc TermFunc
  + I exec xterm
  + I wait xterm
  + I next (xterm) warptowindow 5p 5p

You don't even have to warp the pointer to the window to give it
the focus:

  Style foobar GrabFocus

and then start the xterm with

  Exec xterm -T foobar

Bye

Dominik ^_^  ^_^

--
Dominik Vogt, email: [email-masked]
LifeBits Aktiengesellschaft, Albrechtstr. 9, D-72072 Tuebingen
fon: ++49 (0) 7071/7965-0, fax: ++49 (0) 7071/7965-20
--
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: Andre Bonhote <[email-masked]>
Date: Wed, 23 May 2001 13:46:54 +0200

>   + I next (xterm) warptowindow 5p 5p

thanks dominik. this works fine for my key binding. i also have a call
for this function in my root menu. and there something quite strange
happens: sometimes it opens the window properly, then warps to a
completely different page to another xterm window ...

this doesn't make any sense to me ...

andre@grischun02:~ > fvwm2 -version
FVWM version 2.3.31 compiled on Apr  3 2001 at 08:58:32
with support for: ReadLine, XPM, GNOME WM hints, SM

-- 
Rice!

---

From: Dominik Vogt <[email-masked]>
Date: Wed, 23 May 2001 14:02:46 +0200

> with support for: ReadLine, XPM, GNOME WM hints, SM

The 'next' command relies on the order in which windows were
focused.  If you start the function from a menu, the 'next' window
may not be what you expext.  To make absolutely sure you get the
correct window with next you have to give it a unique name, for
expample

  AddToFunc TermFunc
  + I exec xterm
  + I wait xterm
  + I next (foobar) warptowindow 5p 5p

  xterm -T foobar

Bye

Dominik ^_^  ^_^

---

From: Larry Gensch <[email-masked]>
Date: Wed, 23 May 2001 08:41:13 -0400 (EDT)

> this doesn't make any sense to me ...

Ahhh.  I've seen this sort of thing myself.

You could try changing "next" to "current" in the last line, but that
will only work if you have your focus settings such that new windows
automatically get the focus, and you don't have modules (eg, FvwmEvent
or FvwmAuto) changing the focus in the midst of the execution of a
function.

The best solution would be to have the "Wait" command reset the $w
parameter in its enclosing function to the window ID that it found.
Then you could change "(xterm)" in the last line to "($w)."  This
shouldn't be difficult to code or document, but fvwm2.3.x is in
feature freeze right now.

-- 
Larry Gensch                                          [email-masked]

            Working for COMPAQ for over a twentieth of a century