--- hatari/src/gui-sdl/dlgAlert.c 2019/04/09 08:48:53 1.1.1.8 +++ hatari/src/gui-sdl/dlgAlert.c 2019/04/09 08:55:56 1.1.1.11 @@ -131,6 +131,10 @@ static int DlgAlert_ShowDlg(const char * bool bOldMouseVisibility; int nOldMouseX, nOldMouseY; +#if WITH_SDL2 + bool bOldMouseMode = SDL_GetRelativeMouseMode(); + SDL_SetRelativeMouseMode(SDL_FALSE); +#endif strcpy(t, text); lines = DlgAlert_FormatTextToBox(t, maxlen, &len); offset = (maxlen-len)/2; @@ -160,11 +164,15 @@ static int DlgAlert_ShowDlg(const char * bOldMouseVisibility = SDL_ShowCursor(SDL_QUERY); SDL_ShowCursor(SDL_ENABLE); - i = SDLGui_DoDialog(alertdlg, NULL); + i = SDLGui_DoDialog(alertdlg, NULL, false); SDL_UpdateRect(sdlscrn, 0,0, 0,0); SDL_ShowCursor(bOldMouseVisibility); - Main_WarpMouse(nOldMouseX, nOldMouseY); + Main_WarpMouse(nOldMouseX, nOldMouseY, true); + +#if WITH_SDL2 + SDL_SetRelativeMouseMode(bOldMouseMode); +#endif return (i == DLGALERT_OK); } @@ -176,14 +184,18 @@ static int DlgAlert_ShowDlg(const char * */ int DlgAlert_Notice(const char *text) { -#ifdef ALERT_HOOKS - return HookedAlertNotice(text); +#ifdef ALERT_HOOKS + if (!Main_UnPauseEmulation()) + Main_PauseEmulation(true); + if(!bInFullScreen) + return HookedAlertNotice(text); #endif /* Hide "cancel" button: */ alertdlg[DLGALERT_CANCEL].type = SGTEXT; alertdlg[DLGALERT_CANCEL].txt = ""; - alertdlg[DLGALERT_CANCEL].w = alertdlg[DLGALERT_CANCEL].w = 0; + alertdlg[DLGALERT_CANCEL].w = 0; + alertdlg[DLGALERT_CANCEL].h = 0; /* Adjust button position: */ alertdlg[DLGALERT_OK].x = (alertdlg[0].w - alertdlg[DLGALERT_OK].w) / 2; @@ -199,7 +211,8 @@ int DlgAlert_Notice(const char *text) int DlgAlert_Query(const char *text) { #ifdef ALERT_HOOKS - return HookedAlertQuery(text); + if(!bInFullScreen) + return HookedAlertQuery(text); #endif /* Show "cancel" button: */