Only re-grab the mouse if the user clicks on the emulator screen

This commit is contained in:
Dimitris Panokostas 2020-07-07 22:18:21 +02:00
parent 87114c325d
commit 135c8b2de8

View file

@ -1605,7 +1605,7 @@ void process_event(SDL_Event event)
case SDL_WINDOWEVENT_ENTER:
case SDL_WINDOWEVENT_FOCUS_GAINED:
mouseinside = true;
set_mouse_grab(true);
break;
case SDL_WINDOWEVENT_LEAVE:
case SDL_WINDOWEVENT_FOCUS_LOST:
@ -1758,6 +1758,8 @@ void process_event(SDL_Event event)
break;
case SDL_MOUSEBUTTONDOWN:
if (mouseinside && event.button.button == SDL_BUTTON_LEFT)
set_mouse_grab(true);
if (currprefs.jports[0].id == JSEM_MICE || currprefs.jports[1].id == JSEM_MICE)
{
if (event.button.button == SDL_BUTTON_LEFT)