summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Bozhinov <ammen99@gmail.com>2019-01-25 15:50:29 +0100
committerIlia Bozhinov <ammen99@gmail.com>2019-02-06 10:29:44 +0100
commit3809e7b3875ae688e0febe927e4afb71e7e4e841 (patch)
treec77c91cf96e5369fe7fc04023ed4915510d88542
parente023a361e213d5d34f3cb49577788db05f645361 (diff)
downloadcogl-3809e7b3875ae688e0febe927e4afb71e7e4e841.tar.gz
wayland: do not require wl_shell
Most of the time when cogl is used, the app doesn't really need this functionality (i.e it manages the app window on its own). So requiring wl_shell turns out to prevent apps using for ex. xdg-shell from working on compositors that do not support wl_shell.
-rw-r--r--cogl/winsys/cogl-winsys-egl-wayland.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/cogl/winsys/cogl-winsys-egl-wayland.c b/cogl/winsys/cogl-winsys-egl-wayland.c
index dad7b1e4..7f4999d0 100644
--- a/cogl/winsys/cogl-winsys-egl-wayland.c
+++ b/cogl/winsys/cogl-winsys-egl-wayland.c
@@ -279,12 +279,12 @@ _cogl_winsys_renderer_connect (CoglRenderer *renderer,
* compostor and shell object.
*/
wl_display_roundtrip (wayland_renderer->wayland_display);
- if (!wayland_renderer->wayland_compositor || !wayland_renderer->wayland_shell)
+ if (!wayland_renderer->wayland_compositor)
{
_cogl_set_error (error,
COGL_WINSYS_ERROR,
COGL_WINSYS_ERROR_INIT,
- "Unable to find wl_compositor or wl_shell");
+ "Unable to find wl_compositor");
goto error;
}
@@ -520,9 +520,19 @@ _cogl_winsys_egl_onscreen_init (CoglOnscreen *onscreen,
NULL);
if (!onscreen->foreign_surface)
- wayland_onscreen->wayland_shell_surface =
- wl_shell_get_shell_surface (wayland_renderer->wayland_shell,
- wayland_onscreen->wayland_surface);
+ {
+ if (!wayland_renderer->wayland_shell)
+ {
+ _cogl_set_error (error, COGL_WINSYS_ERROR,
+ COGL_WINSYS_ERROR_CREATE_ONSCREEN,
+ "No foreign surface, and wl_shell unsupported by the compositor");
+ return FALSE;
+ }
+
+ wayland_onscreen->wayland_shell_surface =
+ wl_shell_get_shell_surface (wayland_renderer->wayland_shell,
+ wayland_onscreen->wayland_surface);
+ }
return TRUE;
}