static bool add_output(xcb_window_t window, struct wlc_output_information *info) { struct wlc_backend_surface bsurface; if (!wlc_backend_surface(&bsurface, surface_release, 0)) return false; bsurface.window = window; bsurface.display = x11.display; bsurface.api.page_flip = page_flip; struct wlc_output_event ev = { .add = { &bsurface, info }, .type = WLC_OUTPUT_EVENT_ADD };
static bool add_output(struct gbm_device *device, struct gbm_surface *surface, struct drm_output_information *info) { struct wlc_backend_surface bsurface; if (!wlc_backend_surface(&bsurface, surface_release, sizeof(struct drm_surface))) return false; struct drm_surface *dsurface = bsurface.internal; dsurface->connector = info->connector; dsurface->encoder = info->encoder; dsurface->crtc = info->crtc; dsurface->surface = surface; dsurface->device = device; bsurface.display = (EGLNativeDisplayType)device; bsurface.window = (EGLNativeWindowType)surface; bsurface.api.sleep = surface_sleep; bsurface.api.page_flip = page_flip; struct wlc_output_event ev = { .add = { &bsurface, &info->info }, .type = WLC_OUTPUT_EVENT_ADD };