mirror of
https://github.com/libretro/RetroArch
synced 2025-04-17 20:43:10 +00:00
(Threaded Video) Enable proper mouse cursor show/hide functionality
This commit is contained in:
parent
2a0833378d
commit
27ab57bc05
@ -57,6 +57,9 @@ enum thread_cmd
|
|||||||
CMD_FONT_INIT,
|
CMD_FONT_INIT,
|
||||||
CMD_CUSTOM_COMMAND,
|
CMD_CUSTOM_COMMAND,
|
||||||
|
|
||||||
|
CMD_POKE_SHOW_MOUSE,
|
||||||
|
CMD_POKE_GRAB_MOUSE_TOGGLE,
|
||||||
|
|
||||||
CMD_DUMMY = INT_MAX
|
CMD_DUMMY = INT_MAX
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -529,6 +532,19 @@ static bool video_thread_handle_packet(
|
|||||||
video_thread_reply(thr, &pkt);
|
video_thread_reply(thr, &pkt);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case CMD_POKE_SHOW_MOUSE:
|
||||||
|
if (thr->poke && thr->poke->show_mouse)
|
||||||
|
thr->poke->show_mouse(thr->driver_data,
|
||||||
|
pkt.data.b);
|
||||||
|
video_thread_reply(thr, &pkt);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case CMD_POKE_GRAB_MOUSE_TOGGLE:
|
||||||
|
if (thr->poke && thr->poke->grab_mouse_toggle)
|
||||||
|
thr->poke->grab_mouse_toggle(thr->driver_data);
|
||||||
|
video_thread_reply(thr, &pkt);
|
||||||
|
break;
|
||||||
|
|
||||||
case CMD_VIDEO_NONE:
|
case CMD_VIDEO_NONE:
|
||||||
/* Never reply on no command. Possible deadlock if
|
/* Never reply on no command. Possible deadlock if
|
||||||
* thread sends command right after frame update. */
|
* thread sends command right after frame update. */
|
||||||
@ -1177,6 +1193,29 @@ static void thread_set_osd_msg(void *data,
|
|||||||
thr->poke->set_osd_msg(thr->driver_data, msg, params, font);
|
thr->poke->set_osd_msg(thr->driver_data, msg, params, font);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void thread_show_mouse(void *data, bool state)
|
||||||
|
{
|
||||||
|
thread_video_t *thr = (thread_video_t*)data;
|
||||||
|
thread_packet_t pkt = { CMD_POKE_SHOW_MOUSE };
|
||||||
|
|
||||||
|
if (!thr)
|
||||||
|
return;
|
||||||
|
pkt.data.b = state;
|
||||||
|
|
||||||
|
video_thread_send_and_wait_user_to_thread(thr, &pkt);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void thread_grab_mouse_toggle(void *data)
|
||||||
|
{
|
||||||
|
thread_video_t *thr = (thread_video_t*)data;
|
||||||
|
thread_packet_t pkt = { CMD_POKE_GRAB_MOUSE_TOGGLE };
|
||||||
|
|
||||||
|
if (!thr)
|
||||||
|
return;
|
||||||
|
|
||||||
|
video_thread_send_and_wait_user_to_thread(thr, &pkt);
|
||||||
|
}
|
||||||
|
|
||||||
static uintptr_t thread_load_texture(void *video_data, void *data,
|
static uintptr_t thread_load_texture(void *video_data, void *data,
|
||||||
bool threaded, enum texture_filter_type filter_type)
|
bool threaded, enum texture_filter_type filter_type)
|
||||||
{
|
{
|
||||||
@ -1247,8 +1286,8 @@ static const video_poke_interface_t thread_poke = {
|
|||||||
thread_set_texture_enable,
|
thread_set_texture_enable,
|
||||||
thread_set_osd_msg,
|
thread_set_osd_msg,
|
||||||
|
|
||||||
NULL,
|
thread_show_mouse,
|
||||||
NULL,
|
thread_grab_mouse_toggle,
|
||||||
|
|
||||||
thread_get_current_shader,
|
thread_get_current_shader,
|
||||||
NULL, /* get_current_software_framebuffer */
|
NULL, /* get_current_software_framebuffer */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user