Re: [AD] Using system mouse cursor

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


Ok, revised patch attached (sans documentation).
This doesn't yet include more than the standard mouse pointer, although it 
should be easy to add other default pointers. set_mouse_sprite() is 
deprecated, although I haven't yet marked it as such not moved it to the 
compatibility header.
This patch once again contains a patch for the grabber as a test case.

The way this currently works is as follows: MOUSE_CURSOR_otherthanAllegro 
allows you to specify a custom cursor to use, but it will use the window 
manager cursor by default. Pass NULL to get Allegro's cursor if the native 
cursor doesn't work.
Use MOUSE_CURSOR_ALLEGRO if you don't ever want to use the native cursors: 
this will always be a custom pointer, although it can be drawn either by 
Allegro, or by the operating system as a hardware cursor.

> Heh, just what I was thinking. Since the GUI has messages for
> [de]activation of everything, it should be fairly simple to add.
> Probably just fill in two messages to d_edit_proc to have it switch to
> an edit cursor :)

Yeah; shouldn't be too hard. Although we should probably only do that if 
the current cursor is not the Allegro cursor (custom cursor). That should 
be easy enough to check for too though.

Evert
Index: include/allegro/mouse.h
===================================================================
RCS file: /cvsroot/alleg/allegro/include/allegro/mouse.h,v
retrieving revision 1.3
diff -u -r1.3 mouse.h
--- include/allegro/mouse.h	25 Sep 2004 08:17:01 -0000	1.3
+++ include/allegro/mouse.h	30 Sep 2004 20:01:30 -0000
@@ -44,7 +44,8 @@
    AL_METHOD(void, set_speed, (int xspeed, int yspeed));
    AL_METHOD(void, get_mickeys, (int *mickeyx, int *mickeyy));
    AL_METHOD(int,  analyse_data, (AL_CONST char *buffer, int size));
-   AL_METHOD(void,  enable_hardware_cursor, (AL_CONST int mode));
+   AL_METHOD(void, enable_hardware_cursor, (AL_CONST int mode));
+   AL_METHOD(int,  select_os_cursor, (AL_CONST int cursor));
 } MOUSE_DRIVER;
 
 
@@ -61,6 +62,15 @@
 AL_FUNC(void, enable_hardware_cursor, (void));
 AL_FUNC(void, disable_hardware_cursor, (void));
 
+/* Mouse cursors */
+#define MOUSE_CURSOR_ALLEGRO     0
+#define MOUSE_CURSOR_NONE        0
+#define MOUSE_CURSOR_ARROW       1
+#define MOUSE_CURSOR_BUSY        2
+#define MOUSE_CURSOR_QUESTION    3
+#define MOUSE_CURSOR_EDIT        4
+#define NUM_MOUSE_CURSORS        5
+
 AL_VAR(struct BITMAP *, mouse_sprite);
 AL_VAR(int, mouse_x_focus);
 AL_VAR(int, mouse_y_focus);
@@ -92,10 +102,13 @@
 AL_FUNC(void, position_mouse_z, (int z));
 AL_FUNC(void, set_mouse_range, (int x1, int y1, int x2, int y2));
 AL_FUNC(void, set_mouse_speed, (int xspeed, int yspeed));
-AL_FUNC(void, set_mouse_sprite, (struct BITMAP *sprite));
+AL_FUNC(void, set_mouse_cursor, (AL_CONST int cursor, struct BITMAP *sprite));
+AL_FUNC(void, select_mouse_cursor, (AL_CONST int cursor));
 AL_FUNC(void, set_mouse_sprite_focus, (int x, int y));
 AL_FUNC(void, get_mouse_mickeys, (int *mickeyx, int *mickeyy));
 
+
+AL_FUNC(void, set_mouse_sprite, (struct BITMAP *sprite));
 #ifdef __cplusplus
    }
 #endif
Index: src/mouse.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/mouse.c,v
retrieving revision 1.25
diff -u -r1.25 mouse.c
--- src/mouse.c	25 Sep 2004 11:47:27 -0000	1.25
+++ src/mouse.c	30 Sep 2004 20:01:31 -0000
@@ -74,7 +74,7 @@
 #define DEFAULT_SPRITE_W   10          /* default arrow cursor */
 #define DEFAULT_SPRITE_H   16
 
