From d6fe0ceab2cb75e418aa9e24d1b0c8d05e544ada Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 14 May 2019 04:17:04 +0200 Subject: [PATCH] (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 --- menu/drivers/ozone/ozone.c | 12 +++++++++--- menu/drivers/ozone/ozone.h | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/menu/drivers/ozone/ozone.c b/menu/drivers/ozone/ozone.c index a3b465c8a7..f47655db74 100644 --- a/menu/drivers/ozone/ozone.c +++ b/menu/drivers/ozone/ozone.c @@ -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) { diff --git a/menu/drivers/ozone/ozone.h b/menu/drivers/ozone/ozone.h index 5e10b37d7b..abacdf5c92 100644 --- a/menu/drivers/ozone/ozone.h +++ b/menu/drivers/ozone/ozone.h @@ -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