Re: [hatari-devel] Mouse pointer not reset when loading save state from menu |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] Mouse pointer not reset when loading save state from menu
- From: Charlie Nolan <funnyman3595@xxxxxxxxx>
- Date: Mon, 18 Jun 2012 21:40:33 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=BJNfuxmg0iCWK0rQUX4A0DnHRSnxUWf3VMwwiNBwFsE=; b=0VWSfZtDxnRrQX30sCe/r9uw7ap/WD6DWULspgkNxww+/jdE2YGBUvE/1qpt+j1TJK AyBdqaT3cjKmB8xxPr8nO6j73tq1+1W94GSSsdsxh1PtBw2dJ7F8HwYzCApCZC4T/xoB 4Izyo3Vtd0I99kJW2yWhUPbjSLA6CJpjW4mpzdeygo94sF5Z+TiMzccXTtpFNy27OiXV lg7sbA8LhGIfyAamoSiKq99qBF20rgusnyKr3bLCC1TeCFUGEMkn4TjY6J9F4QBXEfoB +NeaRTS6UpoWU7beJ9HsNXA40vv7H0giyewb3XzoY3bGEqXgCDS1Gf0XLQ/jSV4f4B8j jRww==
> 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.