mir: Get ready for Mir 1.0, clean up deprecations. Thanks Michał Kuchta!
authorBrandon Schaefer <brandon.schaefer@canonical.com>
Mon, 27 Feb 2017 12:20:16 -0800
changeset 10921f426dbef4aa0
parent 10920 ffdf6433884c
child 10922 5f4b80b748dd
mir: Get ready for Mir 1.0, clean up deprecations. Thanks Michał Kuchta!
configure.in
src/video/mir/SDL_mirevents.c
src/video/mir/SDL_mirevents.h
src/video/mir/SDL_mirframebuffer.c
src/video/mir/SDL_mirmouse.c
src/video/mir/SDL_mirsym.h
src/video/mir/SDL_mirwindow.c
src/video/mir/SDL_mirwindow.h
     1.1 --- a/configure.in	Mon Feb 27 10:11:40 2017 -0500
     1.2 +++ b/configure.in	Mon Feb 27 12:20:16 2017 -0800
     1.3 @@ -1414,11 +1414,11 @@
     1.4                  save_CFLAGS="$CFLAGS"
     1.5                  CFLAGS="$save_CFLAGS $MIR_CFLAGS"
     1.6  
     1.7 -                dnl This will disable Mir if >= v0.25 is not available
     1.8 +                dnl This will disable Mir if >= v0.26 is not available
     1.9                  AC_TRY_COMPILE([
    1.10                  #include <mir_toolkit/mir_client_library.h>
    1.11                  ],[
    1.12 -                    MirTouchAction actions = mir_touch_actions
    1.13 +                    MirWindowAttrib attrib = mir_window_attrib_state
    1.14                  ],[
    1.15                  video_mir=yes
    1.16                  ])
     2.1 --- a/src/video/mir/SDL_mirevents.c	Mon Feb 27 10:11:40 2017 -0500
     2.2 +++ b/src/video/mir/SDL_mirevents.c	Mon Feb 27 12:20:16 2017 -0800
     2.3 @@ -270,23 +270,23 @@
     2.4  }
     2.5  
     2.6  static void
     2.7 -MIR_HandleSurface(MirSurfaceEvent const* surface_event, SDL_Window* window)
     2.8 +MIR_HandleWindow(MirWindowEvent const* event, SDL_Window* window)
     2.9  {
    2.10 -    MirSurfaceAttrib attrib = MIR_mir_surface_event_get_attribute(surface_event);
    2.11 -    int value               = MIR_mir_surface_event_get_attribute_value(surface_event);
    2.12 +    MirWindowAttrib attrib = MIR_mir_window_event_get_attribute(event);
    2.13 +    int value              = MIR_mir_window_event_get_attribute_value(event);
    2.14  
    2.15 -    if (attrib == mir_surface_attrib_focus) {
    2.16 -        if (value == mir_surface_focused) {
    2.17 +    if (attrib == mir_window_attrib_focus) {
    2.18 +        if (value == mir_window_focus_state_focused) {
    2.19              SDL_SetKeyboardFocus(window);
    2.20          }
    2.21 -        else if (value == mir_surface_unfocused) {
    2.22 +        else if (value == mir_window_focus_state_unfocused) {
    2.23              SDL_SetKeyboardFocus(NULL);
    2.24          }
    2.25      }
    2.26  }
    2.27  
    2.28  void
    2.29 -MIR_HandleEvent(MirSurface* surface, MirEvent const* ev, void* context)
    2.30 +MIR_HandleEvent(MirWindow* mirwindow, MirEvent const* ev, void* context)
    2.31  {
    2.32      MirEventType event_type = MIR_mir_event_get_type(ev);
    2.33      SDL_Window* window      = (SDL_Window*)context;
    2.34 @@ -299,8 +299,8 @@
    2.35              case (mir_event_type_resize):
    2.36                  MIR_HandleResize(MIR_mir_event_get_resize_event(ev), window);
    2.37                  break;
    2.38 -            case (mir_event_type_surface):
    2.39 -                MIR_HandleSurface(MIR_mir_event_get_surface_event(ev), window);
    2.40 +            case (mir_event_type_window):
    2.41 +                MIR_HandleWindow(MIR_mir_event_get_window_event(ev), window);
    2.42                  break;
    2.43              default:
    2.44                  break;
     3.1 --- a/src/video/mir/SDL_mirevents.h	Mon Feb 27 10:11:40 2017 -0500
     3.2 +++ b/src/video/mir/SDL_mirevents.h	Mon Feb 27 12:20:16 2017 -0800
     3.3 @@ -29,7 +29,7 @@
     3.4  #include <mir_toolkit/mir_client_library.h>
     3.5  
     3.6  extern void
     3.7 -MIR_HandleEvent(MirSurface* surface, MirEvent const* ev, void* context);
     3.8 +MIR_HandleEvent(MirWindow*, MirEvent const* ev, void* context);
     3.9  
    3.10  #endif /* _SDL_mirevents_h */
    3.11  
     4.1 --- a/src/video/mir/SDL_mirframebuffer.c	Mon Feb 27 10:11:40 2017 -0500
     4.2 +++ b/src/video/mir/SDL_mirframebuffer.c	Mon Feb 27 12:20:16 2017 -0800
     4.3 @@ -70,7 +70,7 @@
     4.4      char* s_dest;
     4.5      char* pixels;
     4.6  
     4.7 -    bs = MIR_mir_surface_get_buffer_stream(mir_window->surface);
     4.8 +    bs = MIR_mir_window_get_buffer_stream(mir_window->window);
     4.9      MIR_mir_buffer_stream_get_graphics_region(bs, &region);
    4.10  
    4.11      s_dest = region.vaddr;
     5.1 --- a/src/video/mir/SDL_mirmouse.c	Mon Feb 27 10:11:40 2017 -0500
     5.2 +++ b/src/video/mir/SDL_mirmouse.c	Mon Feb 27 12:20:16 2017 -0800
     5.3 @@ -41,6 +41,7 @@
     5.4  {
     5.5      MirCursorConfiguration* conf;
     5.6      MirBufferStream*        stream;
     5.7 +    char const*             name;
     5.8  } MIR_Cursor;
     5.9  
    5.10  static SDL_Cursor*
    5.11 @@ -55,6 +56,7 @@
    5.12          if (mir_cursor) {
    5.13              mir_cursor->conf   = NULL;
    5.14              mir_cursor->stream = NULL;
    5.15 +            mir_cursor->name   = NULL;
    5.16              cursor->driverdata = mir_cursor;
    5.17          }
    5.18          else {
    5.19 @@ -188,7 +190,7 @@
    5.20              return NULL;
    5.21      }
    5.22  
    5.23 -    mir_cursor->conf = MIR_mir_cursor_configuration_from_name(cursor_name);
    5.24 +    mir_cursor->name = cursor_name;
    5.25  
    5.26      return cursor;
    5.27  }
    5.28 @@ -220,18 +222,25 @@
    5.29      MIR_Window* mir_window  = mir_data->current_window;
    5.30  
    5.31      if (cursor && cursor->driverdata) {
    5.32 -        if (mir_window && MIR_mir_surface_is_valid(mir_window->surface)) {
    5.33 +        if (mir_window && MIR_mir_window_is_valid(mir_window->window)) {
    5.34              MIR_Cursor* mir_cursor = (MIR_Cursor*)cursor->driverdata;
    5.35  
    5.36 +            if (mir_cursor->name != NULL) {
    5.37 +                MirWindowSpec* spec = MIR_mir_create_window_spec(mir_data->connection);
    5.38 +                MIR_mir_window_spec_set_cursor_name(spec, mir_cursor->name);
    5.39 +                MIR_mir_window_apply_spec(mir_window->window, spec);
    5.40 +                MIR_mir_window_spec_release(spec);
    5.41 +            }
    5.42 +
    5.43              if (mir_cursor->conf) {
    5.44 -                MIR_mir_surface_configure_cursor(mir_window->surface, mir_cursor->conf);
    5.45 +                MIR_mir_window_configure_cursor(mir_window->window, mir_cursor->conf);
    5.46              }
    5.47          }
    5.48      }
    5.49 -    else if(mir_window && MIR_mir_surface_is_valid(mir_window->surface)) {
    5.50 -        MIR_mir_surface_configure_cursor(mir_window->surface, NULL);
    5.51 +    else if(mir_window && MIR_mir_window_is_valid(mir_window->window)) {
    5.52 +        MIR_mir_window_configure_cursor(mir_window->window, NULL);
    5.53      }
    5.54 -    
    5.55 +
    5.56      return 0;
    5.57  }
    5.58  
     6.1 --- a/src/video/mir/SDL_mirsym.h	Mon Feb 27 10:11:40 2017 -0500
     6.2 +++ b/src/video/mir/SDL_mirsym.h	Mon Feb 27 12:20:16 2017 -0800
     6.3 @@ -34,28 +34,30 @@
     6.4  #endif
     6.5  
     6.6  SDL_MIR_MODULE(MIR_CLIENT)
     6.7 -SDL_MIR_SYM(MirSurface *,mir_surface_create_sync,(MirSurfaceSpec* spec))
     6.8 +SDL_MIR_SYM(MirWindow *,mir_create_window_sync,(MirWindowSpec* spec))
     6.9  SDL_MIR_SYM(MirEGLNativeWindowType,mir_buffer_stream_get_egl_native_window,(MirBufferStream *surface))
    6.10 -SDL_MIR_SYM(void,mir_buffer_stream_get_graphics_region,(MirBufferStream *stream, MirGraphicsRegion *graphics_region))
    6.11 +SDL_MIR_SYM(bool,mir_buffer_stream_get_graphics_region,(MirBufferStream *stream, MirGraphicsRegion *graphics_region))
    6.12  SDL_MIR_SYM(void,mir_buffer_stream_swap_buffers_sync,(MirBufferStream *stream))
    6.13 -SDL_MIR_SYM(void,mir_surface_set_event_handler,(MirSurface *surface, mir_surface_event_callback callback, void* context))
    6.14 -SDL_MIR_SYM(MirSurfaceSpec*,mir_connection_create_spec_for_normal_surface,(MirConnection *connection, int width, int height, MirPixelFormat format))
    6.15 -SDL_MIR_SYM(MirSurfaceSpec*,mir_connection_create_spec_for_changes,(MirConnection *connection))
    6.16 -SDL_MIR_SYM(void,mir_surface_spec_set_buffer_usage,(MirSurfaceSpec *spec, MirBufferUsage usage))
    6.17 -SDL_MIR_SYM(void,mir_surface_spec_set_name,(MirSurfaceSpec *spec, char const *name))
    6.18 -SDL_MIR_SYM(void,mir_surface_spec_release,(MirSurfaceSpec *spec))
    6.19 -SDL_MIR_SYM(void,mir_surface_spec_set_width,(MirSurfaceSpec *spec, unsigned width))
    6.20 -SDL_MIR_SYM(void,mir_surface_spec_set_height,(MirSurfaceSpec *spec, unsigned height))
    6.21 -SDL_MIR_SYM(void,mir_surface_spec_set_min_width,(MirSurfaceSpec *spec, unsigned min_width))
    6.22 -SDL_MIR_SYM(void,mir_surface_spec_set_min_height,(MirSurfaceSpec *spec, unsigned min_height))
    6.23 -SDL_MIR_SYM(void,mir_surface_spec_set_max_width,(MirSurfaceSpec *spec, unsigned max_width))
    6.24 -SDL_MIR_SYM(void,mir_surface_spec_set_max_height,(MirSurfaceSpec *spec, unsigned max_height))
    6.25 -SDL_MIR_SYM(void,mir_surface_spec_set_type,(MirSurfaceSpec *spec, MirSurfaceType type))
    6.26 -SDL_MIR_SYM(void,mir_surface_spec_set_state,(MirSurfaceSpec *spec, MirSurfaceState state))
    6.27 -SDL_MIR_SYM(void,mir_surface_spec_set_pointer_confinement,(MirSurfaceSpec *spec, MirPointerConfinementState state))
    6.28 -SDL_MIR_SYM(void,mir_surface_apply_spec,(MirSurface *surface, MirSurfaceSpec *spec))
    6.29 -SDL_MIR_SYM(void,mir_surface_get_parameters,(MirSurface *surface, MirSurfaceParameters *params))
    6.30 -SDL_MIR_SYM(MirBufferStream*,mir_surface_get_buffer_stream,(MirSurface *surface))
    6.31 +SDL_MIR_SYM(void,mir_window_set_event_handler,(MirWindow* window, MirWindowEventCallback callback, void* context))
    6.32 +SDL_MIR_SYM(MirWindowSpec*,mir_create_normal_window_spec,(MirConnection *connection, int width, int height))
    6.33 +SDL_MIR_SYM(MirWindowSpec*,mir_create_window_spec,(MirConnection *connection))
    6.34 +SDL_MIR_SYM(void,mir_window_spec_set_buffer_usage,(MirWindowSpec *spec, MirBufferUsage usage))
    6.35 +SDL_MIR_SYM(void,mir_window_spec_set_name,(MirWindowSpec *spec, char const *name))
    6.36 +SDL_MIR_SYM(void,mir_window_spec_release,(MirWindowSpec *spec))
    6.37 +SDL_MIR_SYM(void,mir_window_spec_set_width,(MirWindowSpec *spec, unsigned width))
    6.38 +SDL_MIR_SYM(void,mir_window_spec_set_height,(MirWindowSpec *spec, unsigned height))
    6.39 +SDL_MIR_SYM(void,mir_window_spec_set_min_width,(MirWindowSpec *spec, unsigned min_width))
    6.40 +SDL_MIR_SYM(void,mir_window_spec_set_min_height,(MirWindowSpec *spec, unsigned min_height))
    6.41 +SDL_MIR_SYM(void,mir_window_spec_set_max_width,(MirWindowSpec *spec, unsigned max_width))
    6.42 +SDL_MIR_SYM(void,mir_window_spec_set_max_height,(MirWindowSpec *spec, unsigned max_height))
    6.43 +SDL_MIR_SYM(void,mir_window_spec_set_type,(MirWindowSpec *spec, MirWindowType type))
    6.44 +SDL_MIR_SYM(void,mir_window_spec_set_state,(MirWindowSpec *spec, MirWindowState state))
    6.45 +SDL_MIR_SYM(void,mir_window_spec_set_pointer_confinement,(MirWindowSpec *spec, MirPointerConfinementState state))
    6.46 +SDL_MIR_SYM(void,mir_window_spec_set_pixel_format,(MirWindowSpec *spec, MirPixelFormat pixel_format))
    6.47 +SDL_MIR_SYM(void,mir_window_spec_set_cursor_name,(MirWindowSpec *spec, char const* cursor_name))
    6.48 +SDL_MIR_SYM(void,mir_window_apply_spec,(MirWindow* window, MirWindowSpec* spec))
    6.49 +SDL_MIR_SYM(void,mir_window_get_parameters,(MirWindow *window, MirWindowParameters *params))
    6.50 +SDL_MIR_SYM(MirBufferStream*,mir_window_get_buffer_stream,(MirWindow* window))
    6.51  SDL_MIR_SYM(MirCursorConfiguration*,mir_cursor_configuration_from_buffer_stream,(MirBufferStream const* stream, int hot_x, int hot_y))
    6.52  SDL_MIR_SYM(MirBufferStream*,mir_connection_create_buffer_stream_sync,(MirConnection *connection, int w, int h, MirPixelFormat format, MirBufferUsage usage))
    6.53  SDL_MIR_SYM(MirKeyboardAction,mir_keyboard_event_action,(MirKeyboardEvent const *event))
    6.54 @@ -76,7 +78,7 @@
    6.55  SDL_MIR_SYM(MirKeyboardEvent const*,mir_input_event_get_keyboard_event,(MirInputEvent const *event))
    6.56  SDL_MIR_SYM(MirPointerEvent const*,mir_input_event_get_pointer_event,(MirInputEvent const *event))
    6.57  SDL_MIR_SYM(MirTouchEvent const*,mir_input_event_get_touch_event,(MirInputEvent const *event))
    6.58 -SDL_MIR_SYM(MirSurfaceEvent const*,mir_event_get_surface_event,(MirEvent const *event))
    6.59 +SDL_MIR_SYM(MirWindowEvent const*,mir_event_get_window_event,(MirEvent const *event))
    6.60  SDL_MIR_SYM(unsigned int,mir_touch_event_point_count,(MirTouchEvent const *event))
    6.61  SDL_MIR_SYM(void,mir_connection_get_available_surface_formats,(MirConnection* connection, MirPixelFormat* formats, unsigned const int format_size, unsigned int *num_valid_formats))
    6.62  SDL_MIR_SYM(MirEGLNativeDisplayType,mir_connection_get_egl_native_display,(MirConnection *connection))
    6.63 @@ -84,19 +86,17 @@
    6.64  SDL_MIR_SYM(void,mir_connection_release,(MirConnection *connection))
    6.65  SDL_MIR_SYM(MirPixelFormat,mir_connection_get_egl_pixel_format,(MirConnection* connection, void* egldisplay, void* eglconfig))
    6.66  SDL_MIR_SYM(MirConnection *,mir_connect_sync,(char const *server, char const *app_name))
    6.67 -SDL_MIR_SYM(char const *,mir_surface_get_error_message,(MirSurface *surface))
    6.68 -SDL_MIR_SYM(bool,mir_surface_is_valid,(MirSurface *surface))
    6.69 -SDL_MIR_SYM(void,mir_surface_release_sync,(MirSurface *surface))
    6.70 +SDL_MIR_SYM(char const *,mir_window_get_error_message,(MirWindow *window))
    6.71 +SDL_MIR_SYM(bool,mir_window_is_valid,(MirWindow *window))
    6.72 +SDL_MIR_SYM(void,mir_window_release_sync,(MirWindow* window))
    6.73  SDL_MIR_SYM(void,mir_buffer_stream_release_sync,(MirBufferStream *stream))
    6.74 -SDL_MIR_SYM(MirCursorConfiguration*,mir_cursor_configuration_from_name,(char const* cursor_name))
    6.75 -SDL_MIR_SYM(MirWaitHandle*,mir_surface_configure_cursor,(MirSurface* surface, MirCursorConfiguration const* conf))
    6.76 +SDL_MIR_SYM(void,mir_window_configure_cursor,(MirWindow* window, MirCursorConfiguration const* conf))
    6.77  SDL_MIR_SYM(void,mir_cursor_configuration_destroy,(MirCursorConfiguration* conf))
    6.78  SDL_MIR_SYM(int,mir_resize_event_get_width,(MirResizeEvent const* resize_event))
    6.79  SDL_MIR_SYM(int,mir_resize_event_get_height,(MirResizeEvent const* resize_event))
    6.80  SDL_MIR_SYM(char const*,mir_connection_get_error_message,(MirConnection* connection))
    6.81 -SDL_MIR_SYM(MirSurfaceAttrib,mir_surface_event_get_attribute,(MirSurfaceEvent const* surface_event))
    6.82 -SDL_MIR_SYM(int,mir_surface_event_get_attribute_value,(MirSurfaceEvent const* surface_event))
    6.83 -SDL_MIR_SYM(void,mir_wait_for,(MirWaitHandle* handle))
    6.84 +SDL_MIR_SYM(MirWindowAttrib,mir_window_event_get_attribute,(MirWindowEvent const* event))
    6.85 +SDL_MIR_SYM(int,mir_window_event_get_attribute_value,(MirWindowEvent const* window_event))
    6.86  SDL_MIR_SYM(MirDisplayConfig*,mir_connection_create_display_configuration,(MirConnection* connection))
    6.87  SDL_MIR_SYM(void,mir_display_config_release,(MirDisplayConfig* config))
    6.88  SDL_MIR_SYM(int,mir_display_config_get_num_outputs,(MirDisplayConfig const* config))
    6.89 @@ -116,7 +116,7 @@
    6.90  SDL_MIR_SYM(int,mir_output_mode_get_width,(MirOutputMode const* mode))
    6.91  SDL_MIR_SYM(int,mir_output_mode_get_height,(MirOutputMode const* mode))
    6.92  SDL_MIR_SYM(double,mir_output_mode_get_refresh_rate,(MirOutputMode const* mode))
    6.93 -SDL_MIR_SYM(MirOutputGammaSupported,mir_output_is_gamma_supported,(MirOutput const* output))
    6.94 +SDL_MIR_SYM(bool,mir_output_is_gamma_supported,(MirOutput const* output))
    6.95  SDL_MIR_SYM(uint32_t,mir_output_get_gamma_size,(MirOutput const* output))
    6.96  SDL_MIR_SYM(void,mir_output_get_gamma,(MirOutput const* output, uint16_t* red, uint16_t* green, uint16_t* blue, uint32_t size))
    6.97  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))
     7.1 --- a/src/video/mir/SDL_mirwindow.c	Mon Feb 27 10:11:40 2017 -0500
     7.2 +++ b/src/video/mir/SDL_mirwindow.c	Mon Feb 27 12:20:16 2017 -0800
     7.3 @@ -39,8 +39,8 @@
     7.4  int
     7.5  IsSurfaceValid(MIR_Window* mir_window)
     7.6  {
     7.7 -    if (!MIR_mir_surface_is_valid(mir_window->surface)) {
     7.8 -        const char* error = MIR_mir_surface_get_error_message(mir_window->surface);
     7.9 +    if (!MIR_mir_window_is_valid(mir_window->window)) {
    7.10 +        const char* error = MIR_mir_window_get_error_message(mir_window->window);
    7.11          return SDL_SetError("Failed to created a mir surface: %s", error);
    7.12      }
    7.13  
    7.14 @@ -81,7 +81,7 @@
    7.15      MirPixelFormat pixel_format;
    7.16      MirBufferUsage buffer_usage;
    7.17  
    7.18 -    MirSurfaceSpec* spec;
    7.19 +    MirWindowSpec* spec;
    7.20  
    7.21      mir_window = SDL_calloc(1, sizeof(MIR_Window));
    7.22      if (!mir_window)
    7.23 @@ -117,31 +117,31 @@
    7.24      if (mir_data->software)
    7.25          buffer_usage = mir_buffer_usage_software;
    7.26  
    7.27 -    spec = MIR_mir_connection_create_spec_for_normal_surface(mir_data->connection,
    7.28 -                                                             window->w,
    7.29 -                                                             window->h,
    7.30 -                                                             pixel_format);
    7.31 +    spec = MIR_mir_create_normal_window_spec(mir_data->connection,
    7.32 +                                             window->w,
    7.33 +                                             window->h);
    7.34  
    7.35 -    MIR_mir_surface_spec_set_buffer_usage(spec, buffer_usage);
    7.36 -    MIR_mir_surface_spec_set_name(spec, "Mir surface");
    7.37 +    MIR_mir_window_spec_set_buffer_usage(spec, buffer_usage);
    7.38 +    MIR_mir_window_spec_set_name(spec, "Mir surface");
    7.39 +    MIR_mir_window_spec_set_pixel_format(spec, pixel_format);
    7.40  
    7.41      if (window->flags & SDL_WINDOW_INPUT_FOCUS)
    7.42          SDL_SetKeyboardFocus(window);
    7.43  
    7.44 -    mir_window->surface = MIR_mir_surface_create_sync(spec);
    7.45 -    MIR_mir_surface_set_event_handler(mir_window->surface, MIR_HandleEvent, window);
    7.46 +    mir_window->window = MIR_mir_create_window_sync(spec);
    7.47 +    MIR_mir_window_set_event_handler(mir_window->window, MIR_HandleEvent, window);
    7.48  
    7.49 -    MIR_mir_surface_spec_release(spec);
    7.50 +    MIR_mir_window_spec_release(spec);
    7.51  
    7.52 -    if (!MIR_mir_surface_is_valid(mir_window->surface)) {
    7.53 +    if (!MIR_mir_window_is_valid(mir_window->window)) {
    7.54          return SDL_SetError("Failed to created a mir surface: %s",
    7.55 -            MIR_mir_surface_get_error_message(mir_window->surface));
    7.56 +            MIR_mir_window_get_error_message(mir_window->window));
    7.57      }
    7.58  
    7.59      if (window->flags & SDL_WINDOW_OPENGL) {
    7.60          EGLNativeWindowType egl_native_window =
    7.61                          (EGLNativeWindowType)MIR_mir_buffer_stream_get_egl_native_window(
    7.62 -                                                       MIR_mir_surface_get_buffer_stream(mir_window->surface));
    7.63 +                                                       MIR_mir_window_get_buffer_stream(mir_window->window));
    7.64  
    7.65          mir_window->egl_surface = SDL_EGL_CreateSurface(_this, egl_native_window);
    7.66  
    7.67 @@ -167,7 +167,7 @@
    7.68  
    7.69      if (mir_data) {
    7.70          SDL_EGL_DestroySurface(_this, mir_window->egl_surface);
    7.71 -        MIR_mir_surface_release_sync(mir_window->surface);
    7.72 +        MIR_mir_window_release_sync(mir_window->window);
    7.73  
    7.74          mir_data->current_window = NULL;
    7.75  
    7.76 @@ -185,7 +185,8 @@
    7.77  
    7.78          info->subsystem = SDL_SYSWM_MIR;
    7.79          info->info.mir.connection = mir_window->mir_data->connection;
    7.80 -        info->info.mir.surface = mir_window->surface;
    7.81 +        // Cannot change this to window due to it being in the public API
    7.82 +        info->info.mir.surface = mir_window->window;
    7.83  
    7.84          return SDL_TRUE;
    7.85      }
    7.86 @@ -200,23 +201,23 @@
    7.87  {
    7.88      MIR_Data*   mir_data   = _this->driverdata;
    7.89      MIR_Window* mir_window = window->driverdata;
    7.90 -    MirSurfaceSpec* spec;
    7.91 -    MirSurfaceState state;
    7.92 +    MirWindowSpec* spec;
    7.93 +    MirWindowState state;
    7.94  
    7.95      if (IsSurfaceValid(mir_window) < 0)
    7.96          return;
    7.97  
    7.98      if (fullscreen) {
    7.99 -        state = mir_surface_state_fullscreen;
   7.100 +        state = mir_window_state_fullscreen;
   7.101      } else {
   7.102 -        state = mir_surface_state_restored;
   7.103 +        state = mir_window_state_restored;
   7.104      }
   7.105  
   7.106 -    spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection);
   7.107 -    MIR_mir_surface_spec_set_state(spec, state);
   7.108 +    spec = MIR_mir_create_window_spec(mir_data->connection);
   7.109 +    MIR_mir_window_spec_set_state(spec, state);
   7.110  
   7.111 -    MIR_mir_surface_apply_spec(mir_window->surface, spec);
   7.112 -    MIR_mir_surface_spec_release(spec);
   7.113 +    MIR_mir_window_apply_spec(mir_window->window, spec);
   7.114 +    MIR_mir_window_spec_release(spec);
   7.115  }
   7.116  
   7.117  void
   7.118 @@ -224,16 +225,16 @@
   7.119  {
   7.120      MIR_Data*   mir_data   = _this->driverdata;
   7.121      MIR_Window* mir_window = window->driverdata;
   7.122 -    MirSurfaceSpec* spec;
   7.123 +    MirWindowSpec* spec;
   7.124  
   7.125      if (IsSurfaceValid(mir_window) < 0)
   7.126          return;
   7.127  
   7.128 -    spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection);
   7.129 -    MIR_mir_surface_spec_set_state(spec, mir_surface_state_maximized);
   7.130 +    spec = MIR_mir_create_window_spec(mir_data->connection);
   7.131 +    MIR_mir_window_spec_set_state(spec, mir_window_state_maximized);
   7.132  
   7.133 -    MIR_mir_surface_apply_spec(mir_window->surface, spec);
   7.134 -    MIR_mir_surface_spec_release(spec);
   7.135 +    MIR_mir_window_apply_spec(mir_window->window, spec);
   7.136 +    MIR_mir_window_spec_release(spec);
   7.137  }
   7.138  
   7.139  void
   7.140 @@ -241,16 +242,16 @@
   7.141  {
   7.142      MIR_Data*   mir_data   = _this->driverdata;
   7.143      MIR_Window* mir_window = window->driverdata;
   7.144 -    MirSurfaceSpec* spec;
   7.145 +    MirWindowSpec* spec;
   7.146  
   7.147      if (IsSurfaceValid(mir_window) < 0)
   7.148          return;
   7.149  
   7.150 -    spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection);
   7.151 -    MIR_mir_surface_spec_set_state(spec, mir_surface_state_minimized);
   7.152 +    spec = MIR_mir_create_window_spec(mir_data->connection);
   7.153 +    MIR_mir_window_spec_set_state(spec, mir_window_state_minimized);
   7.154  
   7.155 -    MIR_mir_surface_apply_spec(mir_window->surface, spec);
   7.156 -    MIR_mir_surface_spec_release(spec);
   7.157 +    MIR_mir_window_apply_spec(mir_window->window, spec);
   7.158 +    MIR_mir_window_spec_release(spec);
   7.159  }
   7.160  
   7.161  void
   7.162 @@ -258,16 +259,16 @@
   7.163  {
   7.164      MIR_Data*   mir_data   = _this->driverdata;
   7.165      MIR_Window* mir_window = window->driverdata;
   7.166 -    MirSurfaceSpec* spec;
   7.167 +    MirWindowSpec* spec;
   7.168  
   7.169      if (IsSurfaceValid(mir_window) < 0)
   7.170          return;
   7.171  
   7.172 -    spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection);
   7.173 -    MIR_mir_surface_spec_set_state(spec, mir_surface_state_restored);
   7.174 +    spec = MIR_mir_create_window_spec(mir_data->connection);
   7.175 +    MIR_mir_window_spec_set_state(spec, mir_window_state_restored);
   7.176  
   7.177 -    MIR_mir_surface_apply_spec(mir_window->surface, spec);
   7.178 -    MIR_mir_surface_spec_release(spec);
   7.179 +    MIR_mir_window_apply_spec(mir_window->window, spec);
   7.180 +    MIR_mir_window_spec_release(spec);
   7.181  }
   7.182  
   7.183  void
   7.184 @@ -275,16 +276,16 @@
   7.185  {
   7.186      MIR_Data*   mir_data   = _this->driverdata;
   7.187      MIR_Window* mir_window = window->driverdata;
   7.188 -    MirSurfaceSpec* spec;
   7.189 +    MirWindowSpec* spec;
   7.190  
   7.191      if (IsSurfaceValid(mir_window) < 0)
   7.192          return;
   7.193  
   7.194 -    spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection);
   7.195 -    MIR_mir_surface_spec_set_state(spec, mir_surface_state_hidden);
   7.196 +    spec = MIR_mir_create_window_spec(mir_data->connection);
   7.197 +    MIR_mir_window_spec_set_state(spec, mir_window_state_hidden);
   7.198  
   7.199 -    MIR_mir_surface_apply_spec(mir_window->surface, spec);
   7.200 -    MIR_mir_surface_spec_release(spec);
   7.201 +    MIR_mir_window_apply_spec(mir_window->window, spec);
   7.202 +    MIR_mir_window_spec_release(spec);
   7.203  }
   7.204  
   7.205  void
   7.206 @@ -292,18 +293,18 @@
   7.207  {
   7.208      MIR_Data*   mir_data   = _this->driverdata;
   7.209      MIR_Window* mir_window = window->driverdata;
   7.210 -    MirSurfaceSpec* spec;
   7.211 +    MirWindowSpec* spec;
   7.212  
   7.213      if (IsSurfaceValid(mir_window) < 0)
   7.214          return;
   7.215  
   7.216      /* You cannot set the x/y of a mir window! So only update w/h */
   7.217 -    spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection);
   7.218 -    MIR_mir_surface_spec_set_width (spec, window->w);
   7.219 -    MIR_mir_surface_spec_set_height(spec, window->h);
   7.220 +    spec = MIR_mir_create_window_spec(mir_data->connection);
   7.221 +    MIR_mir_window_spec_set_width (spec, window->w);
   7.222 +    MIR_mir_window_spec_set_height(spec, window->h);
   7.223  
   7.224 -    MIR_mir_surface_apply_spec(mir_window->surface, spec);
   7.225 -    MIR_mir_surface_spec_release(spec);
   7.226 +    MIR_mir_window_apply_spec(mir_window->window, spec);
   7.227 +    MIR_mir_window_spec_release(spec);
   7.228  }
   7.229  
   7.230  void
   7.231 @@ -311,17 +312,17 @@
   7.232  {
   7.233      MIR_Data*   mir_data   = _this->driverdata;
   7.234      MIR_Window* mir_window = window->driverdata;
   7.235 -    MirSurfaceSpec* spec;
   7.236 +    MirWindowSpec* spec;
   7.237  
   7.238      if (IsSurfaceValid(mir_window) < 0)
   7.239          return;
   7.240  
   7.241 -    spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection);
   7.242 -    MIR_mir_surface_spec_set_min_width (spec, window->min_w);
   7.243 -    MIR_mir_surface_spec_set_min_height(spec, window->min_h);
   7.244 +    spec = MIR_mir_create_window_spec(mir_data->connection);
   7.245 +    MIR_mir_window_spec_set_width (spec, window->min_w);
   7.246 +    MIR_mir_window_spec_set_height(spec, window->min_h);
   7.247  
   7.248 -    MIR_mir_surface_apply_spec(mir_window->surface, spec);
   7.249 -    MIR_mir_surface_spec_release(spec);
   7.250 +    MIR_mir_window_apply_spec(mir_window->window, spec);
   7.251 +    MIR_mir_window_spec_release(spec);
   7.252  }
   7.253  
   7.254  void
   7.255 @@ -329,17 +330,17 @@
   7.256  {
   7.257      MIR_Data*   mir_data   = _this->driverdata;
   7.258      MIR_Window* mir_window = window->driverdata;
   7.259 -    MirSurfaceSpec* spec;
   7.260 +    MirWindowSpec* spec;
   7.261  
   7.262      if (IsSurfaceValid(mir_window) < 0)
   7.263          return;
   7.264  
   7.265 -    spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection);
   7.266 -    MIR_mir_surface_spec_set_max_width (spec, window->max_w);
   7.267 -    MIR_mir_surface_spec_set_max_height(spec, window->max_h);
   7.268 +    spec = MIR_mir_create_window_spec(mir_data->connection);
   7.269 +    MIR_mir_window_spec_set_max_width(spec, window->max_w);
   7.270 +    MIR_mir_window_spec_set_max_height(spec, window->max_h);
   7.271  
   7.272 -    MIR_mir_surface_apply_spec(mir_window->surface, spec);
   7.273 -    MIR_mir_surface_spec_release(spec);
   7.274 +    MIR_mir_window_apply_spec(mir_window->window, spec);
   7.275 +    MIR_mir_window_spec_release(spec);
   7.276  }
   7.277  
   7.278  void
   7.279 @@ -348,16 +349,16 @@
   7.280      MIR_Data*   mir_data   = _this->driverdata;
   7.281      MIR_Window* mir_window = window->driverdata;
   7.282      char const* title = window->title ? window->title : "";
   7.283 -    MirSurfaceSpec* spec;
   7.284 +    MirWindowSpec* spec;
   7.285  
   7.286      if (IsSurfaceValid(mir_window) < 0)
   7.287          return;
   7.288  
   7.289 -    spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection);
   7.290 -    MIR_mir_surface_spec_set_name(spec, title);
   7.291 +    spec = MIR_mir_create_window_spec(mir_data->connection);
   7.292 +    MIR_mir_window_spec_set_name(spec, title);
   7.293  
   7.294 -    MIR_mir_surface_apply_spec(mir_window->surface, spec);
   7.295 -    MIR_mir_surface_spec_release(spec);
   7.296 +    MIR_mir_window_apply_spec(mir_window->window, spec);
   7.297 +    MIR_mir_window_spec_release(spec);
   7.298  }
   7.299  
   7.300  void
   7.301 @@ -366,16 +367,16 @@
   7.302      MIR_Data*   mir_data   = _this->driverdata;
   7.303      MIR_Window* mir_window = window->driverdata;
   7.304      MirPointerConfinementState confined = mir_pointer_unconfined;
   7.305 -    MirSurfaceSpec* spec;
   7.306 +    MirWindowSpec* spec;
   7.307  
   7.308      if (grabbed)
   7.309 -        confined = mir_pointer_confined_to_surface;
   7.310 +        confined = mir_pointer_confined_to_window;
   7.311  
   7.312 -    spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection);
   7.313 -    MIR_mir_surface_spec_set_pointer_confinement(spec, confined);
   7.314 +    spec = MIR_mir_create_window_spec(mir_data->connection);
   7.315 +    MIR_mir_window_spec_set_pointer_confinement(spec, confined);
   7.316  
   7.317 -    MIR_mir_surface_apply_spec(mir_window->surface, spec);
   7.318 -    MIR_mir_surface_spec_release(spec);
   7.319 +    MIR_mir_window_apply_spec(mir_window->window, spec);
   7.320 +    MIR_mir_window_spec_release(spec);
   7.321  }
   7.322  
   7.323  int
     8.1 --- a/src/video/mir/SDL_mirwindow.h	Mon Feb 27 10:11:40 2017 -0500
     8.2 +++ b/src/video/mir/SDL_mirwindow.h	Mon Feb 27 12:20:16 2017 -0800
     8.3 @@ -35,7 +35,7 @@
     8.4      SDL_Window* sdl_window;
     8.5      MIR_Data*   mir_data;
     8.6  
     8.7 -    MirSurface* surface;
     8.8 +    MirWindow*  window;
     8.9      EGLSurface  egl_surface;
    8.10  };
    8.11