-static char mouse_pointer_data[DEFAULT_SPRITE_H][DEFAULT_SPRITE_W] =
+static char mouse_arrow_data[DEFAULT_SPRITE_H][DEFAULT_SPRITE_W] =
 {
    { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
    { 1, 2, 1, 0, 0, 0, 0, 0, 0, 0 },
@@ -101,6 +101,9 @@
 
 BITMAP *_mouse_screen = NULL;          /* where to draw the pointer */
 
+static BITMAP *cursors[NUM_MOUSE_CURSORS];
+
+static int use_os_cursor = FALSE;      /* Use native cursor? */
 static int got_hw_cursor = FALSE;      /* hardware pointer available? */
 static int hw_cursor_dirty = FALSE;    /* need to set a new pointer? */
 
@@ -366,7 +369,7 @@
  *  Creates the default arrow mouse sprite using the current color depth
  *  and palette.
  */
-static BITMAP *create_mouse_pointer(void)
+static BITMAP *create_mouse_pointer(char data[][DEFAULT_SPRITE_W])
 {
    BITMAP *bmp;
    int x, y;
@@ -376,7 +379,7 @@
 
    for (y=0; y<DEFAULT_SPRITE_H; y++) {
       for (x=0; x<DEFAULT_SPRITE_W; x++) {
-	 switch (mouse_pointer_data[y][x]) {
+	 switch (data[y][x]) {
 	    case 1:  col = makecol(255, 255, 255);  break;
 	    case 2:  col = makecol(0, 0, 0);        break;
 	    default: col = bmp->vtable->mask_color; break;
@@ -396,12 +399,23 @@
  */
 void set_mouse_sprite(struct BITMAP *sprite)
 {
+   set_mouse_cursor(MOUSE_CURSOR_ALLEGRO, sprite);
+}
+
+
+
+/* _set_mouse_sprite:
+ *  Sets the sprite to be used for the mouse pointer. If the sprite is
+ *  NULL, restores the default arrow.
+ */
+static void _set_mouse_sprite(BITMAP *sprite, char data[][DEFAULT_SPRITE_W])
+{
    BITMAP *old_mouse_screen = _mouse_screen;
 
    if (!mouse_driver)
       return;
 
-   if (_mouse_screen)
+   if (_mouse_screen && !(gfx_capabilities & GFX_HW_CURSOR))
       show_mouse(NULL);
 
    if (sprite)
@@ -409,7 +423,7 @@
    else {
       if (_mouse_pointer)
 	 destroy_bitmap(_mouse_pointer);
-      _mouse_pointer = create_mouse_pointer();
+      _mouse_pointer = create_mouse_pointer(data);
       mouse_sprite = _mouse_pointer;
    }
 
@@ -435,12 +449,51 @@
 
    hw_cursor_dirty = TRUE;
 
-   if (old_mouse_screen)
+   if (old_mouse_screen && !(gfx_capabilities & GFX_HW_CURSOR))
       show_mouse(old_mouse_screen);
 }
 
 
 
+/* set_mouse_cursor:
+ *  Sets the default cursor shape. If this is NULL, the hardware cursor
+ *  will be used instead.
+ */
+void set_mouse_cursor(AL_CONST int cursor, BITMAP *sprite)
+{
+   ASSERT(cursor < NUM_MOUSE_CURSORS);
+   
+   cursors[cursor] = sprite;
+}
+
+
+
+
+/* select_mouse_cursor:
+ *  Selects the shape of the mouse cursor.
+ */
+void select_mouse_cursor(AL_CONST int cursor)
+{
+   ASSERT(cursor < NUM_MOUSE_CURSORS);
+   
+   use_os_cursor = 0;
+   if (!cursors[cursor] || cursor != MOUSE_CURSOR_ALLEGRO) {
+      /* Use default system cursor */
+      if (mouse_driver && mouse_driver->select_os_cursor) {
+         use_os_cursor = mouse_driver->select_os_cursor(cursor);
+         if (use_os_cursor)
+            gfx_capabilities |= GFX_HW_CURSOR;
+      }
+   }
+   
+   if (!use_os_cursor) {
+      _set_mouse_sprite(cursors[cursor], mouse_arrow_data);
+   }
+}
+
+
+
+
 /* set_mouse_sprite_focus:
  *  Sets co-ordinate (x, y) in the sprite to be the mouse location.
  *  Call after set_mouse_sprite(). Doesn't redraw the sprite.
@@ -463,13 +516,11 @@
  *  module is active. The mouse pointer will be drawn onto the bitmap bmp, 
  *  which should normally be the hardware screen. To turn off the mouse 
  *  pointer, which you must do before you draw anything onto the screen, call 
- *  show_mouse(NULL). If you forget to turn off the mouse pointer when 
- *  drawing something, the SVGA bank switching code will become confused and 
- *  will produce garbage all over the screen.
+ *  show_mouse(NULL).
  */
 void show_mouse(BITMAP *bmp)
 {
-   if (!mouse_driver)
+   if (!mouse_driver || use_os_cursor)
       return;
 
    remove_int(mouse_move);
@@ -871,7 +922,7 @@
    LOCK_VARIABLE(mouse_x_focus);
    LOCK_VARIABLE(mouse_y_focus);
    LOCK_VARIABLE(mouse_sprite);
-   LOCK_VARIABLE(mouse_pointer_data);
+   LOCK_VARIABLE(mouse_arrow_data);
    LOCK_VARIABLE(_mouse_pointer);
    LOCK_VARIABLE(_mouse_screen);
    LOCK_VARIABLE(mx);
@@ -880,6 +931,7 @@
    LOCK_VARIABLE(mtemp);
    LOCK_VARIABLE(mouse_polled);
    LOCK_VARIABLE(mouse_semaphore);
+   LOCK_VARIABLE(use_os_cursor);
    LOCK_FUNCTION(draw_mouse_doublebuffer);
    LOCK_FUNCTION(draw_mouse);
    LOCK_FUNCTION(update_mouse);
@@ -941,6 +993,9 @@
    else {
       emulate_three = FALSE;
    }
+   
+   for (i=0; i<NUM_MOUSE_CURSORS; i++)
+      cursors[i] = NULL;
 
    mouse_polled = (mouse_driver->poll) ? TRUE : FALSE;
 
Index: src/beos/bmouse.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/beos/bmouse.c,v
retrieving revision 1.4
diff -u -r1.4 bmouse.c
--- src/beos/bmouse.c	25 Sep 2004 08:16:58 -0000	1.4
+++ src/beos/bmouse.c	30 Sep 2004 20:01:31 -0000
@@ -39,5 +39,6 @@
    be_mouse_set_speed,	// AL_METHOD(void, set_speed, (int xspeed, int yspeed));
    be_mouse_get_mickeys,// AL_METHOD(void, get_mickeys, (int *mickeyx, int *mickeyy));
    NULL,                // AL_METHOD(int,  analyse_data, (const char *buffer, int size));
-   NULL                 // AL_METHOD(void,  enable_hardware_cursor, (AL_CONST int mode));
+   NULL,                // AL_METHOD(void,  enable_hardware_cursor, (AL_CONST int mode));
+   NULL                 // AL_METHOD(int,  select_os_cursor, (AL_CONST int cursor));
 };
Index: src/dos/dmouse.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/dos/dmouse.c,v
retrieving revision 1.6
diff -u -r1.6 dmouse.c
--- src/dos/dmouse.c	25 Sep 2004 08:16:59 -0000	1.6
+++ src/dos/dmouse.c	30 Sep 2004 20:01:31 -0000
@@ -96,6 +96,7 @@
    mick_set_speed,
    mick_get_mickeys,
    NULL,
+   NULL,
    NULL
 };
 
Index: src/linux/lmseev.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/linux/lmseev.c,v
retrieving revision 1.6
diff -u -r1.6 lmseev.c
--- src/linux/lmseev.c	8 Sep 2004 10:32:48 -0000	1.6
+++ src/linux/lmseev.c	30 Sep 2004 20:01:33 -0000
@@ -681,7 +681,9 @@
    mouse_set_range,
    mouse_set_speed,
    mouse_get_mickeys,
-   analyse_data
+   analyse_data,
+   NULL,
+   NULL
 };
 
 #endif
Index: src/linux/lmsegpmd.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/linux/lmsegpmd.c,v
retrieving revision 1.11
diff -u -r1.11 lmsegpmd.c
--- src/linux/lmsegpmd.c	23 Jan 2003 16:22:57 -0000	1.11
+++ src/linux/lmsegpmd.c	30 Sep 2004 20:01:33 -0000
@@ -140,6 +140,8 @@
 	__al_linux_mouse_set_range,
 	__al_linux_mouse_set_speed,
 	__al_linux_mouse_get_mickeys,
-	NULL  /* analyse_data */
+	NULL,  /* analyse_data */
+        NULL,
+        NULL
 };
 
Index: src/linux/lmsems.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/linux/lmsems.c,v
retrieving revision 1.12
diff -u -r1.12 lmsems.c
--- src/linux/lmsems.c	23 Jan 2003 16:22:57 -0000	1.12
+++ src/linux/lmsems.c	30 Sep 2004 20:01:33 -0000
@@ -223,7 +223,9 @@
 	__al_linux_mouse_set_range,
 	__al_linux_mouse_set_speed,
 	__al_linux_mouse_get_mickeys,
-	analyse_data
+	analyse_data,
+        NULL,
+        NULL
 };
 
 MOUSE_DRIVER mousedrv_linux_ims =
Index: src/linux/lmseps2.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/linux/lmseps2.c,v
retrieving revision 1.15
diff -u -r1.15 lmseps2.c
--- src/linux/lmseps2.c	14 Mar 2003 05:05:10 -0000	1.15
+++ src/linux/lmseps2.c	30 Sep 2004 20:01:33 -0000
@@ -240,7 +240,9 @@
 	__al_linux_mouse_set_range,
 	__al_linux_mouse_set_speed,
 	__al_linux_mouse_get_mickeys,
-	analyse_data
+	analyse_data,
+        NULL,
+        NULL
 };
 
 MOUSE_DRIVER mousedrv_linux_ips2 =
@@ -257,5 +259,7 @@
 	__al_linux_mouse_set_range,
 	__al_linux_mouse_set_speed,
 	__al_linux_mouse_get_mickeys,
-	analyse_data
+	analyse_data,
+        NULL,
+        NULL
 };
Index: src/mac/madb.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/mac/madb.c,v
retrieving revision 1.4
diff -u -r1.4 madb.c
--- src/mac/madb.c	6 Nov 2001 17:16:40 -0000	1.4
+++ src/mac/madb.c	30 Sep 2004 20:01:33 -0000
@@ -90,6 +90,7 @@
       mouse_adb_set_range,
       NULL,
       mouse_adb_get_mickeys,
+      NULL,
       NULL
 };
 
