Discussion:
FVWM: Focus on window after calling application and related questions...
Oleksandr Gavenko
2012-08-08 20:06:22 UTC
Permalink
First I get inconvenience when start using gmrun (Win+R like in Windows app
which prompt command to execute with completion).

But I found annoying to move mouse or to switch focus by 'FocusWindow'
(Alt+TAB) to 'gmrun' app.

I have same issue when call "Save as..." and "Open file..." like dialog in
Firefox, etc.

So I read manual and FAQ. FAQ was useful:

http://www.fvwm.org/documentation/faq/?theme=default#3.18
When my specific window (or all windows) pops up, I want it to
get focus/be moved/be resized/be closed/be shaded... How?

I repeat most exactly:

*FvwmEvent-NewWindow: Cmd
*FvwmEvent-NewWindow: PassId
*FvwmEvent-NewWindow: StartDelay 10
*FvwmEvent-NewWindow: add_window MyFuncFocusWindow

DestroyFunc MyFuncFocusWindow
AddToFunc MyFuncFocusWindow
+ I FlipFocus
+ I WarpToWindow 50 50

AddToFunc StartFunction I Module FvwmEvent
AddToFunc StartFunction I FvwmEvent FvwmEvent-NewWindow

So now any new window automatically get focus.

Does this setting provide behaviour same as in Windows?

That part of desktop environment responsible for such behaviour (I am noob, is
it session manager or windows manager or what)?

================================================================

I try to break this solution by:

$ xterm
$ xmessage Hi
$ /usr/lib/notification-daemon/notification-daemon &
$ notify-send -t 10 Hi

After xmessage I lose focus, but after notify-send not. Why?

How can I control this by styling in Fvwn and programmatically in C lang?

================================================================

I use:

Style "*" SloppyFocus, MouseFocusClickRaises

for 4 year and now would like to hear what other people use to improve my
interaction with PC...

Thanks in any advice!

================================================================

For whose interesting how I setup 'gmrun' as in Windows:

$ cat ~/.fvwm/config
Key R A 3 Exec exec gmrun

$ cat ~/.xinitrc
xmodmap ~/.xmodmaprc

$ cat ~/.xmodmaprc
! Win key.
clear mod3
clear mod4

keycode 133 = Super_L
! keycode 134 = Multi_key
! keycode 134 = Super_R
keycode 134 = Hyper_R
add mod3 = Super_L
add mod4 = Hyper_R
--
Best regards!
Oleksandr Gavenko
2012-08-10 10:18:36 UTC
Permalink
Thomas Adam replay to me in private message with suggestions. I wish to report
what I get currently.
Post by Oleksandr Gavenko
First I get inconvenience when start using gmrun (Win+R like in Windows app
which prompt command to execute with completion).
But I found annoying to move mouse or to switch focus by 'FocusWindow'
(Alt+TAB) to 'gmrun' app.
This completely resolve my issue this gmrun:

Style whatever GrabFocus
Post by Oleksandr Gavenko
I have same issue when call "Save as..." and "Open file..." like dialog in
Firefox, etc.
This partially resolve my issue in up quotation:

Style * GrabFocusTransient

Why partially?

I start gaming with this stile in different conditions.

First that differ from FvwmEvent solution is that I lose:

WarpToWindow 50 50

Also GrabFocusTransient have bad job with setting like:

Style "goldendict" StartsOnPage 3 1 2, SkipMapping

When I start "goldendict" app by:

AddToMenu MenuMy Media Title
+ Goldendict Exec exec goldendict

I don't get focus of goldendict app and also don't switch to it if I am not at
page 1 2 of desktop 3.
I bad read manual. There are many parts where written about focus. For example
I must find this one without asking at this list:

Grabbing the focus when a new window is created
Post by Oleksandr Gavenko
*FvwmEvent-NewWindow: Cmd
*FvwmEvent-NewWindow: PassId
*FvwmEvent-NewWindow: StartDelay 10
*FvwmEvent-NewWindow: add_window MyFuncFocusWindow
DestroyFunc MyFuncFocusWindow
AddToFunc MyFuncFocusWindow
+ I FlipFocus
+ I WarpToWindow 50 50
AddToFunc StartFunction I Module FvwmEvent
AddToFunc StartFunction I FvwmEvent FvwmEvent-NewWindow
So now any new window automatically get focus.
As I describe above GrabFocusTransient have 2 issues (for me). So I stick with
solution from FAQ but would like to hear another option (I think FvwmEvent
take some extra CPU power instead of built-in Fvwm solution...).
Post by Oleksandr Gavenko
Does this setting provide behaviour same as in Windows?
After using for two days look like so...
Post by Oleksandr Gavenko
That part of desktop environment responsible for such behaviour (I am noob, is
it session manager or windows manager or what)?
I don't know right answer but build-in Fvwn features allow near good solution.
And with external but standard FvwmEvent module a full solution.
Post by Oleksandr Gavenko
$ xterm
$ xmessage Hi
$ /usr/lib/notification-daemon/notification-daemon &
$ notify-send -t 10 Hi
After xmessage I lose focus, but after notify-send not. Why?
How can I control this by styling in Fvwn and programmatically in C lang?
Still will be happy if some one answer this question.
Post by Oleksandr Gavenko
Style "*" SloppyFocus, MouseFocusClickRaises
Note I experiment with combining GrabFocusTransient and SloppyFocus together:

Style "*" SloppyFocus, GrabFocusTransient

they work greate together.
--
Best regards!
Loading...