From 1a5c19ec51e76ddaec469d1231e6bdb087323d79 Mon Sep 17 00:00:00 2001 From: Simon Fels Date: Mon, 23 Jul 2018 16:37:54 +0200 Subject: [PATCH] sdl: take native window and display for wayland from SDL --- CMakeLists.txt | 2 ++ src/anbox/platform/sdl/window.cpp | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 31c219a..1f19992 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,6 +76,8 @@ pkg_check_modules(LIBSYSTEMD libsystemd REQUIRED) # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMIR_SUPPORT") # endif() +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMESA_EGL_NO_X11_HEADERS") + ##################################################################### # Enable code coverage calculation with gcov/gcovr/lcov # Usage: diff --git a/src/anbox/platform/sdl/window.cpp b/src/anbox/platform/sdl/window.cpp index 71a2066..ede433e 100644 --- a/src/anbox/platform/sdl/window.cpp +++ b/src/anbox/platform/sdl/window.cpp @@ -83,6 +83,10 @@ Window::Window(const std::shared_ptr &renderer, native_display_ = static_cast(info.info.x11.display); native_window_ = static_cast(info.info.x11.window); break; + case SDL_SYSWM_WAYLAND: + native_display_ = static_cast(info.info.wl.display); + native_window_ = reinterpret_cast(info.info.wl.surface); + break; #if defined(MIR_SUPPORT) case SDL_SYSWM_MIR: { native_display_ = static_cast(mir_connection_get_egl_native_display(info.info.mir.connection));