Index: src/mac/msys.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/mac/msys.c,v
retrieving revision 1.14
diff -u -r1.14 msys.c
--- src/mac/msys.c	2 Jul 2004 16:25:41 -0000	1.14
+++ src/mac/msys.c	30 Sep 2004 20:01:33 -0000
@@ -122,6 +122,7 @@
    NULL,
    NULL,
    NULL,
+   NULL,
    NULL
 };
 
Index: src/macosx/qzmouse.m
===================================================================
RCS file: /cvsroot/alleg/allegro/src/macosx/qzmouse.m,v
retrieving revision 1.12
diff -u -r1.12 qzmouse.m
--- src/macosx/qzmouse.m	25 Sep 2004 08:16:59 -0000	1.12
+++ src/macosx/qzmouse.m	30 Sep 2004 20:01:33 -0000
@@ -47,7 +47,8 @@
    NULL,       // AL_METHOD(void, set_speed, (int xspeed, int yspeed));
    osx_mouse_get_mickeys,
    NULL,       // AL_METHOD(int,  analyse_data, (AL_CONST char *buffer, int size));
-   NULL        // AL_METHOD(void,  enable_hardware_cursor, (AL_CONST int mode));
+   NULL,       // AL_METHOD(void,  enable_hardware_cursor, (AL_CONST int mode));
+   NULL        // AL_METHOD(int,  select_os_cursor, (AL_CONST int cursor));
 };
 
 
