static void set_empty_input_region(struct widget *widget, struct display *display) { struct wl_compositor *compositor; struct wl_surface *surface; struct wl_region *region; compositor = display_get_compositor(display); surface = widget_get_wl_surface(widget); region = wl_compositor_create_region(compositor); wl_surface_set_input_region(surface, region); wl_region_destroy(region); }
static void triangle_create_egl_surface(struct triangle *tri, int width, int height) { EGLBoolean ret; tri->wl_surface = widget_get_wl_surface(tri->widget); tri->egl_window = wl_egl_window_create(tri->wl_surface, width, height); tri->egl_surface = eglCreateWindowSurface(tri->egl->dpy, tri->egl->conf, tri->egl_window, NULL); ret = eglMakeCurrent(tri->egl->dpy, tri->egl_surface, tri->egl_surface, tri->egl->ctx); assert(ret == EGL_TRUE); egl_make_swapbuffers_nonblock(tri->egl); triangle_init_gl(&tri->gl); }
static void global_handler(struct display *display, uint32_t name, const char *interface, uint32_t version, void *data) { struct box *box = data; if (strcmp(interface, "wl_scaler") == 0) { box->scaler_version = version < 2 ? version : 2; box->scaler = display_bind(display, name, &wl_scaler_interface, box->scaler_version); box->viewport = wl_scaler_get_viewport(box->scaler, widget_get_wl_surface(box->widget)); set_my_viewport(box); } }