View Single Post
Old 06 May 2017, 18:49   #17
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,476
Aaargh. You'd think Microsoft would provide an easy way to reliably capture the mouse, wouldn't you?!?!

There's a problem when taskbar is set to auto-hide (at least on Windows 10 1703). When the taskbar is set to auto-hide, it reappears when the user moves the mouse to the very bottom of the screen.

With "Activate a window by hovering over it with the mouse" disabled (which is the default), with emulation window partly off the bottom of the desktop, the taskbar can reappear with the Windows mouse pointer over it, underneath the visible part of the emulation window. Right-clicking then fully uncaptures it.

With "Activate a window by hovering over it with the mouse" enabled, the mouse can become fully uncaptured without needing to right-click it.


My guess: when the taskbar is set to auto-hide (and is hidden), the work area rect is returned as the entire screen. So WinUAE clips the mouse to the work area, but that allows the Windows cursor to reach the very bottom of the screen, causing the taskbar to reappear. When it reappears WinUAE doesn't get the new work area (which may or may not still be the whole screen???) and change the mouse clip rect.

If re-enumerating displays on ABN_STATECHANGE isn't sufficient (e.g. maybe Windows doesn't send ABN_STATECHANGE when the taskbar appears/hides, but only when the user changes the auto-hide setting???), then you might have to mess with ABM_GETAUTOHIDEBAREX to find out which of the screen edges have auto-hiding toolbars, and restrict the mouse clip rect to not include those screen edges. Or could just never including any screen edges in the mouse clip rect be good enough?
mark_k is offline  
 
Page generated in 0.04937 seconds with 9 queries