Slight SloppyFocus annoyance

I use SloppyFocus since I can remember, not only in fvwm, and I am done to that behaviour when using the mouse. When using the keyboard binding there is no problem, since I can switch the focus to my convenience.

I have one problem and I have not found a solution to it, though.

I have an urxvt with screen swallowed into a fvwmbuttons panel, which is created outside -far- the screen borders, and slides down when I press win+z, I have a function to do so, and today I rewrote it to make use of State instead of a variable that I used to show/hide it. And in the way, I want to get right of a WarpToWindow command that I use so the window gets the focus and I can type into the terminal emulator. I find it annoying that I have to put my mouse cursor over it to be able to operate in the terminal. Fvwm can give the focus without moving the mouse when using a sloppy focus policy with the rest of the windows.

I think that the problem is that the focus is passed via my function to the FvwmButtons panels, but not to the app inside. But I tried changing it does not work.

The function is this:

DestroyFunc toggle_kuakeitor
AddToFunc toggle_kuakeitor
+ I State 0
+ I ThisWindow (!State 0) All (FvwmKuakeitor) AnimatedMove +$[small_margin]p +0p
+ I ThisWindow (!State 0) All (FvwmKuakeitor) Raise
+ I ThisWindow (!State 0) All (tabbed_URxvt) Focus
+ I ThisWindow (State 0) All (FvwmKuakeitor) AnimatedMove +$[small_margin]p -10000p

And I have no style entry for tabbed_URXvt (the window inside the FvwmKuakeitor panel). The one for the panel is:

Style "FvwmKuakeitor" NoTitle, Sticky, !Iconifiable, FixedSize, \
    WindowListSkip, CirculateSkip, State 0, \
    Layer 6, Borderwidth 1, HandleWidth 1, !RoundedCorners, RoundedCornersBottom

I can’t see a way to give the focus to the embedded terminal unless I put the pointer into the window (by hand of using WarpToWindow, which works fine). And I was wondering if that is possible at all.

Thanks in advance.

EDIT,

I¡m trying an slightly modified version of the function:

DestroyFunc toggle_kuakeitor
AddToFunc toggle_kuakeitor
+ I State 31
+ I ThisWindow (!State 31) All (FvwmKuakeitor) AnimatedMove +$[small_margin]p -10000p
+ I TestRc (Match) Break
+ I All (FvwmKuakeitor) AnimatedMove +$[small_margin]p +0p
+ I All (tabbed_URxvt) FlipFocus NoWarp

It has the same problem, though.

I am also experiencing a very weird thing. When I use my key binding the FvwmKuakeitor panel slides down as expected, and if I do it another time it hides. To that point, all is ok.

But there is one glitch: if I have the pointer in the lower part of the screen it works as described above, it works as well if the pointer is close to the left or right edges, where there is a $[small_margin]. But if I have the pointer in the area where the panel appears, I have to press the binding two times to display the panel, and other two times to move it back away.

This is something with the focus as well, I presume, and since is not a very logical thing I think that maybe it is a bug in the SloppyFocus policy, though a weird one. Though it is far more probable that it is a bug in my reasoning :stuck_out_tongue:

It doesn’t surprise me that if I give FvwmKuakeitor the NeverFocus style, everything works fine. Of course, that is not an options, since by doing that, I renounce to my right to be able to type on the terminal emulator inside the panel. :stuck_out_tongue:

What you’re wanting is to give a specific button focus within FvwmButtons. The problem is, you have no reliable way of accessing it because the swallowed window is reparented. At best what you could do is try to mess around with something like:

Style a SloppyFocus
DestroyModuleConfig a:*
*a: Rows 1
*a: Columns 1
*a: (1x1, Swallow "eep" `Exec exec xterm -T eep`, Id A)
*a: (1x1, Id B)
*a: (1x1, Id C)

Module FvwmButtons a

SendToModule a ExpandButtonVars A  next (a, circulatehit) WarpToWindow $leftp $rightp

I’ll let you mess around with the SendToModule line.

– Thomas Adam

Thanks for the response, Thomas.

To warp into the window is not a problem, since it takes almost all of the panel and a simple WarpToWindow 90 90 can do it. It is true that your method is cleaner, and more elegant, though.

The problem in my function was the Focus line, it has been modified to focus always, not depending on the state. Once the window is focused everything works ok, except in one case.

I put the pointer is in the area of the screen that the panel will take, and then I press the binding (so the panel) shows. Now I go out of it. Then the focus is lost (in favour of the app behind, and thanks to SloppyFocus) and if the mouse remains outside the panel when I press the binding again to hide the panel, then I have to press it three times to hide it. Weird.

The equivalent in bash/setenv works without a single glitch at all.

DestroyFunc toggle_kuakeitor
AddToFunc toggle_kuakeitor
+ I Test (EnvMatch kuake_pos -1) All (FvwmKuakeitor) AnimatedMove +$[small_margin]p +0p
+ I Test (EnvMatch kuake_pos -1) All (FvwmKuakeitor) Focus
+ I Test (EnvMatch kuake_pos -1) All (FvwmKuakeitor) All (FvwmKuakeitor) WarpToWindow 90 90
+ I Test (EnvMatch kuake_pos 1) All (FvwmKuakeitor) AnimatedMove +$[small_margin]p -10000p
+ I Piperead 'echo SetEnv kuake_pos $((${kuake_pos} * -1))'