From 590e1c46f044dbb5082c9693f1398bb186e0ae4b Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Thu, 8 Dec 2011 16:21:57 +0000 Subject: [PATCH] wayland: Add API to access the shell surface for the onscreen Reviewed-by: Robert Bragg --- cogl/cogl-onscreen.h | 2 ++ cogl/winsys/cogl-winsys-egl.c | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/cogl/cogl-onscreen.h b/cogl/cogl-onscreen.h index 8a9d64aed..9bcc76935 100644 --- a/cogl/cogl-onscreen.h +++ b/cogl/cogl-onscreen.h @@ -131,6 +131,8 @@ cogl_win32_onscreen_get_window (CoglOnscreen *onscreen); #if defined (COGL_HAS_EGL_PLATFORM_WAYLAND_SUPPORT) struct wl_surface * cogl_wayland_onscreen_get_surface (CoglOnscreen *onscreen); +struct wl_shell_surface * +cogl_wayland_onscreen_get_shell_surface (CoglOnscreen *onscreen); #endif /* COGL_HAS_EGL_PLATFORM_WAYLAND_SUPPORT */ #define cogl_onscreen_set_swap_throttled cogl_onscreen_set_swap_throttled_EXP diff --git a/cogl/winsys/cogl-winsys-egl.c b/cogl/winsys/cogl-winsys-egl.c index abf7d23af..895a8d84f 100644 --- a/cogl/winsys/cogl-winsys-egl.c +++ b/cogl/winsys/cogl-winsys-egl.c @@ -1936,6 +1936,22 @@ cogl_wayland_onscreen_get_surface (CoglOnscreen *onscreen) return NULL; } + +struct wl_shell_surface * +cogl_wayland_onscreen_get_shell_surface (CoglOnscreen *onscreen) +{ + CoglFramebuffer *fb; + + fb = COGL_FRAMEBUFFER (onscreen); + if (fb->allocated) + { + CoglOnscreenEGL *egl_onscreen = onscreen->winsys; + return egl_onscreen->wayland_shell_surface; + } + else + return NULL; +} + #endif /* COGL_HAS_EGL_PLATFORM_WAYLAND_SUPPORT */ #ifdef EGL_KHR_image_base