equal
deleted
inserted
replaced
135 |
135 |
136 static SDL_Cursor* |
136 static SDL_Cursor* |
137 MIR_CreateSystemCursor(SDL_SystemCursor id) |
137 MIR_CreateSystemCursor(SDL_SystemCursor id) |
138 { |
138 { |
139 char const* cursor_name = NULL; |
139 char const* cursor_name = NULL; |
140 MirCursorConfiguration* conf; |
140 SDL_Cursor* cursor = MIR_CreateDefaultCursor(); |
141 SDL_Cursor* cursor = MIR_CreateDefaultCursor(); |
141 MIR_Cursor* mir_cursor = (MIR_Cursor*)cursor->driverdata; |
142 |
142 |
143 if (!cursor) { |
143 if (!cursor) { |
144 return NULL; |
144 return NULL; |
145 } |
145 } |
146 |
146 |
186 default: |
186 default: |
187 SDL_assert(0); |
187 SDL_assert(0); |
188 return NULL; |
188 return NULL; |
189 } |
189 } |
190 |
190 |
191 conf = MIR_mir_cursor_configuration_from_name(cursor_name); |
191 mir_cursor->conf = MIR_mir_cursor_configuration_from_name(cursor_name); |
192 |
|
193 cursor->driverdata = conf; |
|
194 |
192 |
195 return cursor; |
193 return cursor; |
196 } |
194 } |
197 |
195 |
198 static void |
196 static void |
224 if (cursor && cursor->driverdata) { |
222 if (cursor && cursor->driverdata) { |
225 if (mir_window && MIR_mir_surface_is_valid(mir_window->surface)) { |
223 if (mir_window && MIR_mir_surface_is_valid(mir_window->surface)) { |
226 MIR_Cursor* mir_cursor = (MIR_Cursor*)cursor->driverdata; |
224 MIR_Cursor* mir_cursor = (MIR_Cursor*)cursor->driverdata; |
227 |
225 |
228 if (mir_cursor->conf) { |
226 if (mir_cursor->conf) { |
229 MIR_mir_wait_for(MIR_mir_surface_configure_cursor(mir_window->surface, mir_cursor->conf)); |
227 MIR_mir_surface_configure_cursor(mir_window->surface, mir_cursor->conf); |
230 } |
228 } |
231 } |
229 } |
232 } |
230 } |
233 else if(mir_window && MIR_mir_surface_is_valid(mir_window->surface)) { |
231 else if(mir_window && MIR_mir_surface_is_valid(mir_window->surface)) { |
234 MIR_mir_wait_for(MIR_mir_surface_configure_cursor(mir_window->surface, NULL)); |
232 MIR_mir_surface_configure_cursor(mir_window->surface, NULL); |
235 } |
233 } |
236 |
234 |
237 return 0; |
235 return 0; |
238 } |
236 } |
239 |
237 |