Re: [AD] [ alleg-Bugs-2431768 ] display field for mouse state

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 17-Dec-08, at 12:43 AM, Peter Wang wrote:
The display field is not set to NULL when the cursor leaves our windows.

Ah, true.
Revised improved patch attached (untested except for OS X). The X11 and OS X ports behave the same: as soon as a window receives a mouse- enters event, the mouse window is set to this window. When a mouse- leaves event is received the mouse window is set to NULL. The windows code is unchanged from the previous patch; I can't figure out how to do this in the same way for Windows, but it may not matter since on Windows top window = key window = mouse window. What this patch fails to do is keep the value of mouse window if a button is held down while the mouse leaves the window (so the mouse window is set to NULL at that point). This shouldn't be hard to fix, but it requires some book keeping.

Test program attached, if you need one ;)

Yup, quite useful, thanks :)

Evert

Attachment: mouse_display.diff
Description: Binary data




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/