Index: src/qnx/qmouse.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/qnx/qmouse.c,v
retrieving revision 1.11
diff -u -r1.11 qmouse.c
--- src/qnx/qmouse.c	25 Sep 2004 08:17:00 -0000	1.11
+++ src/qnx/qmouse.c	30 Sep 2004 20:01:33 -0000
@@ -49,7 +49,8 @@
    NULL,       // AL_METHOD(void, set_speed, (int xspeed, int yspeed));
    qnx_mouse_get_mickeys,
    NULL,       // AL_METHOD(int,  analyse_data, (AL_CONST char *buffer, int size));
-   NULL        // AL_METHOD(void,  enable_hardware_cursor, (AL_CONST int mode));
+   NULL,       // AL_METHOD(void,  enable_hardware_cursor, (AL_CONST int mode));
+   NULL        // AL_METHOD(int,  select_os_cursor, (AL_CONST int cursor));
 };
 
 
Index: src/win/wddraw.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/win/wddraw.c,v
retrieving revision 1.33
diff -u -r1.33 wddraw.c
--- src/win/wddraw.c	25 Sep 2004 08:23:15 -0000	1.33
+++ src/win/wddraw.c	30 Sep 2004 20:01:34 -0000
@@ -384,6 +384,8 @@
    HBITMAP hOldXorMaskBitmap;
 
    if (hcursor) {
+      if (_win_hcursor == hcursor)
+         _win_hcursor = NULL;
       DestroyIcon(hcursor);
       hcursor = NULL;
    }
