gdk: Support GdkWayland

We need to set up the Wayland display when using GDK and Wayland's
client-side API.
This commit is contained in:
Emmanuele Bassi 2015-01-12 17:48:04 +00:00
parent 00efa5371d
commit 8859ed44e1

View File

@ -45,10 +45,18 @@
#include <cogl/cogl-xlib.h> #include <cogl/cogl-xlib.h>
#endif #endif
#if defined(GDK_WINDOWING_WAYLAND) && defined(COGL_HAS_EGL_PLATFORM_WAYLAND_SUPPORT)
#include <cogl/cogl-wayland-client.h>
#endif
#ifdef GDK_WINDOWING_X11 #ifdef GDK_WINDOWING_X11
#include <gdk/gdkx.h> #include <gdk/gdkx.h>
#endif #endif
#ifdef GDK_WINDOWING_WAYLAND
#include <gdk/gdkwayland.h>
#endif
#ifdef GDK_WINDOWING_WIN32 #ifdef GDK_WINDOWING_WIN32
#include <gdk/gdkwin32.h> #include <gdk/gdkwin32.h>
#endif #endif
@ -275,6 +283,17 @@ clutter_backend_gdk_get_renderer (ClutterBackend *backend,
} }
else else
#endif #endif
#if defined(GDK_WINDOWING_WAYLAND) && defined(COGL_HAS_EGL_PLATFORM_WAYLAND_SUPPORT)
if (GDK_IS_WAYLAND_DISPLAY (backend_gdk->display))
{
struct wl_display *display = gdk_wayland_display_get_wl_display (backend_gdk->display);
/* Force a Wayland winsys */
cogl_renderer_set_winsys_id (renderer, COGL_WINSYS_ID_EGL_WAYLAND);
cogl_wayland_renderer_set_foreign_display (renderer, display);
}
else
#endif
#if defined(GDK_WINDOWING_WIN32) #if defined(GDK_WINDOWING_WIN32)
if (GDK_IS_WIN32_DISPLAY (backend_gdk->display)) if (GDK_IS_WIN32_DISPLAY (backend_gdk->display))
{ {