summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2014-11-20 07:17:19 +0100
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2014-11-20 07:17:19 +0100
commit8e6997db449bcc58e79f9b9219f2f24427794a7f (patch)
tree4eeff02c27bc8560a464bdc06adf8385f34f585d
parente06a0b3d1019602f1ca72fbd594ee56a9a535e05 (diff)
mir: return whether a foreign connection has been set or not
-rw-r--r--cogl/cogl-mir-renderer.h4
-rw-r--r--cogl/winsys/cogl-winsys-egl-mir.c11
2 files changed, 9 insertions, 6 deletions
diff --git a/cogl/cogl-mir-renderer.h b/cogl/cogl-mir-renderer.h
index d03fbea1..f3da5ea2 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 4edad379..5173727d 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 *