(Ozone) Fix regressions on OSX - menu_input_mouse_state

cannot be called in ozone_init - menu driver init function
too early for mouse input calls
This commit is contained in:
twinaphex 2019-05-14 04:17:04 +02:00
parent a672cc13a9
commit d6fe0ceab2
2 changed files with 10 additions and 3 deletions

View File

@ -162,9 +162,8 @@ static void *ozone_init(void **userdata, bool video_is_threaded)
ozone->pending_message = NULL;
ozone->show_cursor = false;
ozone->cursor_mode = false;
ozone->cursor_x_old = menu_input_mouse_state(MENU_MOUSE_X_AXIS);
ozone->cursor_y_old = menu_input_mouse_state(MENU_MOUSE_Y_AXIS);
ozone->first_frame = true;
ozone->cursor_mode = false;
ozone->sidebar_collapsed = false;
ozone->animations.sidebar_text_alpha = 1.0f;
@ -1409,6 +1408,13 @@ static void ozone_frame(void *data, video_frame_info_t *video_info)
if (!ozone)
return;
if (ozone->first_frame)
{
ozone->cursor_x_old = menu_input_mouse_state(MENU_MOUSE_X_AXIS);
ozone->cursor_y_old = menu_input_mouse_state(MENU_MOUSE_Y_AXIS);
ozone->first_frame = false;
}
/* OSK Fade detection */
if (draw_osk != draw_osk_old)
{

View File

@ -242,6 +242,7 @@ struct ozone_handle
bool selection_core_is_viewer;
bool is_db_manager_list;
bool first_frame;
};
/* If you change this struct, also