Remove video_driver_show_mouse/hide_mouse
This commit is contained in:
parent
cedcd70c63
commit
c24744eae5
|
@ -2108,7 +2108,11 @@ void command_event_reinit(const int flags)
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
p_disp->flags |= GFX_DISP_FLAG_FB_DIRTY;
|
p_disp->flags |= GFX_DISP_FLAG_FB_DIRTY;
|
||||||
if (video_fullscreen)
|
if (video_fullscreen)
|
||||||
video_driver_hide_mouse();
|
{
|
||||||
|
if ( video_st->poke
|
||||||
|
&& video_st->poke->show_mouse)
|
||||||
|
video_st->poke->show_mouse(video_st->data, false);
|
||||||
|
}
|
||||||
if ( (menu_st->flags & MENU_ST_FLAG_ALIVE)
|
if ( (menu_st->flags & MENU_ST_FLAG_ALIVE)
|
||||||
&& video_st->current_video->set_nonblock_state)
|
&& video_st->current_video->set_nonblock_state)
|
||||||
video_st->current_video->set_nonblock_state(
|
video_st->current_video->set_nonblock_state(
|
||||||
|
|
|
@ -481,22 +481,20 @@ void win32_monitor_info(void *data, void *hm_data, unsigned *mon_id)
|
||||||
bool win32_load_content_from_gui(const char *szFilename)
|
bool win32_load_content_from_gui(const char *szFilename)
|
||||||
{
|
{
|
||||||
/* poll list of current cores */
|
/* poll list of current cores */
|
||||||
size_t list_size;
|
|
||||||
content_ctx_info_t content_info = { 0 };
|
|
||||||
core_info_list_t *core_info_list = NULL;
|
core_info_list_t *core_info_list = NULL;
|
||||||
const core_info_t *core_info = NULL;
|
|
||||||
|
|
||||||
core_info_get_list(&core_info_list);
|
core_info_get_list(&core_info_list);
|
||||||
|
|
||||||
if (!core_info_list)
|
if (core_info_list)
|
||||||
return false;
|
{
|
||||||
|
size_t list_size;
|
||||||
|
content_ctx_info_t content_info = { 0 };
|
||||||
|
const core_info_t *core_info = NULL;
|
||||||
core_info_list_get_supported_cores(core_info_list,
|
core_info_list_get_supported_cores(core_info_list,
|
||||||
(const char*)szFilename, &core_info, &list_size);
|
(const char*)szFilename, &core_info, &list_size);
|
||||||
|
|
||||||
if (!list_size)
|
if (list_size)
|
||||||
return false;
|
{
|
||||||
|
|
||||||
path_set(RARCH_PATH_CONTENT, szFilename);
|
path_set(RARCH_PATH_CONTENT, szFilename);
|
||||||
|
|
||||||
if (!path_is_empty(RARCH_PATH_CONTENT))
|
if (!path_is_empty(RARCH_PATH_CONTENT))
|
||||||
|
@ -541,10 +539,15 @@ bool win32_load_content_from_gui(const char *szFilename)
|
||||||
bool okay = false;
|
bool okay = false;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
bool video_is_fs = settings->bools.video_fullscreen;
|
bool video_is_fs = settings->bools.video_fullscreen;
|
||||||
|
video_driver_state_t *video_st = video_state_get_ptr();
|
||||||
|
|
||||||
/* Fullscreen: Show mouse cursor for dialog */
|
/* Fullscreen: Show mouse cursor for dialog */
|
||||||
if (video_is_fs)
|
if (video_is_fs)
|
||||||
video_driver_show_mouse();
|
{
|
||||||
|
if ( video_st->poke
|
||||||
|
&& video_st->poke->show_mouse)
|
||||||
|
video_st->poke->show_mouse(video_st->data, true);
|
||||||
|
}
|
||||||
|
|
||||||
/* Pick one core that could be compatible, ew */
|
/* Pick one core that could be compatible, ew */
|
||||||
if (DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_PICKCORE),
|
if (DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_PICKCORE),
|
||||||
|
@ -557,9 +560,15 @@ bool win32_load_content_from_gui(const char *szFilename)
|
||||||
|
|
||||||
/* Fullscreen: Hide mouse cursor after dialog */
|
/* Fullscreen: Hide mouse cursor after dialog */
|
||||||
if (video_is_fs)
|
if (video_is_fs)
|
||||||
video_driver_hide_mouse();
|
{
|
||||||
|
if ( video_st->poke
|
||||||
|
&& video_st->poke->show_mouse)
|
||||||
|
video_st->poke->show_mouse(video_st->data, false);
|
||||||
|
}
|
||||||
return okay;
|
return okay;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2175,22 +2175,6 @@ void video_driver_update_viewport(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void video_driver_show_mouse(void)
|
|
||||||
{
|
|
||||||
video_driver_state_t *video_st = &video_driver_st;
|
|
||||||
if ( video_st->poke
|
|
||||||
&& video_st->poke->show_mouse)
|
|
||||||
video_st->poke->show_mouse(video_st->data, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void video_driver_hide_mouse(void)
|
|
||||||
{
|
|
||||||
video_driver_state_t *video_st = &video_driver_st;
|
|
||||||
if ( video_st->poke
|
|
||||||
&& video_st->poke->show_mouse)
|
|
||||||
video_st->poke->show_mouse(video_st->data, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
void video_driver_restore_cached(void *settings_data)
|
void video_driver_restore_cached(void *settings_data)
|
||||||
{
|
{
|
||||||
settings_t *settings = (settings_t*)settings_data;
|
settings_t *settings = (settings_t*)settings_data;
|
||||||
|
@ -3519,13 +3503,17 @@ bool video_driver_init_internal(bool *video_is_threaded, bool verbosity_enabled)
|
||||||
* (re-)initialisation */
|
* (re-)initialisation */
|
||||||
if (input_st->flags & INP_FLAG_GRAB_MOUSE_STATE)
|
if (input_st->flags & INP_FLAG_GRAB_MOUSE_STATE)
|
||||||
{
|
{
|
||||||
video_driver_hide_mouse();
|
if ( video_st->poke
|
||||||
|
&& video_st->poke->show_mouse)
|
||||||
|
video_st->poke->show_mouse(video_st->data, false);
|
||||||
if (input_driver_grab_mouse())
|
if (input_driver_grab_mouse())
|
||||||
input_st->flags |= INP_FLAG_GRAB_MOUSE_STATE;
|
input_st->flags |= INP_FLAG_GRAB_MOUSE_STATE;
|
||||||
}
|
}
|
||||||
else if (video.fullscreen)
|
else if (video.fullscreen)
|
||||||
{
|
{
|
||||||
video_driver_hide_mouse();
|
if ( video_st->poke
|
||||||
|
&& video_st->poke->show_mouse)
|
||||||
|
video_st->poke->show_mouse(video_st->data, false);
|
||||||
if (!settings->bools.video_windowed_fullscreen)
|
if (!settings->bools.video_windowed_fullscreen)
|
||||||
if (input_driver_grab_mouse())
|
if (input_driver_grab_mouse())
|
||||||
input_st->flags |= INP_FLAG_GRAB_MOUSE_STATE;
|
input_st->flags |= INP_FLAG_GRAB_MOUSE_STATE;
|
||||||
|
|
|
@ -940,10 +940,6 @@ void video_driver_set_aspect_ratio(void);
|
||||||
|
|
||||||
void video_driver_update_viewport(struct video_viewport* vp, bool force_full, bool keep_aspect);
|
void video_driver_update_viewport(struct video_viewport* vp, bool force_full, bool keep_aspect);
|
||||||
|
|
||||||
void video_driver_show_mouse(void);
|
|
||||||
|
|
||||||
void video_driver_hide_mouse(void);
|
|
||||||
|
|
||||||
void video_driver_apply_state_changes(void);
|
void video_driver_apply_state_changes(void);
|
||||||
|
|
||||||
bool video_driver_read_viewport(uint8_t *buffer, bool is_idle);
|
bool video_driver_read_viewport(uint8_t *buffer, bool is_idle);
|
||||||
|
|
|
@ -3911,7 +3911,11 @@ static void input_overlay_loaded(retro_task_t *task,
|
||||||
free(data);
|
free(data);
|
||||||
|
|
||||||
if (!input_overlay_show_mouse_cursor)
|
if (!input_overlay_show_mouse_cursor)
|
||||||
video_driver_hide_mouse();
|
{
|
||||||
|
if ( video_st->poke
|
||||||
|
&& video_st->poke->show_mouse)
|
||||||
|
video_st->poke->show_mouse(video_st->data, false);
|
||||||
|
}
|
||||||
|
|
||||||
/* Attempt to automatically rotate overlay, if required */
|
/* Attempt to automatically rotate overlay, if required */
|
||||||
if (inp_overlay_auto_rotate)
|
if (inp_overlay_auto_rotate)
|
||||||
|
|
33
retroarch.c
33
retroarch.c
|
@ -2637,6 +2637,7 @@ bool command_event(enum event_command cmd, void *data)
|
||||||
bool load_dummy_core = data ? *(bool*)data : true;
|
bool load_dummy_core = data ? *(bool*)data : true;
|
||||||
content_ctx_info_t content_info = {0};
|
content_ctx_info_t content_info = {0};
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
|
video_driver_state_t *video_st = video_state_get_ptr();
|
||||||
rarch_system_info_t *sys_info = &runloop_st->system;
|
rarch_system_info_t *sys_info = &runloop_st->system;
|
||||||
uint8_t flags = content_get_flags();
|
uint8_t flags = content_get_flags();
|
||||||
|
|
||||||
|
@ -2680,7 +2681,9 @@ bool command_event(enum event_command cmd, void *data)
|
||||||
if (!settings->bools.video_fullscreen)
|
if (!settings->bools.video_fullscreen)
|
||||||
{
|
{
|
||||||
input_driver_state_t *input_st = input_state_get_ptr();
|
input_driver_state_t *input_st = input_state_get_ptr();
|
||||||
video_driver_show_mouse();
|
if ( video_st->poke
|
||||||
|
&& video_st->poke->show_mouse)
|
||||||
|
video_st->poke->show_mouse(video_st->data, true);
|
||||||
if (input_driver_ungrab_mouse())
|
if (input_driver_ungrab_mouse())
|
||||||
input_st->flags &= ~INP_FLAG_GRAB_MOUSE_STATE;
|
input_st->flags &= ~INP_FLAG_GRAB_MOUSE_STATE;
|
||||||
}
|
}
|
||||||
|
@ -3779,14 +3782,18 @@ 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)
|
||||||
{
|
{
|
||||||
video_driver_hide_mouse();
|
if ( video_st->poke
|
||||||
|
&& video_st->poke->show_mouse)
|
||||||
|
video_st->poke->show_mouse(video_st->data, false);
|
||||||
if (!settings->bools.video_windowed_fullscreen)
|
if (!settings->bools.video_windowed_fullscreen)
|
||||||
if (input_driver_grab_mouse())
|
if (input_driver_grab_mouse())
|
||||||
input_st->flags |= INP_FLAG_GRAB_MOUSE_STATE;
|
input_st->flags |= INP_FLAG_GRAB_MOUSE_STATE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
video_driver_show_mouse();
|
if ( video_st->poke
|
||||||
|
&& video_st->poke->show_mouse)
|
||||||
|
video_st->poke->show_mouse(video_st->data, true);
|
||||||
if (!settings->bools.video_windowed_fullscreen)
|
if (!settings->bools.video_windowed_fullscreen)
|
||||||
if (input_driver_ungrab_mouse())
|
if (input_driver_ungrab_mouse())
|
||||||
input_st->flags &= ~INP_FLAG_GRAB_MOUSE_STATE;
|
input_st->flags &= ~INP_FLAG_GRAB_MOUSE_STATE;
|
||||||
|
@ -3979,9 +3986,17 @@ bool command_event(enum event_command cmd, void *data)
|
||||||
grab_mouse_state ? "ON" : "OFF");
|
grab_mouse_state ? "ON" : "OFF");
|
||||||
|
|
||||||
if (grab_mouse_state)
|
if (grab_mouse_state)
|
||||||
video_driver_hide_mouse();
|
{
|
||||||
|
if ( video_st->poke
|
||||||
|
&& video_st->poke->show_mouse)
|
||||||
|
video_st->poke->show_mouse(video_st->data, false);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
video_driver_show_mouse();
|
{
|
||||||
|
if ( video_st->poke
|
||||||
|
&& video_st->poke->show_mouse)
|
||||||
|
video_st->poke->show_mouse(video_st->data, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CMD_EVENT_UI_COMPANION_TOGGLE:
|
case CMD_EVENT_UI_COMPANION_TOGGLE:
|
||||||
|
@ -4065,7 +4080,9 @@ bool command_event(enum event_command cmd, void *data)
|
||||||
{
|
{
|
||||||
if (input_driver_grab_mouse())
|
if (input_driver_grab_mouse())
|
||||||
input_st->flags |= INP_FLAG_GRAB_MOUSE_STATE;
|
input_st->flags |= INP_FLAG_GRAB_MOUSE_STATE;
|
||||||
video_driver_hide_mouse();
|
if ( video_st->poke
|
||||||
|
&& video_st->poke->show_mouse)
|
||||||
|
video_st->poke->show_mouse(video_st->data, false);
|
||||||
}
|
}
|
||||||
/* Ungrab only if windowed and auto mouse grab is disabled */
|
/* Ungrab only if windowed and auto mouse grab is disabled */
|
||||||
else if (!video_fullscreen &&
|
else if (!video_fullscreen &&
|
||||||
|
@ -4073,7 +4090,9 @@ bool command_event(enum event_command cmd, void *data)
|
||||||
{
|
{
|
||||||
if (input_driver_ungrab_mouse())
|
if (input_driver_ungrab_mouse())
|
||||||
input_st->flags &= ~INP_FLAG_GRAB_MOUSE_STATE;
|
input_st->flags &= ~INP_FLAG_GRAB_MOUSE_STATE;
|
||||||
video_driver_show_mouse();
|
if ( video_st->poke
|
||||||
|
&& video_st->poke->show_mouse)
|
||||||
|
video_st->poke->show_mouse(video_st->data, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (input_st->game_focus_state.enabled)
|
if (input_st->game_focus_state.enabled)
|
||||||
|
|
13
runloop.c
13
runloop.c
|
@ -2467,6 +2467,7 @@ bool runloop_environment_cb(unsigned cmd, void *data)
|
||||||
{
|
{
|
||||||
recording_state_t
|
recording_state_t
|
||||||
*recording_st = recording_state_get_ptr();
|
*recording_st = recording_state_get_ptr();
|
||||||
|
video_driver_state_t *video_st = video_state_get_ptr();
|
||||||
bool video_fullscreen = settings->bools.video_fullscreen;
|
bool video_fullscreen = settings->bools.video_fullscreen;
|
||||||
int reinit_flags = DRIVERS_CMD_ALL &
|
int reinit_flags = DRIVERS_CMD_ALL &
|
||||||
~(DRIVER_VIDEO_MASK | DRIVER_INPUT_MASK | DRIVER_MENU_MASK);
|
~(DRIVER_VIDEO_MASK | DRIVER_INPUT_MASK | DRIVER_MENU_MASK);
|
||||||
|
@ -2493,7 +2494,11 @@ bool runloop_environment_cb(unsigned cmd, void *data)
|
||||||
|
|
||||||
/* Hide mouse cursor in fullscreen mode */
|
/* Hide mouse cursor in fullscreen mode */
|
||||||
if (video_fullscreen)
|
if (video_fullscreen)
|
||||||
video_driver_hide_mouse();
|
{
|
||||||
|
if ( video_st->poke
|
||||||
|
&& video_st->poke->show_mouse)
|
||||||
|
video_st->poke->show_mouse(video_st->data, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2691,7 +2696,11 @@ bool runloop_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)
|
||||||
video_driver_hide_mouse();
|
{
|
||||||
|
if ( video_st->poke
|
||||||
|
&& video_st->poke->show_mouse)
|
||||||
|
video_st->poke->show_mouse(video_st->data, false);
|
||||||
|
}
|
||||||
|
|
||||||
/* Recalibrate frame delay target when video reinits
|
/* Recalibrate frame delay target when video reinits
|
||||||
* and pause frame delay when video does not reinit */
|
* and pause frame delay when video does not reinit */
|
||||||
|
|
|
@ -4840,7 +4840,9 @@ static void ui_companion_qt_toggle(void *data, bool force)
|
||||||
|
|
||||||
if (mouse_grabbed)
|
if (mouse_grabbed)
|
||||||
command_event(CMD_EVENT_GRAB_MOUSE_TOGGLE, NULL);
|
command_event(CMD_EVENT_GRAB_MOUSE_TOGGLE, NULL);
|
||||||
video_driver_show_mouse();
|
if ( video_st->poke
|
||||||
|
&& video_st->poke->show_mouse)
|
||||||
|
video_st->poke->show_mouse(video_st->data, true);
|
||||||
|
|
||||||
if (video_fullscreen)
|
if (video_fullscreen)
|
||||||
command_event(CMD_EVENT_FULLSCREEN_TOGGLE, NULL);
|
command_event(CMD_EVENT_FULLSCREEN_TOGGLE, NULL);
|
||||||
|
|
|
@ -248,6 +248,7 @@ static bool ui_browser_window_win32_core(
|
||||||
OPENFILENAME ofn;
|
OPENFILENAME ofn;
|
||||||
bool okay = true;
|
bool okay = true;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
video_driver_state_t *video_st = video_state_get_ptr();
|
||||||
bool video_fullscreen = settings->bools.video_fullscreen;
|
bool video_fullscreen = settings->bools.video_fullscreen;
|
||||||
|
|
||||||
ofn.lStructSize = sizeof(OPENFILENAME);
|
ofn.lStructSize = sizeof(OPENFILENAME);
|
||||||
|
@ -280,7 +281,11 @@ static bool ui_browser_window_win32_core(
|
||||||
|
|
||||||
/* Full Screen: Show mouse for the file dialog */
|
/* Full Screen: Show mouse for the file dialog */
|
||||||
if (video_fullscreen)
|
if (video_fullscreen)
|
||||||
video_driver_show_mouse();
|
{
|
||||||
|
if ( video_st->poke
|
||||||
|
&& video_st->poke->show_mouse)
|
||||||
|
video_st->poke->show_mouse(video_st->data, true);
|
||||||
|
}
|
||||||
|
|
||||||
if (!save && !GetOpenFileName(&ofn))
|
if (!save && !GetOpenFileName(&ofn))
|
||||||
okay = false;
|
okay = false;
|
||||||
|
@ -289,7 +294,11 @@ static bool ui_browser_window_win32_core(
|
||||||
|
|
||||||
/* Full screen: Hide mouse after the file dialog */
|
/* Full screen: Hide mouse after the file dialog */
|
||||||
if (video_fullscreen)
|
if (video_fullscreen)
|
||||||
video_driver_hide_mouse();
|
{
|
||||||
|
if ( video_st->poke
|
||||||
|
&& video_st->poke->show_mouse)
|
||||||
|
video_st->poke->show_mouse(video_st->data, false);
|
||||||
|
}
|
||||||
|
|
||||||
return okay;
|
return okay;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue