Nobody is going to guess what I did (or just maybe, because I'm posting in this thread...), but anyways, now I can say this:
I've compiled a new mouse driver for Windows 3.1 on my pandora.
Ugh
So, I've written an absolute positioning mouse driver that is based on Windows 3.1 DDK sample mouse driver code and made modifications to dosbox for this hack to work properly, so I wont (atleast yet) be releasing the mouse driver source, but I think i can release a binary:
http://urjaman.dy.fi/MOUSE.DRV and while I'm at it, a new revision of winbox with some mouse code that might break many games (none tested), but works with my new driver:
http://urjaman.dy.fi/winbox_r2.pnd (the pnd includes a .tar.bz2 of the dosbox source used so I'm complying with dosbox licenses).
Usage: Run winbox_r2.pnd, create/pick a folder for your C drive, copy your W3.1 installation files in a directory there, run windows 3.1 install (the mouse might act weird with the original mouse driver, dont worry). Install with default options. After installation use the S3 driver patcher I posted above to create an S3 driver directory (or copy an old directory), run windows and change the video driver, point to C:\S3 (or whatever you picked). I picked 800x480 256C SF. When it asks for win.cnf point it to C:\WINDOWS\SYSTEM. It asks you to restart windows, I said later and exited windows (be sure to be in windowed mode when exiting windows). Then backup your MOUSE.DRV in C:\WINDOWS\SYSTEM (== cd windows\system + copy mouse.drv mouse.old). Drop my new MOUSE.DRV into the system folder. Then just run "win".
For old installations it should be enough to just replace the pnd and the mouse driver.
Known bugs: It sometimes unintentionally drags items, just clicking a few times on-the-spot should clear it.
I have to note that this is a huge hack. The mouse driver uses PS2 callback for mouse button data and int 33h,3 for positioning. Windows 3.1 wants absolute positions as values with the full range of 0-65535 that it maps into whatever the display width/height is. So I modified dosbox int 33h,3 to always return an absolute value between set min and max (mapped into the display width/height in use), and set min=0,max=8191, and had the mouse driver just do shl 3 on the values before returning them to windows. It works well enough for me so I thought I'd share this with people.