Index: src/win/wmouse.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/win/wmouse.c,v
retrieving revision 1.36
diff -u -r1.36 wmouse.c
--- src/win/wmouse.c	25 Sep 2004 08:23:15 -0000	1.36
+++ src/win/wmouse.c	30 Sep 2004 20:01:35 -0000
@@ -46,7 +46,7 @@
 static void mouse_directx_set_range(int x1, int y1, int x2, int y2);
 static void mouse_directx_set_speed(int xspeed, int yspeed);
 static void mouse_directx_get_mickeys(int *mickeyx, int *mickeyy);
-
+static int mouse_directx_select_os_cursor(AL_CONST int cursor);
 
 MOUSE_DRIVER mouse_directx =
 {
@@ -63,7 +63,8 @@
    mouse_directx_set_speed,
    mouse_directx_get_mickeys,
    NULL,                       // AL_METHOD(int, analyse_data, (AL_CONST char *buffer, int size));
-   NULL                        // AL_METHOD(void,  enable_hardware_cursor, (AL_CONST int mode));
+   NULL,                       // AL_METHOD(void,  enable_hardware_cursor, (AL_CONST int mode));
+   mouse_directx_select_os_cursor
 };
 
 
@@ -748,3 +749,36 @@
    *mickeyy = temp_y;
 }
 
+
+
+/* mouse_directx_select_os_cursor:
+ *  Select an OS native cursor 
+ */
+static int mouse_directx_select_os_cursor (AL_CONST int cursor)
+{
+   HCURSOR wc;
+   
+   wc = NULL;
+   switch(cursor) {
+      case MOUSE_CURSOR_ARROW:
+         wc = LoadCursor(NULL, IDC_ARROW);
+         break;
+      case MOUSE_CURSOR_BUSY:
+         wc = LoadCursor(NULL, IDC_WAIT);
+         break;
+      case MOUSE_CURSOR_QUESTION:
+         wc = LoadCursor(NULL, IDC_HELP);
+         break;
+      case MOUSE_CURSOR_EDIT:
+         wc = LoadCursor(NULL, IDC_IBEAM);
+         break;
+      default:
+         return 0;
+   }
+
+   _win_hcursor = wc;
+   SetCursor(_win_hcursor);
+   PostMessage(allegro_wnd, WM_MOUSEMOVE, 0, 0);
+   
+   return cursor;
+}
Index: src/x/xmouse.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/x/xmouse.c,v
retrieving revision 1.7
diff -u -r1.7 xmouse.c
--- src/x/xmouse.c	25 Sep 2004 08:33:31 -0000	1.7
+++ src/x/xmouse.c	30 Sep 2004 20:01:35 -0000
@@ -20,7 +20,7 @@
 #include "allegro/internal/aintern.h"
 #include "allegro/platform/aintunix.h"
 #include "xwin.h"
