MIR: Fix system cursors. Been broken since custom cursor support was added!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
diff --git a/src/video/mir/SDL_mirmouse.c b/src/video/mir/SDL_mirmouse.c
index b028d00..1a22b28 100644
--- a/src/video/mir/SDL_mirmouse.c
+++ b/src/video/mir/SDL_mirmouse.c
@@ -137,8 +137,8 @@ static SDL_Cursor*
MIR_CreateSystemCursor(SDL_SystemCursor id)
{
char const* cursor_name = NULL;
- MirCursorConfiguration* conf;
- SDL_Cursor* cursor = MIR_CreateDefaultCursor();
+ SDL_Cursor* cursor = MIR_CreateDefaultCursor();
+ MIR_Cursor* mir_cursor = (MIR_Cursor*)cursor->driverdata;
if (!cursor) {
return NULL;
@@ -188,9 +188,7 @@ MIR_CreateSystemCursor(SDL_SystemCursor id)
return NULL;
}
- conf = MIR_mir_cursor_configuration_from_name(cursor_name);
-
- cursor->driverdata = conf;
+ mir_cursor->conf = MIR_mir_cursor_configuration_from_name(cursor_name);
return cursor;
}
@@ -226,12 +224,12 @@ MIR_ShowCursor(SDL_Cursor* cursor)
MIR_Cursor* mir_cursor = (MIR_Cursor*)cursor->driverdata;
if (mir_cursor->conf) {
- MIR_mir_wait_for(MIR_mir_surface_configure_cursor(mir_window->surface, mir_cursor->conf));
+ MIR_mir_surface_configure_cursor(mir_window->surface, mir_cursor->conf);
}
}
}
else if(mir_window && MIR_mir_surface_is_valid(mir_window->surface)) {
- MIR_mir_wait_for(MIR_mir_surface_configure_cursor(mir_window->surface, NULL));
+ MIR_mir_surface_configure_cursor(mir_window->surface, NULL);
}
return 0;
diff --git a/src/video/mir/SDL_mirsym.h b/src/video/mir/SDL_mirsym.h
index 0353aa8..298d574 100644
--- a/src/video/mir/SDL_mirsym.h
+++ b/src/video/mir/SDL_mirsym.h
@@ -91,7 +91,6 @@ SDL_MIR_SYM(void,mir_buffer_stream_release_sync,(MirBufferStream *stream))
SDL_MIR_SYM(MirCursorConfiguration*,mir_cursor_configuration_from_name,(char const* cursor_name))
SDL_MIR_SYM(MirWaitHandle*,mir_surface_configure_cursor,(MirSurface* surface, MirCursorConfiguration const* conf))
SDL_MIR_SYM(void,mir_cursor_configuration_destroy,(MirCursorConfiguration* conf))
-SDL_MIR_SYM(void,mir_wait_for,(MirWaitHandle* handle))
SDL_MIR_SYM(int,mir_resize_event_get_width,(MirResizeEvent const* resize_event))
SDL_MIR_SYM(int,mir_resize_event_get_height,(MirResizeEvent const* resize_event))
SDL_MIR_SYM(char const*,mir_connection_get_error_message,(MirConnection* connection))