22 #include "../../SDL_internal.h" 24 #if SDL_VIDEO_DRIVER_WAYLAND && SDL_VIDEO_OPENGL_EGL 26 #include "../SDL_sysvideo.h" 27 #include "../../events/SDL_windowevents_c.h" 28 #include "../SDL_egl_c.h" 36 handle_ping(
void *
data,
struct wl_shell_surface *shell_surface,
39 wl_shell_surface_pong(shell_surface, serial);
43 handle_configure(
void *
data,
struct wl_shell_surface *shell_surface,
48 struct wl_region *region;
53 if (width == 0 || height == 0) {
59 if (window->
max_w > 0) {
64 if (window->
max_h > 0) {
73 if (width == window->
w && height == window->
h) {
79 WAYLAND_wl_egl_window_resize(wind->
egl_window, window->
w, window->
h, 0, 0);
82 wl_region_add(region, 0, 0, window->
w, window->
h);
83 wl_surface_set_opaque_region(wind->
surface, region);
84 wl_region_destroy(region);
89 handle_popup_done(
void *data,
struct wl_shell_surface *shell_surface)
93 static const struct wl_shell_surface_listener shell_surface_listener = {
99 #ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH 101 handle_onscreen_visibility(
void *data,
102 struct qt_extended_surface *qt_extended_surface,
int32_t visible)
107 handle_set_generic_property(
void *data,
108 struct qt_extended_surface *qt_extended_surface,
const char *
name,
109 struct wl_array *
value)
114 handle_close(
void *data,
struct qt_extended_surface *qt_extended_surface)
120 static const struct qt_extended_surface_listener extended_surface_listener = {
121 handle_onscreen_visibility,
122 handle_set_generic_property,
152 WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
168 WL_SHELL_SURFACE_FULLSCREEN_METHOD_SCALE,
200 struct wl_region *region;
202 data =
calloc(1,
sizeof *data);
226 wl_surface_set_user_data(data->
surface, data);
230 #ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH 231 if (c->surface_extension) {
232 data->extended_surface = qt_surface_extension_get_extended_surface(
233 c->surface_extension, data->
surface);
238 window->
w, window->
h);
244 return SDL_SetError(
"failed to create a window surface");
250 &shell_surface_listener, data);
253 #ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH 254 if (data->extended_surface) {
255 qt_extended_surface_set_user_data(data->extended_surface, data);
256 qt_extended_surface_add_listener(data->extended_surface,
257 &extended_surface_listener, data);
261 region = wl_compositor_create_region(c->
compositor);
262 wl_region_add(region, 0, 0, window->
w, window->
h);
263 wl_surface_set_opaque_region(data->
surface, region);
264 wl_region_destroy(region);
270 WAYLAND_wl_display_flush(c->
display);
279 struct wl_region *region;
281 WAYLAND_wl_egl_window_resize(wind->
egl_window, window->
w, window->
h, 0, 0);
283 region =wl_compositor_create_region(data->
compositor);
284 wl_region_add(region, 0, 0, window->
w, window->
h);
285 wl_surface_set_opaque_region(wind->
surface, region);
286 wl_region_destroy(region);
307 WAYLAND_wl_egl_window_destroy(wind->
egl_window);
312 #ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH 313 if (wind->extended_surface)
314 qt_extended_surface_destroy(wind->extended_surface);
316 wl_surface_destroy(wind->
surface);
319 WAYLAND_wl_display_flush(data->
display);
void Wayland_SetWindowSize(_THIS, SDL_Window *window)
void Wayland_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *_display, SDL_bool fullscreen)
SDL_DisplayMode fullscreen_mode
GLint GLint GLsizei width
int Wayland_SetWindowHitTest(SDL_Window *window, SDL_bool enabled)
struct wl_display * display
void Wayland_MaximizeWindow(_THIS, SDL_Window *window)
static SDL_Window * window
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
void Wayland_ShowWindow(_THIS, SDL_Window *window)
int Wayland_input_lock_pointer(struct SDL_WaylandInput *input)
#define SDL_WINDOWPOS_UNDEFINED
GLuint const GLchar * name
int SDL_SendWindowEvent(SDL_Window *window, Uint8 windowevent, int data1, int data2)
GLint GLint GLsizei GLsizei height
#define SDL_GL_LoadLibrary
struct SDL_WaylandInput * input
int Wayland_CreateWindow(_THIS, SDL_Window *window)
static SDL_VideoDevice * _this
void Wayland_SetWindowTitle(_THIS, SDL_Window *window)
void Wayland_DestroyWindow(_THIS, SDL_Window *window)
GLsizei const GLfloat * value
struct wl_shell_surface * shell_surface
SDL_bool Wayland_GetWindowWMInfo(_THIS, SDL_Window *window, SDL_SysWMinfo *info)
SDL_VideoData * waylandData
GLenum GLenum GLsizei const GLuint GLboolean enabled
#define SDL_OutOfMemory()
struct wl_compositor * compositor
void Wayland_RestoreWindow(_THIS, SDL_Window *window)
The type used to identify a window.
union SDL_SysWMinfo::@18 info
struct SDL_SysWMinfo::@18::@20 wl
struct wl_egl_window * egl_window