Split weston_compositor_init into base and _gl
weston_compositor_init is always called late because most
implementations can't initialise GL until fairly late in the game.
Split it into a base version with the same name, followed by
weston_compositor_init_gl which can be called later on.
This simplifies compositor-wayland, which no longer needs a separate
global handler just for wl_seat.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index 2aa2ab0..8309715 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -1774,8 +1774,12 @@
ec = malloc(sizeof *ec);
if (ec == NULL)
return NULL;
-
memset(ec, 0, sizeof *ec);
+
+ if (weston_compositor_init(&ec->base, display, argc, argv,
+ config_file) < 0)
+ return NULL;
+
ec->udev = udev_new();
if (ec->udev == NULL) {
weston_log("failed to initialize udev context\n");
@@ -1826,9 +1830,7 @@
ec->prev_state = WESTON_COMPOSITOR_ACTIVE;
- /* Can't init base class until we have a current egl context */
- if (weston_compositor_init(&ec->base, display, argc, argv,
- config_file) < 0)
+ if (weston_compositor_init_gl(&ec->base) < 0)
return NULL;
for (key = KEY_F1; key < KEY_F9; key++)