mirror of
https://github.com/brl/mutter.git
synced 2025-02-08 17:44:09 +00:00
onscreen: Use the CoglRenderer API for retrieving the X visual
Instead of peeking into the winsys vtable.
This commit is contained in:
parent
e79d571453
commit
8e9d3e92d8
@ -44,6 +44,10 @@
|
|||||||
#include "cogl-poll-private.h"
|
#include "cogl-poll-private.h"
|
||||||
#include "cogl-gtype-private.h"
|
#include "cogl-gtype-private.h"
|
||||||
|
|
||||||
|
#ifdef COGL_HAS_X11_SUPPORT
|
||||||
|
#include "cogl-xlib-renderer.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
static void _cogl_onscreen_free (CoglOnscreen *onscreen);
|
static void _cogl_onscreen_free (CoglOnscreen *onscreen);
|
||||||
|
|
||||||
COGL_OBJECT_DEFINE_WITH_CODE_GTYPE (Onscreen, onscreen,
|
COGL_OBJECT_DEFINE_WITH_CODE_GTYPE (Onscreen, onscreen,
|
||||||
@ -447,18 +451,17 @@ cogl_x11_onscreen_get_window_xid (CoglOnscreen *onscreen)
|
|||||||
uint32_t
|
uint32_t
|
||||||
cogl_x11_onscreen_get_visual_xid (CoglOnscreen *onscreen)
|
cogl_x11_onscreen_get_visual_xid (CoglOnscreen *onscreen)
|
||||||
{
|
{
|
||||||
CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
|
CoglContext *ctx = COGL_FRAMEBUFFER (onscreen)->context;
|
||||||
const CoglWinsysVtable *winsys = _cogl_framebuffer_get_winsys (framebuffer);
|
|
||||||
XVisualInfo *visinfo;
|
XVisualInfo *visinfo;
|
||||||
uint32_t id;
|
uint32_t id;
|
||||||
|
|
||||||
/* This should only be called for xlib based onscreens */
|
/* This should only be called for xlib based onscreens */
|
||||||
_COGL_RETURN_VAL_IF_FAIL (winsys->xlib_get_visual_info != NULL, 0);
|
visinfo = cogl_xlib_renderer_get_visual_info (ctx->display->renderer);
|
||||||
|
if (visinfo == NULL)
|
||||||
|
return 0;
|
||||||
|
|
||||||
visinfo = winsys->xlib_get_visual_info ();
|
|
||||||
id = (uint32_t)visinfo->visualid;
|
id = (uint32_t)visinfo->visualid;
|
||||||
|
|
||||||
XFree (visinfo);
|
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
#endif /* COGL_HAS_X11_SUPPORT */
|
#endif /* COGL_HAS_X11_SUPPORT */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user