FVWM WindowList usability problem solution

One funny thing just happened. FVWM has function called WindowList which acts similar to Windows’ Alt+Tab. But unlike Alt+Tab, which displays some special fancy thing, WindowList displays simple menu, just like many others. It is good. What is bad is that when I use Alt+Tab to switch between menu items, FVWM also moves mouse pointer over them, just like it does for other menus. But for some reason, it does not return mouse pointer back to where it was before I pressed Alt+Tab. For other menus there is no such problem, so it may be just a bug. Anyway, it is bad because I often keep my mouse pointer at the edge of the screen, where it does not bother me. And then I press Alt+Tab and get it in the center of the screen! So I have to move it away each time, which is really frustrating.

But of course FVWM is open source. Any bug can be fixed by any developer in the world. So I tried to look at the sources a little, but understood that it will take me a lot of time and effort to understand what is going on there. Well, low-level X programming was never one of my strong points. I also tried to read the documentation, but found no option like “DontTouchMyMouse”.

Then I thought: well, maybe there is a way to save mouse position before displaying WindowList and restore it back when WindowList closes. I looked at the documentation more, but found out that although there are variables $[pointer.x] and $[pointer.y] containing just what I need, but there is no way to save and restore them. Strangely enough, FVWM configuration file allows a lot of programming, but no data manipulation except read-only access to predefined variables.

Then I looked at the FVWM modules and became interested in the FvwmPerl module. After reading documentation a little, I came up with the following solution:

It certainly does not look too complicated, does it? Although I think that using Perl is a little bit of an overkill, but hey, it works and works almost fine. By “almost” I mean that it would be very nice not to move mouse back if I used mouse to select window to switch to, not keyboard. Still have no idea how to do that, though. But it is still better to have choice between “move back” and “do not move back” instead of just “do not move”.

Leave a Reply