WarpPointer and TextField

Hi,

I’m trying to make a script to enter command (like gmrun or the KDE ‘Alt+F2’ function).

Here’s the script :

WindowTitle {FvwmCmdRun}
WindowSize 180 24
#WindowPosition 0 0
Colorset 8

Init
 Begin
  WarpPointer 2
  Key Return A 2 1
  Key Escape A 1 1
  #Key Escape A 2 1
End

PeriodicTasks
Begin
End

Widget 1
Property
 Position 0 0
 Size 30 20
 Type ItemDraw
 Title {Run: }
 Flags NoFocus NoReliefString

Main
 Case message of
 1 :
 Begin
  Quit
 End
End

Widget 2
Property
 Position 30 0
 Size 150 18
 Type TextField
 Title {}
 Flags NoReliefString

Main
 Case message of
  1 :
  Begin
   Set $cmd=(GetTitle 2)
   Do {Exec exec } $cmd
   Quit
  End
End

I use this style definition :

Style FvwmCmdRun NoTitle, StaysOnTop, WindowListSkip, CenterPlacement, NoHandles, GrabFocus

Basically, this work, but I’ve got one problem : the keyboard focus.
The WarpPointer function is strange.

When I launch this script, the mouse cursor warp to the top left corner of the screen, as if the script window was there (but with CenterPlacement, it’s centered on the screen…).
How can I handle the warping correctly ?

(All this because you must have mouse cursor in TextField in order to enter text…)

TIA

i use urxvt fox this

SetEnv launcher $[fvwm_scripts_path]/run-dialog-standalone"
and script run-stand-alone

[code]
#!/bin/sh
export PS1="[Exec]: "
export HISTCONTROL=“ignorespace”

${terminal} +sb -font “xft:Bitstream Vera Sans Mono:size=12:style=bold”
-name Run_Standalone -title “Run” -g 40x5+100+200
-fg grey25 -bg grey95 -cr grey25
–keysym.0xFF0D: " &\n exit\n"
–keysym.0xFF1B: " ^C exit\n"
-e sh -s[/code]

But thnx for script, i’ll be using it from now:)

Since this appears to be a “me too” thing, here’s what I use:

edulinux.homeunix.org/~n6tadam/f … wmForm-Run

– Thomas Adam

Thank you for your answers (and for your FvwmForm Thomas), but I’d really like to know how to fix things with the WarpPointer function (appart from fixing WindowPosition and not using CenterPlacement style)…

Hmmmm…

Things are getting worse : after playing with WindowPosition, it now appears that the mouse pointer is actually warped about 20 pixels below my TextField, resulting in no Focus again.

I’m not a developper, but isn’t this a bug, or am I just to dumb to use this function the good way ? :frowning: