Added some SysWM bits for Mir.
authorRyan C. Gordon <icculus@icculus.org>
Sun, 02 Feb 2014 23:53:48 -0500
changeset 8155 cf0eda3f5e35
parent 8154 ea6b25de67b6
child 8156 d88db77c637e
Added some SysWM bits for Mir.
include/SDL_syswm.h
src/video/mir/SDL_mirwindow.c
--- a/include/SDL_syswm.h	Sun Feb 02 23:54:10 2014 -0500
+++ b/include/SDL_syswm.h	Sun Feb 02 23:53:48 2014 -0500
@@ -93,6 +93,11 @@
 #endif
 #endif
 
+#if defined(SDL_VIDEO_DRIVER_MIR)
+#include <mir_toolkit/mir_client_library.h>
+#endif
+
+
 /**
  *  These are the various supported windowing subsystems
  */
@@ -205,6 +210,14 @@
             struct wl_shell_surface *shell_surface; /**< Wayland shell_surface (window manager handle) */
         } wl;
 #endif
+#if defined(SDL_VIDEO_DRIVER_MIR)
+        struct
+        {
+            MirConnection *connection;  /**< Mir display server connection */
+            MirSurface *surface;  /**< Mir surface */
+        } mir;
+#endif
+
         /* Can't have an empty union */
         int dummy;
     } info;
--- a/src/video/mir/SDL_mirwindow.c	Sun Feb 02 23:54:10 2014 -0500
+++ b/src/video/mir/SDL_mirwindow.c	Sun Feb 02 23:53:48 2014 -0500
@@ -158,8 +158,12 @@
 {
     if (info->version.major == SDL_MAJOR_VERSION &&
         info->version.minor == SDL_MINOR_VERSION) {
+        MIR_Window* mir_window = window->driverdata;
 
         info->subsystem = SDL_SYSWM_MIR;
+        info->info.mir.connection = mir_window->mir_data->connection;
+        info->info.mir.surface = mir_window->surface;
+
         return SDL_TRUE;
     }