Mapster32: call AppGrabMouse() on show/retract OSD like in the game.

This is necessary to hide the mouse cursor in some settings (such as
with the debug build under Xfce). DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@5321 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2015-08-08 11:03:07 +00:00
parent e8623165a7
commit 0dc20f913c

View file

@ -552,6 +552,11 @@ void M32_DrawRoomsAndMasks(void)
} }
} }
void M32_OnShowOSD(int32_t shown)
{
AppGrabMouse((!shown) + 2);
}
int32_t app_main(int32_t argc, const char **argv) int32_t app_main(int32_t argc, const char **argv)
{ {
#ifdef STARTUP_SETUP_WINDOW #ifdef STARTUP_SETUP_WINDOW
@ -620,7 +625,7 @@ int32_t app_main(int32_t argc, const char **argv)
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
COMMON_clearbackground, COMMON_clearbackground,
BGetTime, BGetTime,
NULL M32_OnShowOSD
); );
OSD_SetParameters(0,2, 0,0, 4,0); OSD_SetParameters(0,2, 0,0, 4,0);
@ -738,6 +743,7 @@ int32_t app_main(int32_t argc, const char **argv)
updatesector(pos.x,pos.y,&cursectnum); updatesector(pos.x,pos.y,&cursectnum);
setkeypresscallback(&m32_keypresscallback); setkeypresscallback(&m32_keypresscallback);
M32_OnShowOSD(0); // make sure the desktop's mouse cursor is hidden
if (cursectnum == -1) if (cursectnum == -1)
{ {