1
0
Fork 0

mir: return whether a foreign connection has been set or not

This commit is contained in:
Marco Trevisan (Treviño) 2014-11-20 07:17:19 +01:00
parent e06a0b3d10
commit 8e6997db44
2 changed files with 9 additions and 6 deletions

View file

@ -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);

View file

@ -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 *