Dominik Vogt <dominik.vogt_at_gmx.de> writes:
> On Thu, Aug 09, 2001 at 12:22:27PM -0700, Cyprian Laskowski wrote:
>> On startup (in InitFunction), I like to start up one xterm and one
>> emacs, and have them treated specially for the duration of the
>> session: I want the xterm to be sticky, and I want special keybindings
>> that will immediately take me to both of these windows.
> When you run a command that needs a window to work on, the window
> is usually chosen from the context the function was invoked from.
> Usually, the context window is simply the window you clicked on,
> but it can be something else or even unset under some
> circumstances. This is why you need "Next FlipFocus" to focus the
> window, not just "FlipFocus". It is important to know that the
> context window does not change during function execution. Thus,
> the "Stick" line refers to the original context window again, not
> to the one just focused. "Next Stick" should work. The "Key"
> lines do not work for the same reason. In addition, the "$w" is
> replaced by a more or less random window, even if you use
> "Next Key ..." since it is replaced at the time the "Next Key ..."
> line is executed - and at that time the window was not yet
> selected by the "Next".
>
> I recommend doing this stuff in a separate function:
>
> Style BANG Sticky
>
> AddToFunc WaitAndFocusAndKeybind
> + I Wait $0
> + I Next ($0) FlipFocus
> + I Key $1 $2 $3 WindowId $w FlipFocus
>
> AddToFunc InitFunction
> + I Exec exec xmodmap $HOME/.xmodmaprc
> + I Exec exec xbiff -geometry 50x50+1080+5
> + I Exec exec xterm -font 7x13 -geometry 55x8+765+5 -T BANG
> + I WaitAndFocusAndKeybind BANG Return A 3
> + I Exec exec emacs -f eshell
> + I WaitAndFocusAndKeybind emacs Return A 3
>
> (untested)
>
Ok, the sticky business worked fine. But the Key commands did not
work as expected. They seemed to do nothing (although they are bound,
since the application doesn't see these keys). I tried replacing the
FlipFocus above with Beep to see if it did anything, and it did in
fact beep. So it appears that the FlipFocus isn't working as I
expect. Now I'm thinking that the problem is that $w is being
replaced when the command is executed and not when the command is run
(which corresponds to what you're saying above in the "Next Key"
discussion, right?). Which makes sense to me, but I did not consider
it before. In that case, the FlipFocus would always just give focus
to the window that already has the focus, which has no visible effect.
Is this what happens? If so, is there any way for me to make this
work still the way I want?
--
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 majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Sat Aug 11 2001 - 19:52:47 BST