Mouse grab fixes

This commit is contained in:
Tony Jansson 2020-10-27 04:59:14 +02:00
parent 75abb44975
commit 58cb0286a8

View File

@ -15740,10 +15740,7 @@ static void command_event_reinit(struct rarch_state *p_rarch,
#ifdef HAVE_MENU #ifdef HAVE_MENU
p_rarch->dispgfx.framebuf_dirty = true; p_rarch->dispgfx.framebuf_dirty = true;
if (video_fullscreen) if (video_fullscreen)
{
input_driver_grab_mouse(p_rarch);
video_driver_hide_mouse(); video_driver_hide_mouse();
}
if (p_rarch->menu_driver_alive && p_rarch->current_video->set_nonblock_state) if (p_rarch->menu_driver_alive && p_rarch->current_video->set_nonblock_state)
p_rarch->current_video->set_nonblock_state( p_rarch->current_video->set_nonblock_state(
p_rarch->video_driver_data, false, p_rarch->video_driver_data, false,
@ -17068,13 +17065,15 @@ bool command_event(enum event_command cmd, void *data)
command_event(CMD_EVENT_REINIT, NULL); command_event(CMD_EVENT_REINIT, NULL);
if (video_fullscreen) if (video_fullscreen)
{ {
input_driver_grab_mouse(p_rarch);
video_driver_hide_mouse(); video_driver_hide_mouse();
if (!settings->bools.video_windowed_fullscreen)
input_driver_grab_mouse(p_rarch);
} }
else else
{ {
input_driver_ungrab_mouse(p_rarch);
video_driver_show_mouse(); video_driver_show_mouse();
if (!settings->bools.video_windowed_fullscreen)
input_driver_ungrab_mouse(p_rarch);
} }
p_rarch->rarch_is_switching_display_mode = false; p_rarch->rarch_is_switching_display_mode = false;
@ -19923,10 +19922,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
/* Hide mouse cursor in fullscreen mode */ /* Hide mouse cursor in fullscreen mode */
if (video_fullscreen) if (video_fullscreen)
{
input_driver_grab_mouse(p_rarch);
video_driver_hide_mouse(); video_driver_hide_mouse();
}
} }
break; break;
@ -20089,10 +20085,7 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
/* Hide mouse cursor in fullscreen after /* Hide mouse cursor in fullscreen after
* a RETRO_ENVIRONMENT_SET_SYSTEM_AV_INFO call. */ * a RETRO_ENVIRONMENT_SET_SYSTEM_AV_INFO call. */
if (video_fullscreen) if (video_fullscreen)
{
input_driver_grab_mouse(p_rarch);
video_driver_hide_mouse(); video_driver_hide_mouse();
}
return true; return true;
} }
@ -32513,8 +32506,9 @@ static bool video_driver_init_internal(bool *video_is_threaded)
if (video.fullscreen) if (video.fullscreen)
{ {
input_driver_grab_mouse(p_rarch);
video_driver_hide_mouse(); video_driver_hide_mouse();
if (!settings->bools.video_windowed_fullscreen)
input_driver_grab_mouse(p_rarch);
} }
return true; return true;