From e242c2f9f4b2da2ea554e40fb913958d80e50ce9 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sun, 2 Feb 2014 23:53:48 -0500 Subject: [PATCH] Added some SysWM bits for Mir. --HG-- extra : rebase_source : e02d7f813f5b5a5af2a546c29af91ed16e038752 extra : histedit_source : 0f7c419f2002c176606b30e87f94049287bf3aac --- include/SDL_syswm.h | 13 +++++++++++++ src/video/mir/SDL_mirwindow.c | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/include/SDL_syswm.h b/include/SDL_syswm.h index c26f141fa..40e8ca7c6 100644 --- a/include/SDL_syswm.h +++ b/include/SDL_syswm.h @@ -93,6 +93,11 @@ typedef struct _UIWindow UIWindow; #endif #endif +#if defined(SDL_VIDEO_DRIVER_MIR) +#include +#endif + + /** * These are the various supported windowing subsystems */ @@ -205,6 +210,14 @@ struct SDL_SysWMinfo 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; diff --git a/src/video/mir/SDL_mirwindow.c b/src/video/mir/SDL_mirwindow.c index f0d8a2af8..bea1c9b61 100644 --- a/src/video/mir/SDL_mirwindow.c +++ b/src/video/mir/SDL_mirwindow.c @@ -158,8 +158,12 @@ MIR_GetWindowWMInfo(_THIS, SDL_Window* window, SDL_SysWMinfo* info) { 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; }