mirror of
https://github.com/libretro/RetroArch.git
synced 2025-12-28 05:24:00 +00:00
Also ignore initial mouse position after refresh rate change
This commit is contained in:
parent
ab898468be
commit
3ebc2f7db2
@ -1863,6 +1863,7 @@ static void menu_input_get_mouse_hw_state(
|
||||
bool overlay_active,
|
||||
menu_input_pointer_hw_state_t *hw_state)
|
||||
{
|
||||
struct menu_state *menu_st = &menu_driver_state;
|
||||
rarch_joypad_info_t joypad_info;
|
||||
static int16_t last_x = -0x7fff;
|
||||
static int16_t last_y = -0x7fff;
|
||||
@ -1883,6 +1884,13 @@ static void menu_input_get_mouse_hw_state(
|
||||
menu_mouse_enable = false;
|
||||
#endif
|
||||
|
||||
/* Ignore initial mouse position also after reinit */
|
||||
if (menu_st->input_pointer_hw_state.flags & MENU_INP_PTR_FLG_RESET)
|
||||
{
|
||||
menu_st->input_pointer_hw_state.flags &= ~MENU_INP_PTR_FLG_RESET;
|
||||
last_x = last_y = -0x7fff;
|
||||
}
|
||||
|
||||
/* Easiest to set inactive by default, and toggle
|
||||
* when input is detected */
|
||||
hw_state->x = 0;
|
||||
|
||||
@ -192,7 +192,8 @@ enum menu_inp_ptr_hwst_flags
|
||||
MENU_INP_PTR_FLG_PRESS_LEFT = (1 << 5),
|
||||
MENU_INP_PTR_FLG_PRESS_RIGHT = (1 << 6),
|
||||
MENU_INP_PTR_FLG_PRESSED = (1 << 7),
|
||||
MENU_INP_PTR_FLG_DRAGGED = (1 << 8)
|
||||
MENU_INP_PTR_FLG_DRAGGED = (1 << 8),
|
||||
MENU_INP_PTR_FLG_RESET = (1 << 9)
|
||||
};
|
||||
|
||||
/* Defines set of (abstracted) inputs/states
|
||||
|
||||
@ -1682,6 +1682,11 @@ void drivers_init(
|
||||
location_st->active = false;
|
||||
}
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
if (flags & DRIVER_INPUT_MASK)
|
||||
menu_st->input_pointer_hw_state.flags |= MENU_INP_PTR_FLG_RESET;
|
||||
#endif
|
||||
|
||||
core_info_init_current_core();
|
||||
|
||||
#if defined(HAVE_GFX_WIDGETS)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user