diff --git a/cogl/cogl-mir-renderer.h b/cogl/cogl-mir-renderer.h index d03fbea16..f3da5ea22 100644 --- a/cogl/cogl-mir-renderer.h +++ b/cogl/cogl-mir-renderer.h @@ -49,10 +49,12 @@ COGL_BEGIN_DECLS * to work with instead of leaving Cogl to automatically connect to a * mir server. * + * Returns: whether @connection has been marked as been set as connection or not. + * * Since: 1.8 * Stability: unstable */ -void +CoglBool cogl_mir_renderer_set_foreign_connection (CoglRenderer *renderer, MirConnection *connection); diff --git a/cogl/winsys/cogl-winsys-egl-mir.c b/cogl/winsys/cogl-winsys-egl-mir.c index 4edad379d..5173727d1 100644 --- a/cogl/winsys/cogl-winsys-egl-mir.c +++ b/cogl/winsys/cogl-winsys-egl-mir.c @@ -626,17 +626,18 @@ _cogl_winsys_onscreen_set_visibility (CoglOnscreen *onscreen, mir_surface_set_state (mir_onscreen->mir_surface, new_state); } -void +CoglBool cogl_mir_renderer_set_foreign_connection (CoglRenderer *renderer, - MirConnection *connection) + MirConnection *connection) { - _COGL_RETURN_IF_FAIL (cogl_is_renderer (renderer)); - _COGL_RETURN_IF_FAIL (mir_connection_is_valid (connection)); + _COGL_RETURN_VAL_IF_FAIL (cogl_is_renderer (renderer), FALSE); + _COGL_RETURN_VAL_IF_FAIL (mir_connection_is_valid (connection), FALSE); /* NB: Renderers are considered immutable once connected */ - _COGL_RETURN_IF_FAIL (!renderer->connected); + _COGL_RETURN_VAL_IF_FAIL (!renderer->connected, FALSE); renderer->foreign_mir_connection = connection; + return TRUE; } MirConnection *