fvwmorg/fvwm3

Unshading a window with WindowShade function sometimes makes the window lose "true input focus".

Closed this issue · 1 comments

Upfront Information

  • Fvwm3 version: 1.0.5 (1.0.4-128-gc7b41a03) , installed from the fvwm3-git AUR package
  • Linux distribution: EndeavourOS Linux x86_64
  • Platform: Linux
  • Kernel: 5.18.3-arch1-1

Expected Behaviour

My current focus style is SloppyFocus

I bound my WindowShade command to a hotkey (Super+S) to shade/unshade a window.

Normally a shading/unshading operation works as expected if I select it from a WindowOps Menu with my mouse. I should be able to immediately issue keyboard commands to the application inside the window. (which is expected since pressing the Shade button from the WindowOps menu requires my cursor to be inside of where the window would be unshaded back anyways)

Actual Behaviour

But when I use the keyboard to unshade a window, it sometimes does not grant input focus to the window. This means that I can still close the window with Fvwm functions like Close with a keyboard binding just fine, but I cannot interact with the content inside of the window itself.

A terminal emulator shows its cursor as if the window is unfocused, and I cannot type anything to it. Same goes for a Firefox window, I cannot send shortcuts like Ctrl-N to open a new tab.

Steps to Reproduce

Step 1: Set the focus style for windows to either SloppyFocus or ClickToFocus (this issue persists when tested with both styles)

Step 2: Set the keyboard binding for the WindowShade command
Key S A 4 Silent WindowShade

Step 3: Attempt to shade and unshade a window with the keyboard binding. In certain situations, input focus will not be gained.
I tried the following methods to regain input focus:

  • After unshading, hover the cursor down from the window's titlebar to the inside of the application window.
  • Either before or after unshading, hover the cursor out of the window's titlebar and back into the window's titlebar again (or any part of the window for that matter)
  • Either before or after unshading, drag the titlebar and begin moving it. (Simply pressing the titlebar does not work)
  • If, after first shading the window, I hover over another window to focus it (even the root window), then go back to the shaded window's titlebar and unshading it, then I can regain input focus just fine.

From this I can determine that: this issue occurs if my cursor remains on the window's titlebar throughout the whole shade/unshade operation.

This issue can be replicated with the default configuration in /usr/share/fvwm3/default-config/config that comes with Fvwm3, but here's my current config file just in case: https://pastebin.com/Dj5NTq1v

As you can see, this can be an issue for keyboard-centric users who would rather not have to use a mouse to regain focus on a window.

Hi @kittywritescode

Thanks for the report. Please try the ta/fix-671 branch to see if this improves things for you.