Re: [AD] GUI kills OS cursor

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


On Mon, 2005-04-04 at 16:15 -0700, Chris wrote:
> Evert Glebbeek wrote:
> >>Now, my theory is that setting the OS cursor sets _mouse_screen to NULL, 
> >>and the subsequent call to show_mouse(gui_bmp) is ignored (you still get 
> >>the OS cursor).
> > 
> > 
> > I think it still sets _mouse_screen, but show_mouse() calls to anything 
> > other than the physical screen are ignored.
> 
> That might be it, then. If _mouse_screen gets set to screen (or NULL), 
> do_dialog will "save" that value, change to the buffer (and be ignored), 
> then it'll attempt to set _mouse_screen back to screen (or NULL) and 
> revert it back to software. I know calling show_mouse(NULL) turns off 
> the OS cursor (as it should), but I don't know what show_mouse(screen) 
> would do.
> 

I assume, it works with enable_hardware_cursor and select_mouse_cursor?
The problem is probably that show_os_cursor doesn't set something up..
as it isn't supposed to be used together with show_mouse. Anyway,
attached is a version of your patch which also disables the first
show_mouse call.. it makes things work - not sure about the implications
on all the scare_mouse calls though.

-- 
Elias Pschernig
Index: src/gui.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/gui.c,v
retrieving revision 1.73
diff -u -p -r1.73 gui.c
--- src/gui.c	31 Mar 2005 22:31:19 -0000	1.73
+++ src/gui.c	5 Apr 2005 10:56:59 -0000
@@ -779,7 +779,7 @@ int do_dialog(DIALOG *dialog, int focus_
    void *player;
    ASSERT(dialog);
 
-   if (!is_same_bitmap(_mouse_screen, gui_bmp))
+   if (!is_same_bitmap(_mouse_screen, gui_bmp) && !(gfx_capabilities&GFX_HW_CURSOR))
       show_mouse(gui_bmp);
 
    player = init_dialog(dialog, focus_obj);
@@ -792,7 +792,7 @@ int do_dialog(DIALOG *dialog, int focus_
          rest(1);
    }
 
-   if (_gfx_mode_set_count == screen_count)
+   if (_gfx_mode_set_count == screen_count && !(gfx_capabilities&GFX_HW_CURSOR))
       show_mouse(mouse_screen);
 
    return shutdown_dialog(player);


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