mir: Get ready for Mir 1.0, clean up deprecations. Thanks Micha? Kuchta!
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 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587
diff --git a/configure.in b/configure.in
index 5e30e96..f1acc11 100644
--- a/configure.in
+++ b/configure.in
@@ -1414,11 +1414,11 @@ AC_HELP_STRING([--enable-video-mir], [use Mir video driver [[default=yes]]]),
save_CFLAGS="$CFLAGS"
CFLAGS="$save_CFLAGS $MIR_CFLAGS"
- dnl This will disable Mir if >= v0.25 is not available
+ dnl This will disable Mir if >= v0.26 is not available
AC_TRY_COMPILE([
#include <mir_toolkit/mir_client_library.h>
],[
- MirTouchAction actions = mir_touch_actions
+ MirWindowAttrib attrib = mir_window_attrib_state
],[
video_mir=yes
])
diff --git a/src/video/mir/SDL_mirevents.c b/src/video/mir/SDL_mirevents.c
index 62423e4..ed01dea 100644
--- a/src/video/mir/SDL_mirevents.c
+++ b/src/video/mir/SDL_mirevents.c
@@ -270,23 +270,23 @@ MIR_HandleResize(MirResizeEvent const* resize_event, SDL_Window* window)
}
static void
-MIR_HandleSurface(MirSurfaceEvent const* surface_event, SDL_Window* window)
+MIR_HandleWindow(MirWindowEvent const* event, SDL_Window* window)
{
- MirSurfaceAttrib attrib = MIR_mir_surface_event_get_attribute(surface_event);
- int value = MIR_mir_surface_event_get_attribute_value(surface_event);
+ MirWindowAttrib attrib = MIR_mir_window_event_get_attribute(event);
+ int value = MIR_mir_window_event_get_attribute_value(event);
- if (attrib == mir_surface_attrib_focus) {
- if (value == mir_surface_focused) {
+ if (attrib == mir_window_attrib_focus) {
+ if (value == mir_window_focus_state_focused) {
SDL_SetKeyboardFocus(window);
}
- else if (value == mir_surface_unfocused) {
+ else if (value == mir_window_focus_state_unfocused) {
SDL_SetKeyboardFocus(NULL);
}
}
}
void
-MIR_HandleEvent(MirSurface* surface, MirEvent const* ev, void* context)
+MIR_HandleEvent(MirWindow* mirwindow, MirEvent const* ev, void* context)
{
MirEventType event_type = MIR_mir_event_get_type(ev);
SDL_Window* window = (SDL_Window*)context;
@@ -299,8 +299,8 @@ MIR_HandleEvent(MirSurface* surface, MirEvent const* ev, void* context)
case (mir_event_type_resize):
MIR_HandleResize(MIR_mir_event_get_resize_event(ev), window);
break;
- case (mir_event_type_surface):
- MIR_HandleSurface(MIR_mir_event_get_surface_event(ev), window);
+ case (mir_event_type_window):
+ MIR_HandleWindow(MIR_mir_event_get_window_event(ev), window);
break;
default:
break;
diff --git a/src/video/mir/SDL_mirevents.h b/src/video/mir/SDL_mirevents.h
index 13b4c01..88ac5b3 100644
--- a/src/video/mir/SDL_mirevents.h
+++ b/src/video/mir/SDL_mirevents.h
@@ -29,7 +29,7 @@
#include <mir_toolkit/mir_client_library.h>
extern void
-MIR_HandleEvent(MirSurface* surface, MirEvent const* ev, void* context);
+MIR_HandleEvent(MirWindow*, MirEvent const* ev, void* context);
#endif /* _SDL_mirevents_h */
diff --git a/src/video/mir/SDL_mirframebuffer.c b/src/video/mir/SDL_mirframebuffer.c
index 2fa1423..056fbfc 100644
--- a/src/video/mir/SDL_mirframebuffer.c
+++ b/src/video/mir/SDL_mirframebuffer.c
@@ -70,7 +70,7 @@ MIR_UpdateWindowFramebuffer(_THIS, SDL_Window* window,
char* s_dest;
char* pixels;
- bs = MIR_mir_surface_get_buffer_stream(mir_window->surface);
+ bs = MIR_mir_window_get_buffer_stream(mir_window->window);
MIR_mir_buffer_stream_get_graphics_region(bs, ®ion);
s_dest = region.vaddr;
diff --git a/src/video/mir/SDL_mirmouse.c b/src/video/mir/SDL_mirmouse.c
index 0b4424b..5a2a303 100644
--- a/src/video/mir/SDL_mirmouse.c
+++ b/src/video/mir/SDL_mirmouse.c
@@ -41,6 +41,7 @@ typedef struct
{
MirCursorConfiguration* conf;
MirBufferStream* stream;
+ char const* name;
} MIR_Cursor;
static SDL_Cursor*
@@ -55,6 +56,7 @@ MIR_CreateDefaultCursor()
if (mir_cursor) {
mir_cursor->conf = NULL;
mir_cursor->stream = NULL;
+ mir_cursor->name = NULL;
cursor->driverdata = mir_cursor;
}
else {
@@ -188,7 +190,7 @@ MIR_CreateSystemCursor(SDL_SystemCursor id)
return NULL;
}
- mir_cursor->conf = MIR_mir_cursor_configuration_from_name(cursor_name);
+ mir_cursor->name = cursor_name;
return cursor;
}
@@ -220,18 +222,25 @@ MIR_ShowCursor(SDL_Cursor* cursor)
MIR_Window* mir_window = mir_data->current_window;
if (cursor && cursor->driverdata) {
- if (mir_window && MIR_mir_surface_is_valid(mir_window->surface)) {
+ if (mir_window && MIR_mir_window_is_valid(mir_window->window)) {
MIR_Cursor* mir_cursor = (MIR_Cursor*)cursor->driverdata;
+ if (mir_cursor->name != NULL) {
+ MirWindowSpec* spec = MIR_mir_create_window_spec(mir_data->connection);
+ MIR_mir_window_spec_set_cursor_name(spec, mir_cursor->name);
+ MIR_mir_window_apply_spec(mir_window->window, spec);
+ MIR_mir_window_spec_release(spec);
+ }
+
if (mir_cursor->conf) {
- MIR_mir_surface_configure_cursor(mir_window->surface, mir_cursor->conf);
+ MIR_mir_window_configure_cursor(mir_window->window, mir_cursor->conf);
}
}
}
- else if(mir_window && MIR_mir_surface_is_valid(mir_window->surface)) {
- MIR_mir_surface_configure_cursor(mir_window->surface, NULL);
+ else if(mir_window && MIR_mir_window_is_valid(mir_window->window)) {
+ MIR_mir_window_configure_cursor(mir_window->window, NULL);
}
-
+
return 0;
}
diff --git a/src/video/mir/SDL_mirsym.h b/src/video/mir/SDL_mirsym.h
index 976b30d..79f3075 100644
--- a/src/video/mir/SDL_mirsym.h
+++ b/src/video/mir/SDL_mirsym.h
@@ -34,28 +34,30 @@
#endif
SDL_MIR_MODULE(MIR_CLIENT)
-SDL_MIR_SYM(MirSurface *,mir_surface_create_sync,(MirSurfaceSpec* spec))
+SDL_MIR_SYM(MirWindow *,mir_create_window_sync,(MirWindowSpec* spec))
SDL_MIR_SYM(MirEGLNativeWindowType,mir_buffer_stream_get_egl_native_window,(MirBufferStream *surface))
-SDL_MIR_SYM(void,mir_buffer_stream_get_graphics_region,(MirBufferStream *stream, MirGraphicsRegion *graphics_region))
+SDL_MIR_SYM(bool,mir_buffer_stream_get_graphics_region,(MirBufferStream *stream, MirGraphicsRegion *graphics_region))
SDL_MIR_SYM(void,mir_buffer_stream_swap_buffers_sync,(MirBufferStream *stream))
-SDL_MIR_SYM(void,mir_surface_set_event_handler,(MirSurface *surface, mir_surface_event_callback callback, void* context))
-SDL_MIR_SYM(MirSurfaceSpec*,mir_connection_create_spec_for_normal_surface,(MirConnection *connection, int width, int height, MirPixelFormat format))
-SDL_MIR_SYM(MirSurfaceSpec*,mir_connection_create_spec_for_changes,(MirConnection *connection))
-SDL_MIR_SYM(void,mir_surface_spec_set_buffer_usage,(MirSurfaceSpec *spec, MirBufferUsage usage))
-SDL_MIR_SYM(void,mir_surface_spec_set_name,(MirSurfaceSpec *spec, char const *name))
-SDL_MIR_SYM(void,mir_surface_spec_release,(MirSurfaceSpec *spec))
-SDL_MIR_SYM(void,mir_surface_spec_set_width,(MirSurfaceSpec *spec, unsigned width))
-SDL_MIR_SYM(void,mir_surface_spec_set_height,(MirSurfaceSpec *spec, unsigned height))
-SDL_MIR_SYM(void,mir_surface_spec_set_min_width,(MirSurfaceSpec *spec, unsigned min_width))
-SDL_MIR_SYM(void,mir_surface_spec_set_min_height,(MirSurfaceSpec *spec, unsigned min_height))
-SDL_MIR_SYM(void,mir_surface_spec_set_max_width,(MirSurfaceSpec *spec, unsigned max_width))
-SDL_MIR_SYM(void,mir_surface_spec_set_max_height,(MirSurfaceSpec *spec, unsigned max_height))
-SDL_MIR_SYM(void,mir_surface_spec_set_type,(MirSurfaceSpec *spec, MirSurfaceType type))
-SDL_MIR_SYM(void,mir_surface_spec_set_state,(MirSurfaceSpec *spec, MirSurfaceState state))
-SDL_MIR_SYM(void,mir_surface_spec_set_pointer_confinement,(MirSurfaceSpec *spec, MirPointerConfinementState state))
-SDL_MIR_SYM(void,mir_surface_apply_spec,(MirSurface *surface, MirSurfaceSpec *spec))
-SDL_MIR_SYM(void,mir_surface_get_parameters,(MirSurface *surface, MirSurfaceParameters *params))
-SDL_MIR_SYM(MirBufferStream*,mir_surface_get_buffer_stream,(MirSurface *surface))
+SDL_MIR_SYM(void,mir_window_set_event_handler,(MirWindow* window, MirWindowEventCallback callback, void* context))
+SDL_MIR_SYM(MirWindowSpec*,mir_create_normal_window_spec,(MirConnection *connection, int width, int height))
+SDL_MIR_SYM(MirWindowSpec*,mir_create_window_spec,(MirConnection *connection))
+SDL_MIR_SYM(void,mir_window_spec_set_buffer_usage,(MirWindowSpec *spec, MirBufferUsage usage))
+SDL_MIR_SYM(void,mir_window_spec_set_name,(MirWindowSpec *spec, char const *name))
+SDL_MIR_SYM(void,mir_window_spec_release,(MirWindowSpec *spec))
+SDL_MIR_SYM(void,mir_window_spec_set_width,(MirWindowSpec *spec, unsigned width))
+SDL_MIR_SYM(void,mir_window_spec_set_height,(MirWindowSpec *spec, unsigned height))
+SDL_MIR_SYM(void,mir_window_spec_set_min_width,(MirWindowSpec *spec, unsigned min_width))
+SDL_MIR_SYM(void,mir_window_spec_set_min_height,(MirWindowSpec *spec, unsigned min_height))
+SDL_MIR_SYM(void,mir_window_spec_set_max_width,(MirWindowSpec *spec, unsigned max_width))
+SDL_MIR_SYM(void,mir_window_spec_set_max_height,(MirWindowSpec *spec, unsigned max_height))
+SDL_MIR_SYM(void,mir_window_spec_set_type,(MirWindowSpec *spec, MirWindowType type))
+SDL_MIR_SYM(void,mir_window_spec_set_state,(MirWindowSpec *spec, MirWindowState state))
+SDL_MIR_SYM(void,mir_window_spec_set_pointer_confinement,(MirWindowSpec *spec, MirPointerConfinementState state))
+SDL_MIR_SYM(void,mir_window_spec_set_pixel_format,(MirWindowSpec *spec, MirPixelFormat pixel_format))
+SDL_MIR_SYM(void,mir_window_spec_set_cursor_name,(MirWindowSpec *spec, char const* cursor_name))
+SDL_MIR_SYM(void,mir_window_apply_spec,(MirWindow* window, MirWindowSpec* spec))
+SDL_MIR_SYM(void,mir_window_get_parameters,(MirWindow *window, MirWindowParameters *params))
+SDL_MIR_SYM(MirBufferStream*,mir_window_get_buffer_stream,(MirWindow* window))
SDL_MIR_SYM(MirCursorConfiguration*,mir_cursor_configuration_from_buffer_stream,(MirBufferStream const* stream, int hot_x, int hot_y))
SDL_MIR_SYM(MirBufferStream*,mir_connection_create_buffer_stream_sync,(MirConnection *connection, int w, int h, MirPixelFormat format, MirBufferUsage usage))
SDL_MIR_SYM(MirKeyboardAction,mir_keyboard_event_action,(MirKeyboardEvent const *event))
@@ -76,7 +78,7 @@ SDL_MIR_SYM(MirResizeEvent const*,mir_event_get_resize_event,(MirEvent const *ev
SDL_MIR_SYM(MirKeyboardEvent const*,mir_input_event_get_keyboard_event,(MirInputEvent const *event))
SDL_MIR_SYM(MirPointerEvent const*,mir_input_event_get_pointer_event,(MirInputEvent const *event))
SDL_MIR_SYM(MirTouchEvent const*,mir_input_event_get_touch_event,(MirInputEvent const *event))
-SDL_MIR_SYM(MirSurfaceEvent const*,mir_event_get_surface_event,(MirEvent const *event))
+SDL_MIR_SYM(MirWindowEvent const*,mir_event_get_window_event,(MirEvent const *event))
SDL_MIR_SYM(unsigned int,mir_touch_event_point_count,(MirTouchEvent const *event))
SDL_MIR_SYM(void,mir_connection_get_available_surface_formats,(MirConnection* connection, MirPixelFormat* formats, unsigned const int format_size, unsigned int *num_valid_formats))
SDL_MIR_SYM(MirEGLNativeDisplayType,mir_connection_get_egl_native_display,(MirConnection *connection))
@@ -84,19 +86,17 @@ SDL_MIR_SYM(bool,mir_connection_is_valid,(MirConnection *connection))
SDL_MIR_SYM(void,mir_connection_release,(MirConnection *connection))
SDL_MIR_SYM(MirPixelFormat,mir_connection_get_egl_pixel_format,(MirConnection* connection, void* egldisplay, void* eglconfig))
SDL_MIR_SYM(MirConnection *,mir_connect_sync,(char const *server, char const *app_name))
-SDL_MIR_SYM(char const *,mir_surface_get_error_message,(MirSurface *surface))
-SDL_MIR_SYM(bool,mir_surface_is_valid,(MirSurface *surface))
-SDL_MIR_SYM(void,mir_surface_release_sync,(MirSurface *surface))
+SDL_MIR_SYM(char const *,mir_window_get_error_message,(MirWindow *window))
+SDL_MIR_SYM(bool,mir_window_is_valid,(MirWindow *window))
+SDL_MIR_SYM(void,mir_window_release_sync,(MirWindow* window))
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_window_configure_cursor,(MirWindow* window, MirCursorConfiguration const* conf))
SDL_MIR_SYM(void,mir_cursor_configuration_destroy,(MirCursorConfiguration* conf))
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))
-SDL_MIR_SYM(MirSurfaceAttrib,mir_surface_event_get_attribute,(MirSurfaceEvent const* surface_event))
-SDL_MIR_SYM(int,mir_surface_event_get_attribute_value,(MirSurfaceEvent const* surface_event))
-SDL_MIR_SYM(void,mir_wait_for,(MirWaitHandle* handle))
+SDL_MIR_SYM(MirWindowAttrib,mir_window_event_get_attribute,(MirWindowEvent const* event))
+SDL_MIR_SYM(int,mir_window_event_get_attribute_value,(MirWindowEvent const* window_event))
SDL_MIR_SYM(MirDisplayConfig*,mir_connection_create_display_configuration,(MirConnection* connection))
SDL_MIR_SYM(void,mir_display_config_release,(MirDisplayConfig* config))
SDL_MIR_SYM(int,mir_display_config_get_num_outputs,(MirDisplayConfig const* config))
@@ -116,7 +116,7 @@ SDL_MIR_SYM(MirOutputMode const*,mir_output_get_mode,(MirOutput const* output, s
SDL_MIR_SYM(int,mir_output_mode_get_width,(MirOutputMode const* mode))
SDL_MIR_SYM(int,mir_output_mode_get_height,(MirOutputMode const* mode))
SDL_MIR_SYM(double,mir_output_mode_get_refresh_rate,(MirOutputMode const* mode))
-SDL_MIR_SYM(MirOutputGammaSupported,mir_output_is_gamma_supported,(MirOutput const* output))
+SDL_MIR_SYM(bool,mir_output_is_gamma_supported,(MirOutput const* output))
SDL_MIR_SYM(uint32_t,mir_output_get_gamma_size,(MirOutput const* output))
SDL_MIR_SYM(void,mir_output_get_gamma,(MirOutput const* output, uint16_t* red, uint16_t* green, uint16_t* blue, uint32_t size))
SDL_MIR_SYM(void,mir_output_set_gamma,(MirOutput* output, uint16_t const* red, uint16_t const* green, uint16_t const* blue, uint32_t size))
diff --git a/src/video/mir/SDL_mirwindow.c b/src/video/mir/SDL_mirwindow.c
index 576e8a1..e3053f2 100644
--- a/src/video/mir/SDL_mirwindow.c
+++ b/src/video/mir/SDL_mirwindow.c
@@ -39,8 +39,8 @@
int
IsSurfaceValid(MIR_Window* mir_window)
{
- if (!MIR_mir_surface_is_valid(mir_window->surface)) {
- const char* error = MIR_mir_surface_get_error_message(mir_window->surface);
+ if (!MIR_mir_window_is_valid(mir_window->window)) {
+ const char* error = MIR_mir_window_get_error_message(mir_window->window);
return SDL_SetError("Failed to created a mir surface: %s", error);
}
@@ -81,7 +81,7 @@ MIR_CreateWindow(_THIS, SDL_Window* window)
MirPixelFormat pixel_format;
MirBufferUsage buffer_usage;
- MirSurfaceSpec* spec;
+ MirWindowSpec* spec;
mir_window = SDL_calloc(1, sizeof(MIR_Window));
if (!mir_window)
@@ -117,31 +117,31 @@ MIR_CreateWindow(_THIS, SDL_Window* window)
if (mir_data->software)
buffer_usage = mir_buffer_usage_software;
- spec = MIR_mir_connection_create_spec_for_normal_surface(mir_data->connection,
- window->w,
- window->h,
- pixel_format);
+ spec = MIR_mir_create_normal_window_spec(mir_data->connection,
+ window->w,
+ window->h);
- MIR_mir_surface_spec_set_buffer_usage(spec, buffer_usage);
- MIR_mir_surface_spec_set_name(spec, "Mir surface");
+ MIR_mir_window_spec_set_buffer_usage(spec, buffer_usage);
+ MIR_mir_window_spec_set_name(spec, "Mir surface");
+ MIR_mir_window_spec_set_pixel_format(spec, pixel_format);
if (window->flags & SDL_WINDOW_INPUT_FOCUS)
SDL_SetKeyboardFocus(window);
- mir_window->surface = MIR_mir_surface_create_sync(spec);
- MIR_mir_surface_set_event_handler(mir_window->surface, MIR_HandleEvent, window);
+ mir_window->window = MIR_mir_create_window_sync(spec);
+ MIR_mir_window_set_event_handler(mir_window->window, MIR_HandleEvent, window);
- MIR_mir_surface_spec_release(spec);
+ MIR_mir_window_spec_release(spec);
- if (!MIR_mir_surface_is_valid(mir_window->surface)) {
+ if (!MIR_mir_window_is_valid(mir_window->window)) {
return SDL_SetError("Failed to created a mir surface: %s",
- MIR_mir_surface_get_error_message(mir_window->surface));
+ MIR_mir_window_get_error_message(mir_window->window));
}
if (window->flags & SDL_WINDOW_OPENGL) {
EGLNativeWindowType egl_native_window =
(EGLNativeWindowType)MIR_mir_buffer_stream_get_egl_native_window(
- MIR_mir_surface_get_buffer_stream(mir_window->surface));
+ MIR_mir_window_get_buffer_stream(mir_window->window));
mir_window->egl_surface = SDL_EGL_CreateSurface(_this, egl_native_window);
@@ -167,7 +167,7 @@ MIR_DestroyWindow(_THIS, SDL_Window* window)
if (mir_data) {
SDL_EGL_DestroySurface(_this, mir_window->egl_surface);
- MIR_mir_surface_release_sync(mir_window->surface);
+ MIR_mir_window_release_sync(mir_window->window);
mir_data->current_window = NULL;
@@ -185,7 +185,8 @@ MIR_GetWindowWMInfo(_THIS, SDL_Window* window, SDL_SysWMinfo* info)
info->subsystem = SDL_SYSWM_MIR;
info->info.mir.connection = mir_window->mir_data->connection;
- info->info.mir.surface = mir_window->surface;
+ // Cannot change this to window due to it being in the public API
+ info->info.mir.surface = mir_window->window;
return SDL_TRUE;
}
@@ -200,23 +201,23 @@ MIR_SetWindowFullscreen(_THIS, SDL_Window* window,
{
MIR_Data* mir_data = _this->driverdata;
MIR_Window* mir_window = window->driverdata;
- MirSurfaceSpec* spec;
- MirSurfaceState state;
+ MirWindowSpec* spec;
+ MirWindowState state;
if (IsSurfaceValid(mir_window) < 0)
return;
if (fullscreen) {
- state = mir_surface_state_fullscreen;
+ state = mir_window_state_fullscreen;
} else {
- state = mir_surface_state_restored;
+ state = mir_window_state_restored;
}
- spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection);
- MIR_mir_surface_spec_set_state(spec, state);
+ spec = MIR_mir_create_window_spec(mir_data->connection);
+ MIR_mir_window_spec_set_state(spec, state);
- MIR_mir_surface_apply_spec(mir_window->surface, spec);
- MIR_mir_surface_spec_release(spec);
+ MIR_mir_window_apply_spec(mir_window->window, spec);
+ MIR_mir_window_spec_release(spec);
}
void
@@ -224,16 +225,16 @@ MIR_MaximizeWindow(_THIS, SDL_Window* window)
{
MIR_Data* mir_data = _this->driverdata;
MIR_Window* mir_window = window->driverdata;
- MirSurfaceSpec* spec;
+ MirWindowSpec* spec;
if (IsSurfaceValid(mir_window) < 0)
return;
- spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection);
- MIR_mir_surface_spec_set_state(spec, mir_surface_state_maximized);
+ spec = MIR_mir_create_window_spec(mir_data->connection);
+ MIR_mir_window_spec_set_state(spec, mir_window_state_maximized);
- MIR_mir_surface_apply_spec(mir_window->surface, spec);
- MIR_mir_surface_spec_release(spec);
+ MIR_mir_window_apply_spec(mir_window->window, spec);
+ MIR_mir_window_spec_release(spec);
}
void
@@ -241,16 +242,16 @@ MIR_MinimizeWindow(_THIS, SDL_Window* window)
{
MIR_Data* mir_data = _this->driverdata;
MIR_Window* mir_window = window->driverdata;
- MirSurfaceSpec* spec;
+ MirWindowSpec* spec;
if (IsSurfaceValid(mir_window) < 0)
return;
- spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection);
- MIR_mir_surface_spec_set_state(spec, mir_surface_state_minimized);
+ spec = MIR_mir_create_window_spec(mir_data->connection);
+ MIR_mir_window_spec_set_state(spec, mir_window_state_minimized);
- MIR_mir_surface_apply_spec(mir_window->surface, spec);
- MIR_mir_surface_spec_release(spec);
+ MIR_mir_window_apply_spec(mir_window->window, spec);
+ MIR_mir_window_spec_release(spec);
}
void
@@ -258,16 +259,16 @@ MIR_RestoreWindow(_THIS, SDL_Window * window)
{
MIR_Data* mir_data = _this->driverdata;
MIR_Window* mir_window = window->driverdata;
- MirSurfaceSpec* spec;
+ MirWindowSpec* spec;
if (IsSurfaceValid(mir_window) < 0)
return;
- spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection);
- MIR_mir_surface_spec_set_state(spec, mir_surface_state_restored);
+ spec = MIR_mir_create_window_spec(mir_data->connection);
+ MIR_mir_window_spec_set_state(spec, mir_window_state_restored);
- MIR_mir_surface_apply_spec(mir_window->surface, spec);
- MIR_mir_surface_spec_release(spec);
+ MIR_mir_window_apply_spec(mir_window->window, spec);
+ MIR_mir_window_spec_release(spec);
}
void
@@ -275,16 +276,16 @@ MIR_HideWindow(_THIS, SDL_Window* window)
{
MIR_Data* mir_data = _this->driverdata;
MIR_Window* mir_window = window->driverdata;
- MirSurfaceSpec* spec;
+ MirWindowSpec* spec;
if (IsSurfaceValid(mir_window) < 0)
return;
- spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection);
- MIR_mir_surface_spec_set_state(spec, mir_surface_state_hidden);
+ spec = MIR_mir_create_window_spec(mir_data->connection);
+ MIR_mir_window_spec_set_state(spec, mir_window_state_hidden);
- MIR_mir_surface_apply_spec(mir_window->surface, spec);
- MIR_mir_surface_spec_release(spec);
+ MIR_mir_window_apply_spec(mir_window->window, spec);
+ MIR_mir_window_spec_release(spec);
}
void
@@ -292,18 +293,18 @@ MIR_SetWindowSize(_THIS, SDL_Window* window)
{
MIR_Data* mir_data = _this->driverdata;
MIR_Window* mir_window = window->driverdata;
- MirSurfaceSpec* spec;
+ MirWindowSpec* spec;
if (IsSurfaceValid(mir_window) < 0)
return;
/* You cannot set the x/y of a mir window! So only update w/h */
- spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection);
- MIR_mir_surface_spec_set_width (spec, window->w);
- MIR_mir_surface_spec_set_height(spec, window->h);
+ spec = MIR_mir_create_window_spec(mir_data->connection);
+ MIR_mir_window_spec_set_width (spec, window->w);
+ MIR_mir_window_spec_set_height(spec, window->h);
- MIR_mir_surface_apply_spec(mir_window->surface, spec);
- MIR_mir_surface_spec_release(spec);
+ MIR_mir_window_apply_spec(mir_window->window, spec);
+ MIR_mir_window_spec_release(spec);
}
void
@@ -311,17 +312,17 @@ MIR_SetWindowMinimumSize(_THIS, SDL_Window* window)
{
MIR_Data* mir_data = _this->driverdata;
MIR_Window* mir_window = window->driverdata;
- MirSurfaceSpec* spec;
+ MirWindowSpec* spec;
if (IsSurfaceValid(mir_window) < 0)
return;
- spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection);
- MIR_mir_surface_spec_set_min_width (spec, window->min_w);
- MIR_mir_surface_spec_set_min_height(spec, window->min_h);
+ spec = MIR_mir_create_window_spec(mir_data->connection);
+ MIR_mir_window_spec_set_width (spec, window->min_w);
+ MIR_mir_window_spec_set_height(spec, window->min_h);
- MIR_mir_surface_apply_spec(mir_window->surface, spec);
- MIR_mir_surface_spec_release(spec);
+ MIR_mir_window_apply_spec(mir_window->window, spec);
+ MIR_mir_window_spec_release(spec);
}
void
@@ -329,17 +330,17 @@ MIR_SetWindowMaximumSize(_THIS, SDL_Window* window)
{
MIR_Data* mir_data = _this->driverdata;
MIR_Window* mir_window = window->driverdata;
- MirSurfaceSpec* spec;
+ MirWindowSpec* spec;
if (IsSurfaceValid(mir_window) < 0)
return;
- spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection);
- MIR_mir_surface_spec_set_max_width (spec, window->max_w);
- MIR_mir_surface_spec_set_max_height(spec, window->max_h);
+ spec = MIR_mir_create_window_spec(mir_data->connection);
+ MIR_mir_window_spec_set_max_width(spec, window->max_w);
+ MIR_mir_window_spec_set_max_height(spec, window->max_h);
- MIR_mir_surface_apply_spec(mir_window->surface, spec);
- MIR_mir_surface_spec_release(spec);
+ MIR_mir_window_apply_spec(mir_window->window, spec);
+ MIR_mir_window_spec_release(spec);
}
void
@@ -348,16 +349,16 @@ MIR_SetWindowTitle(_THIS, SDL_Window* window)
MIR_Data* mir_data = _this->driverdata;
MIR_Window* mir_window = window->driverdata;
char const* title = window->title ? window->title : "";
- MirSurfaceSpec* spec;
+ MirWindowSpec* spec;
if (IsSurfaceValid(mir_window) < 0)
return;
- spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection);
- MIR_mir_surface_spec_set_name(spec, title);
+ spec = MIR_mir_create_window_spec(mir_data->connection);
+ MIR_mir_window_spec_set_name(spec, title);
- MIR_mir_surface_apply_spec(mir_window->surface, spec);
- MIR_mir_surface_spec_release(spec);
+ MIR_mir_window_apply_spec(mir_window->window, spec);
+ MIR_mir_window_spec_release(spec);
}
void
@@ -366,16 +367,16 @@ MIR_SetWindowGrab(_THIS, SDL_Window* window, SDL_bool grabbed)
MIR_Data* mir_data = _this->driverdata;
MIR_Window* mir_window = window->driverdata;
MirPointerConfinementState confined = mir_pointer_unconfined;
- MirSurfaceSpec* spec;
+ MirWindowSpec* spec;
if (grabbed)
- confined = mir_pointer_confined_to_surface;
+ confined = mir_pointer_confined_to_window;
- spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection);
- MIR_mir_surface_spec_set_pointer_confinement(spec, confined);
+ spec = MIR_mir_create_window_spec(mir_data->connection);
+ MIR_mir_window_spec_set_pointer_confinement(spec, confined);
- MIR_mir_surface_apply_spec(mir_window->surface, spec);
- MIR_mir_surface_spec_release(spec);
+ MIR_mir_window_apply_spec(mir_window->window, spec);
+ MIR_mir_window_spec_release(spec);
}
int
diff --git a/src/video/mir/SDL_mirwindow.h b/src/video/mir/SDL_mirwindow.h
index 5b3020c..90f13ca 100644
--- a/src/video/mir/SDL_mirwindow.h
+++ b/src/video/mir/SDL_mirwindow.h
@@ -35,7 +35,7 @@ struct MIR_Window {
SDL_Window* sdl_window;
MIR_Data* mir_data;
- MirSurface* surface;
+ MirWindow* window;
EGLSurface egl_surface;
};