Driver independent disconnection notification (#14600)

This commit is contained in:
sonninnos 2022-11-07 15:51:37 +02:00 committed by GitHub
parent e3a25793b6
commit 954d1bf605
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 11 deletions

View File

@ -658,9 +658,6 @@ static void xinput_joypad_destroy(void)
{
unsigned i;
/* Run poll one last time in order to detect disconnections */
xinput_joypad_poll();
for (i = 0; i < 4; ++i)
{
g_xinput_states[i].xstate.dwPacketNumber = 0;
@ -687,7 +684,6 @@ static void xinput_joypad_destroy(void)
g_xinput_block_pads = false;
}
input_device_driver_t xinput_joypad = {
xinput_joypad_init,
xinput_joypad_query_pad,

View File

@ -362,9 +362,6 @@ static void xinput_joypad_destroy(void)
{
unsigned i;
/* Run poll one last time in order to detect disconnections */
xinput_joypad_poll();
for (i = 0; i < 4; ++i)
{
g_xinput_states[i].xstate.dwPacketNumber = 0;

View File

@ -2708,6 +2708,8 @@ void joypad_driver_reinit(void *data, const char *joypad_driver_name)
{
const input_device_driver_t *tmp = input_driver_st.primary_joypad;
input_driver_st.primary_joypad = NULL;
/* Run poll one last time in order to detect disconnections */
tmp->poll();
tmp->destroy();
}
#ifdef HAVE_MFI
@ -2715,6 +2717,7 @@ void joypad_driver_reinit(void *data, const char *joypad_driver_name)
{
const input_device_driver_t *tmp = input_driver_st.secondary_joypad;
input_driver_st.secondary_joypad = NULL;
tmp->poll();
tmp->destroy();
}
#endif

View File

@ -819,14 +819,12 @@ static void input_autoconfigure_disconnect_handler(retro_task_t *task)
autoconfig_handle->port + 1);
if (!string_is_empty(autoconfig_handle->device_info.name))
{
task_title[_len ] = ' ';
task_title[_len+1] = '(';
task_title[_len ] = ':';
task_title[_len+1] = ' ';
task_title[_len+2] = '\0';
_len = strlcat(task_title,
autoconfig_handle->device_info.name,
sizeof(task_title));
task_title[_len ] = ')';
task_title[_len+1] = '\0';
}
task_free_title(task);