-
+#include <X11/cursorfont.h>
 
 /* TRUE if the requested mouse range extends beyond the regular
  * (0, 0, SCREEN_W-1, SCREEN_H-1) range. This is aimed at detecting
@@ -48,7 +48,7 @@
 static void _xwin_mousedrv_set_range(int x1, int y1, int x2, int y2);
 static void _xwin_mousedrv_set_speed(int xspeed, int yspeed);
 static void _xwin_mousedrv_get_mickeys(int *mickeyx, int *mickeyy);
-
+static int _xwin_select_os_cursor(AL_CONST int cursor);
 
 static MOUSE_DRIVER mouse_xwin =
 {
@@ -65,7 +65,8 @@
    _xwin_mousedrv_set_speed,
    _xwin_mousedrv_get_mickeys,
    NULL,
-   _xwin_enable_hardware_cursor
+   _xwin_enable_hardware_cursor,
+   _xwin_select_os_cursor
 };
 
 
@@ -214,3 +215,37 @@
    _xwin_set_warped_mouse_mode(TRUE);
 }
 
+
+
+/* _xwin_select_os_cursor:
+ *  Select an OS native cursor 
+ */
+static int _xwin_select_os_cursor(AL_CONST int cursor)
+{
+   switch(cursor) {
+      case MOUSE_CURSOR_ARROW:
+         _xwin.cursor_shape = XC_left_ptr;
+         break;
+      case MOUSE_CURSOR_BUSY:
+         _xwin.cursor_shape = XC_watch;
+         break;
+      case MOUSE_CURSOR_QUESTION:
+         _xwin.cursor_shape = XC_question_arrow;
+         break;
+      case MOUSE_CURSOR_EDIT:
+         _xwin.cursor_shape = XC_xterm;
+         break;
+      default:
+         return 0;
+   }
+   
+   if (_xwin.cursor != None) {
+      XUndefineCursor(_xwin.display, _xwin.window);
+      XFreeCursor(_xwin.display, _xwin.cursor);
+   }   
+
+   _xwin.cursor = XCreateFontCursor(_xwin.display, _xwin.cursor_shape);
+   XDefineCursor(_xwin.display, _xwin.window, _xwin.cursor);
+   
+   return cursor;
+}
Index: tools/grabber.c
===================================================================
RCS file: /cvsroot/alleg/allegro/tools/grabber.c,v
retrieving revision 1.72
diff -u -r1.72 grabber.c
--- tools/grabber.c	2 Jul 2004 09:46:28 -0000	1.72
+++ tools/grabber.c	30 Sep 2004 20:01:38 -0000
@@ -881,11 +881,11 @@
 static void set_busy_mouse(int busy)
 {
    if (busy) {
-      set_mouse_sprite(my_busy_pointer);
+      select_mouse_cursor(MOUSE_CURSOR_BUSY);
       busy_mouse = TRUE;
    }
    else {
-      set_mouse_sprite(my_mouse_pointer);
+      select_mouse_cursor(MOUSE_CURSOR_ARROW);
       busy_mouse = FALSE;
    }
 }
@@ -935,6 +935,9 @@
 	 putpixel(my_busy_pointer, x, y, c);
       }
    }
+   
+   set_mouse_cursor(MOUSE_CURSOR_BUSY, my_busy_pointer);
+   set_mouse_cursor(MOUSE_CURSOR_ARROW, my_mouse_pointer);
 
    set_busy_mouse(FALSE);
 }
@@ -3488,12 +3491,12 @@
    vsprintf(buf, fmt, args);
    va_end(args);
 
-   set_mouse_sprite(my_mouse_pointer);
+   select_mouse_cursor(MOUSE_CURSOR_ARROW);
 
    alert(buf, NULL, NULL, "Oh dear", NULL, 13, 0);
 
    if (busy_mouse)
-      set_mouse_sprite(my_busy_pointer);
+      select_mouse_cursor(MOUSE_CURSOR_BUSY);
 }
 
 
@@ -3511,12 +3514,12 @@
 
    strcat(buf, "?");
 
-   set_mouse_sprite(my_mouse_pointer);
+   select_mouse_cursor(MOUSE_CURSOR_ARROW);
 
    ret = alert(buf, NULL, NULL, "Yes", "Cancel", 'y', 27);
 
    if (busy_mouse)
-      set_mouse_sprite(my_busy_pointer);
+      select_mouse_cursor(MOUSE_CURSOR_BUSY);
 
    if (ret == 1)
       return 'y';


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