sxiv
sxiv copied to clipboard
Added ICCCM WM_HINTS
When the window is mapped, some ICCCM WM_HINTS are set. The input field is set to true and state is set to NormalState.
To quote the spec, "The input field is used to communicate to the window manager the input focus model used by the client" and "[c]lients with the Passive and Locally Active models should set the input flag to True". sxiv falls under the Passive Input model, since it expects keyboard input, but only listens for key events on its single, top-level window instead of subordinate windows (Locally Active) or the root window (Globally Active).
From the end users prospective, all EWMH/ICCCM compliant WMs (especially the minimalistic ones) will allow the user to focus sxiv, which will allow sxiv to receive key events. If the input field is not set, WMs are allowed to assume that sxiv doesn't require focus.
For reference, the ICCC spec.
Summary of Input models
- No Input (false) - for windows that don't have keybindings
- Passive Input (true) - for windows whose keybindings are active only when the window has explicitly focus
- Locally Active (true) - for programs with multiple mapped windows
- Globally Active Input (true) - global keybindings
The reason why sxiv should provide WM_HINTS is because its perfectly acceptable for WMs to assume "convenient" values when they are not set. My ICCCM compliant, tiling WM (which is very similar to dwm and xmonad) choose to not give sxiv focus which made it basically impossible to interact with it. Of course its trivial to tell the WM to give sxiv focus ahead of time, but wanted other people to not run it this problem.
@TAAPArthur could you please mention what window manager experiences problems with sxiv? i plan to mantain a sxiv fork, already merged this PR onto my fork but would like to know what window manager to add it into the changelog
@eylles I got the impression that the scenario was hypothetical and that this was added just out of principle.
@bakkeby welp he wrote My ICCCM compliant, tiling WM (which is very similar to dwm and xmonad) choose to not give mpv focus which made it basically impossible to interact with it. Of course its trivial to tell the WM to give sxiv focus ahead of time, but wanted other people to not run it this problem.
that means sxiv has a problem with whatever WM he uses thus i want to know which window manage is to properly document the changelog.
also it seems he goof'ed an wrote mpv instead of sxiv...
ahhh so he wrote a window manager, MPX Manager welp good to know
@eylles Yeah my bad. mpv had a similar problem and copied the description of the fix. Will correct.