Re: [AD] Using system mouse cursor

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


> Which is the problem. I thought we were trying to get away from having 
> an implicit "mickey mode" for the mouse by making it explicit via 
> enabling/disabling the hardware cursor.

Personally, I think those are (logically) seperate issues. The way I see
it, we would have the following:
 - software mouse, with implicit warping (current default)
 - software mouse, with explicit warping or without
 - hardware mouse, no warping
when warping is disabled, mouse mickeys are unreliable.

> They're going to end up being connected, though.. since the hardware 
> cursor can't coexist with proper mouse mickeys (if you have a hardware 
> cursor, you can't have proper mouse mickeys, and vice versa.. in X at 
> the very least).

Yes. I'd rather get the hardware cursor stabilized first though and then
work on modifying the explicit/implicit cursor warping hack for X11.

> If the software cursor is default, you'll create an app that locks the 
> mouse to the window by default (when using windowed modes.. fullscreen 
> is completely unaffected) which can be undone by enabling the hardware 
> cursor (which doesn't even have to show anything.. show_mouse(NULL)).

But existing code won't know about this. I think optionally changing
behavior is ok, but not default behavior.

> If the hardware cursor is default, you'll slightly break the API by 
> making get_mouse_mickeys not do what the docs say, which it was supposed
> to do this whole time (pre-4.0), without resorting to potentially buggy
> hacks.

The problem is, there is no way to get reliable mickeys under X. All
programs that need this basically resort to the same hack we do (I've
checked discussions about SDL and DOOM perticularly, as those are the links
that pop up most in google, besides links related to Allegro).
I was trying to get Allegro's mouse to work properly under Wine yesterday,
but I couldn't get it to work: the cursor is stuck at the centre of the
window. I think it's the same problem: Wine traps the cursor at the centre
of the screen (it does work in fullscreen mode though).

> There can be limited mickeys with the hardware mouse.. just leave it 
> undefined at the screen's edge. Although, perhaps the entire GUI may be
> a bad idea.. the file selector/alert boxes/etc should be fine though 
> since Allegro has total control over those.

I'm ok with this modification, but we should check if a mouse cursor is
currently being displayed. If not, safe the hard/software mode setting,
enable the hardware cursor, and restore the previous setting at the end.

> How would you do this without a(nother) timer?

My first thought was to modify the way the cursor warping is currently done
in X, which is done from the input thread (I think) and already waits
before doing repeated warps. An alternate hack would be to use the
retrace_count variable, but that would be less than ideal IMO.

Evert




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