I have gotten my hands on the source code for fvwm 1.2, and I am trying to modify it to be able to switch between the Click to Focus and Focus Follows Mouse input focus policies without restarting fvwm. And I have made it work, sort of, but there is one remaining issue.
My new function added to fvwm.c is activated by sending a USR2 signal to iwm, and changes input focus to Click to Focus like this:
Scr.TheList->off_flags |= CLICK_FOCUS_FLAG;
Scr.TheList->on_flags |= SLOPPY_FOCUS_FLAG;
Which makes all the windows opened after this use Click to Focus. But not the already existing windows. So then I added:
CaptureAllWindows();
And then the new policy applies to the existing windows as well. Goody.
Except that the CaptureAllWindows function unmaps/maps the windows, making the desktop “flash”. And I need to avoid this flashing. The function probably does more than I need.
So my question is: Is there a way to apply the input focus policy on existing windows without unmapping them first?