[AD] Hardware mouse not displayed in Windows

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


The attached patch fixes a problem in Windows where the hardware mouse 
cursor wasn't displayed until it was moved.
Apparently, Windows refuses to redraw the mouse cursor unless the mouse was 
moved, so I've faked a mouse movement event.

Evert
Index: src/win/wddraw.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/win/wddraw.c,v
retrieving revision 1.37
diff -u -r1.37 wddraw.c
--- src/win/wddraw.c	14 May 2005 15:54:52 -0000	1.37
+++ src/win/wddraw.c	11 Jun 2005 14:01:03 -0000
@@ -468,8 +468,11 @@
 int gfx_directx_show_mouse(struct BITMAP *bmp, int x, int y)
 {
    if (hcursor) {
+      POINT p;
       _win_hcursor = hcursor;
-      SetCursor(hcursor);
+      SetCursor(hcursor);
+      GetCursorPos(&p);
+      SetCursorPos(p.x, p.y);
       return 0;
    }
 


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