src/video/wayland/SDL_waylandvideo.c
changeset 9485 84407b33fe1e
parent 9484 8828b1a0ab67
child 9486 296b5f754af7
equal deleted inserted replaced
9484:8828b1a0ab67 9485:84407b33fe1e
   282 
   282 
   283     _this->driverdata = data;
   283     _this->driverdata = data;
   284 
   284 
   285     data->display = WAYLAND_wl_display_connect(NULL);
   285     data->display = WAYLAND_wl_display_connect(NULL);
   286     if (data->display == NULL) {
   286     if (data->display == NULL) {
       
   287         SDL_free(data);
   287         return SDL_SetError("Failed to connect to a Wayland display");
   288         return SDL_SetError("Failed to connect to a Wayland display");
   288     }
   289     }
   289 
   290 
   290     data->registry = wl_display_get_registry(data->display);
   291     data->registry = wl_display_get_registry(data->display);
   291     if (data->registry == NULL) {
   292     if (data->registry == NULL) {
       
   293         SDL_free(data);
   292         return SDL_SetError("Failed to get the Wayland registry");
   294         return SDL_SetError("Failed to get the Wayland registry");
   293     }
   295     }
   294 
   296 
   295     wl_registry_add_listener(data->registry, &registry_listener, data);
   297     wl_registry_add_listener(data->registry, &registry_listener, data);
   296 
   298 
   300     // Second roundtrip to receive all output events.
   302     // Second roundtrip to receive all output events.
   301     WAYLAND_wl_display_roundtrip(data->display);
   303     WAYLAND_wl_display_roundtrip(data->display);
   302 
   304 
   303     data->xkb_context = WAYLAND_xkb_context_new(0);
   305     data->xkb_context = WAYLAND_xkb_context_new(0);
   304     if (!data->xkb_context) {
   306     if (!data->xkb_context) {
       
   307         SDL_free(data);
   305         return SDL_SetError("Failed to create XKB context");
   308         return SDL_SetError("Failed to create XKB context");
   306     }
   309     }
   307 
   310 
   308     Wayland_InitMouse();
   311     Wayland_InitMouse();
   309 
   312