diff --git a/cogl/cogl-xlib-renderer-private.h b/cogl/cogl-xlib-renderer-private.h index 3c2b6829b..ea0ee906f 100644 --- a/cogl/cogl-xlib-renderer-private.h +++ b/cogl/cogl-xlib-renderer-private.h @@ -48,6 +48,8 @@ typedef struct _CoglXlibRenderer CoglXlibTrapState *trap_state; unsigned long outputs_update_serial; + + XVisualInfo *xvisinfo; } CoglXlibRenderer; CoglBool diff --git a/cogl/cogl-xlib-renderer.c b/cogl/cogl-xlib-renderer.c index 740f1e435..8801c1cbf 100644 --- a/cogl/cogl-xlib-renderer.c +++ b/cogl/cogl-xlib-renderer.c @@ -58,6 +58,11 @@ static GList *_cogl_xlib_renderers = NULL; static void destroy_xlib_renderer_data (void *user_data) { + CoglXlibRenderer *data = user_data; + + if (data->xvisinfo) + XFree (data->xvisinfo); + g_slice_free (CoglXlibRenderer, user_data); } @@ -658,3 +663,15 @@ _cogl_xlib_renderer_output_for_rectangle (CoglRenderer *renderer, return max_overlapped; } + +XVisualInfo * +cogl_xlib_renderer_get_visual_info (CoglRenderer *renderer) +{ + CoglXlibRenderer *xlib_renderer; + + _COGL_RETURN_VAL_IF_FAIL (cogl_is_renderer (renderer), NULL); + + xlib_renderer = _cogl_xlib_renderer_get_data (renderer); + + return xlib_renderer->xvisinfo; +} diff --git a/cogl/cogl-xlib-renderer.h b/cogl/cogl-xlib-renderer.h index 6318957a6..fdce06b03 100644 --- a/cogl/cogl-xlib-renderer.h +++ b/cogl/cogl-xlib-renderer.h @@ -34,6 +34,7 @@ #define __COGL_XLIB_RENDERER_H__ #include +#include /* NB: this is a top-level header that can be included directly but we * want to be careful not to define __COGL_H_INSIDE__ when this is @@ -169,6 +170,9 @@ cogl_xlib_renderer_set_event_retrieval_enabled (CoglRenderer *renderer, Display * cogl_xlib_renderer_get_display (CoglRenderer *renderer); +XVisualInfo * +cogl_xlib_renderer_get_visual_info (CoglRenderer *renderer); + COGL_END_DECLS /* The gobject introspection scanner seems to parse public headers in diff --git a/cogl/cogl.symbols b/cogl/cogl.symbols index c48314ac6..c3b9f5a78 100644 --- a/cogl/cogl.symbols +++ b/cogl/cogl.symbols @@ -1063,6 +1063,7 @@ cogl_xlib_handle_event cogl_xlib_renderer_add_filter cogl_xlib_renderer_get_display cogl_xlib_renderer_get_foreign_display +cogl_xlib_renderer_get_visual_info cogl_xlib_renderer_handle_event cogl_xlib_renderer_remove_filter cogl_xlib_renderer_set_event_retrieval_enabled