Re: FVWM: Want focus and active pointer in new windows, especially transients

From: Mikhael Goikhman <migo_at_homemail.com>
Date: Tue, 16 Jan 2001 11:40:26 -0600

On 16 Jan 2001 09:22:12 -0600, Lars Eighner wrote:
>
> I am running 2.3.20, which is the latest version that is ported to FreeBSD.

2.3.20 was in July, the current version is pre-2.3.28.

There are many people, every one with his own wishes about focus policy,
placement policy, usage of keyboard or mouse, circulating policy, window
states like maximizing, iconifying, shading, borders, buttons, bindings
and so on. FVWM lets you to customize most of things, but you should be
ready learn it, it is not hard if you are a unix person.

The best way to learn fvwm commands is to open FvwmConsole and try all
commands that you want (or find in the man page). Try first the simple
ones like Move, Maximize, Exec xterm, Restart. Many commands need a window
context, they are best to be tested with Next or All, like:

  Next (XTerm) Focus
  Next (XTerm) WarpToWindow 50 8p
  All (!FvwmConsole) Iconify

You will find that Focus does not warp the mouse pointer to a window,
i.e. you may type into a newly focused window despite the fact that the
pointer is actually over some other window.
Once you learn how individual commands work, you may create complex
functions consisting from individual commands, say:

  DestroyFunc SelectWindow
  AddToFunc SelectWindow
  + I Echo Selected window: id=$w, name="$n"
  + I Iconify false
  + I WindowShade false
  + I Focus
  + I WarpToWindow

  Key Tab A CM Prev SelectWindow
  Key Tab A SCM Next SelectWindow

> I want dialogue windows (or any new windows) to get focus and to have an
> active pointer in them. In particular, I want to do this with WordPerfect
> so that tab between dialogue buttons and fields without using the mouse.
> I don't know how cooperative WordPerfect 8 is with X, but so far I can't
> get things to work right with native X applications - so that is my first
> goal.
>
> I have tried the examples in the FAQ with no success. The closest
> I have got so far is to get new windows colored like they have focus
> and raised, but the pointer doesn't go to the window and if it happens
> to be where the window opens, it is in cross-hair form and for example
> with xterm I can't type into the window (the little block after the
> prompt is in outline form, like the window doesn't have focus, although
> it is in the hilight colors).

The cross-hair cursor is used when the window is requered for a window
operation like Iconify, Move, Focus, but there is no window context.
This happens if you use FvwmEvent without PassId. I.e. your function
defined as add_window hook is called without a window context, thus
all window commands, like Focus will first require you to choose
a window and press a button or Enter. Hovewer if you use PassId, and
then WindowId $0 WarpToWindow, this will work on a newly added window.

The example in FAQ lists 2.3.19+ as requirement, but it should be 2.3.21+,
sorry for the mistake. If you already use a developement version, I would
suggest to update to 2.3.27 anyway.

> I gather that I am supposed to do this with FvwmEvent, add_window and
> some function defined to do what I want. But so far, defining that
> function with various combinations of Focus, FlipFocus, Raise, and
> WarpToWindow has not come up with what I am looking for. I think I
> was able to do this at one time with hints for mouseless operation for
> the disabled. But I lost my configuration with a crash and have been
> unable to find the site with that information again.
>
> Can someone tell me very slowly and clearly, like I am as senile as I,
> exactly what I have to do?

This is from FAQ, but edited to work with any 2.3.x (but not 2.2, because
it does not support PassId). Put this to your .fvwm2rc:

#
# Every new window is focused and gets a mouse cursor
#
*FvwmEventCmd
*FvwmEventPassId
*FvwmEvent add_window SelectWindow

AddToFunc StartFunction I FvwmEvent

DestroyFunc SelectWindow
AddToFunc SelectWindow
+ I WindowId $0 Focus
+ I WindowId $0 WarpToWindow 50 50

Regards,
Mikhael.
--
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 Tue Jan 16 2001 - 11:42:06 GMT

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:51 BST