Re: [hatari-devel] Mouse pointer not reset when loading save state from menu

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


> What means "does not reset the mouse pointer"?

These lines are not run:

SDL_ShowCursor(bOldMouseVisibility);
Main_WarpMouse(nOldMouseX, nOldMouseY);

> Does this happen on Linux?  With which SDL version?
>
> As far as I can see from code, the cursor should be hidden
> whenever one exits from a dialog, except if one:
> * invoked file selector with keyboard shortcut
>  (not from one of the options dialog), AND
> * there was some kind of an error.
>
> (If there was an error, you should see some message in console.)
>
> Attached patch should fix that corner case.
> Does that help?

I went ahead and tracked down the exact location of the problem.  It's
not an error condition, and it will happen any time the SDL GUI is
used.

src/gui-sdl/dlgMain.c, line 123 (a return) causes Dialog_MainDlg to
skip the mouse restore at 168-169.  Duplicating those two lines just
before line 123 would be an adequate fix to the immediate problem
(though it suffers from the standard problems of duplicating code).

>> and not be aligned properly with the emulated mouse, potentially
>> rendering large segments of the emulated screen inaccessible.
>
> There's nothing guaranteeing sync (if some program e.g. interprets
> IKBD events differently for its own mouse).
>
> Only thing Hatari does is center the host cursor position to
> Hatari window whenever:
> * There's cold reset
> * Falcon changes screen size
>  (which can be pretty annoying when Falcon screen size
>   changes frequently like it does at boot)
>
> And restoring (after dialog closes) the position mouse had before
> error/notice/options dialog was opened.

Which is exactly why I suggest preventing the host cursor from
reaching the screen edge (e.g. by warping it to the center when it's
5% from the edge) during mouselock and fullscreen mode.  That way,
sync is no longer important, because the emulated cursor is not
restricted by the host window.  You can keep track of the warps to
make a "best effort" sync if the user enters non-mouselocked windowed
mode, but I submit that someone who wants mouselock or fullscreen once
will most likely want it whenever they're using the emulated cursor.



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