SDL_waylandwindow.c
Go to the documentation of this file.
/*
Simple DirectMedia Layer
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "../../SDL_internal.h"
#if SDL_VIDEO_DRIVER_WAYLAND && SDL_VIDEO_OPENGL_EGL
#include "../SDL_sysvideo.h"
#include "../../events/SDL_windowevents_c.h"
#include "../SDL_egl_c.h"
#include "SDL_waylandevents_c.h"
#include "SDL_waylandwindow.h"
#include "SDL_waylandvideo.h"
#include "SDL_waylandtouch.h"
#include "SDL_waylanddyn.h"
#include "SDL_hints.h"
#include "xdg-shell-unstable-v6-client-protocol.h"
/* On modern desktops, we probably will use the xdg-shell protocol instead
of wl_shell, but wl_shell might be useful on older Wayland installs that
don't have the newer protocol, or embedded things that don't have a full
window manager. */
static void
handle_ping_wl_shell_surface(void *data, struct wl_shell_surface *shell_surface,
uint32_t serial)
{
wl_shell_surface_pong(shell_surface, serial);
}
static void
handle_configure_wl_shell_surface(void *data, struct wl_shell_surface *shell_surface,
uint32_t edges, int32_t width, int32_t height)
{
SDL_WindowData *wind = (SDL_WindowData *)data;
SDL_Window *window = wind->sdlwindow;
struct wl_region *region;
/* wl_shell_surface spec states that this is a suggestion.
Ignore if less than or greater than max/min size. */
if (width == 0 || height == 0) {
return;
}
if (!(window->flags & SDL_WINDOW_FULLSCREEN)) {
if ((window->flags & SDL_WINDOW_RESIZABLE)) {
if (window->max_w > 0) {
width = SDL_min(width, window->max_w);
}
width = SDL_max(width, window->min_w);
if (window->max_h > 0) {
height = SDL_min(height, window->max_h);
}
height = SDL_max(height, window->min_h);
} else {
return;
}
}
if (width == window->w && height == window->h) {
return;
}
window->w = width;
window->h = height;
WAYLAND_wl_egl_window_resize(wind->egl_window, window->w, window->h, 0, 0);
region = wl_compositor_create_region(wind->waylandData->compositor);
wl_region_add(region, 0, 0, window->w, window->h);
wl_surface_set_opaque_region(wind->surface, region);
wl_region_destroy(region);
SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, window->w, window->h);
}
static void
handle_popup_done_wl_shell_surface(void *data, struct wl_shell_surface *shell_surface)
{
}
static const struct wl_shell_surface_listener shell_surface_listener_wl = {
handle_ping_wl_shell_surface,
handle_configure_wl_shell_surface,
handle_popup_done_wl_shell_surface
};
static void
handle_configure_zxdg_shell_surface(void *data, struct zxdg_surface_v6 *zxdg, uint32_t serial)
{
SDL_WindowData *wind = (SDL_WindowData *)data;
SDL_Window *window = wind->sdlwindow;
struct wl_region *region;
WAYLAND_wl_egl_window_resize(wind->egl_window, window->w, window->h, 0, 0);
region = wl_compositor_create_region(wind->waylandData->compositor);
wl_region_add(region, 0, 0, window->w, window->h);
wl_surface_set_opaque_region(wind->surface, region);
wl_region_destroy(region);
SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, window->w, window->h);
zxdg_surface_v6_ack_configure(zxdg, serial);
}
static const struct zxdg_surface_v6_listener shell_surface_listener_zxdg = {
handle_configure_zxdg_shell_surface
};
static void
handle_configure_zxdg_toplevel(void *data,
struct zxdg_toplevel_v6 *zxdg_toplevel_v6,
int32_t width,
int32_t height,
struct wl_array *states)
{
SDL_WindowData *wind = (SDL_WindowData *)data;
SDL_Window *window = wind->sdlwindow;
/* wl_shell_surface spec states that this is a suggestion.
Ignore if less than or greater than max/min size. */
if (width == 0 || height == 0) {
return;
}
if (!(window->flags & SDL_WINDOW_FULLSCREEN)) {
if ((window->flags & SDL_WINDOW_RESIZABLE)) {
if (window->max_w > 0) {
width = SDL_min(width, window->max_w);
}
width = SDL_max(width, window->min_w);
if (window->max_h > 0) {
height = SDL_min(height, window->max_h);
}
height = SDL_max(height, window->min_h);
} else {
return;
}
}
if (width == window->w && height == window->h) {
return;
}
window->w = width;
window->h = height;
}
static void
handle_close_zxdg_toplevel(void *data, struct zxdg_toplevel_v6 *zxdg_toplevel_v6)
{
SDL_WindowData *window = (SDL_WindowData *)data;
SDL_SendWindowEvent(window->sdlwindow, SDL_WINDOWEVENT_CLOSE, 0, 0);
}
static const struct zxdg_toplevel_v6_listener toplevel_listener_zxdg = {
handle_configure_zxdg_toplevel,
handle_close_zxdg_toplevel
};
#ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH
static void
handle_onscreen_visibility(void *data,
struct qt_extended_surface *qt_extended_surface, int32_t visible)
{
}
static void
handle_set_generic_property(void *data,
struct qt_extended_surface *qt_extended_surface, const char *name,
struct wl_array *value)
{
}
static void
handle_close(void *data, struct qt_extended_surface *qt_extended_surface)
{
SDL_WindowData *window = (SDL_WindowData *)data;
SDL_SendWindowEvent(window->sdlwindow, SDL_WINDOWEVENT_CLOSE, 0, 0);
}
static const struct qt_extended_surface_listener extended_surface_listener = {
handle_onscreen_visibility,
handle_set_generic_property,
handle_close,
};
#endif /* SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH */
SDL_bool
Wayland_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info)
{
SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
const Uint32 version = ((((Uint32) info->version.major) * 1000000) +
(((Uint32) info->version.minor) * 10000) +
(((Uint32) info->version.patch)));
/* Before 2.0.6, it was possible to build an SDL with Wayland support
(SDL_SysWMinfo will be large enough to hold Wayland info), but build
your app against SDL headers that didn't have Wayland support
(SDL_SysWMinfo could be smaller than Wayland needs. This would lead
to an app properly using SDL_GetWindowWMInfo() but we'd accidentally
overflow memory on the stack or heap. To protect against this, we've
padded out the struct unconditionally in the headers and Wayland will
just return an error for older apps using this function. Those apps
will need to be recompiled against newer headers or not use Wayland,
maybe by forcing SDL_VIDEODRIVER=x11. */
if (version < 2000006) {
info->subsystem = SDL_SYSWM_UNKNOWN;
SDL_SetError("Version must be 2.0.6 or newer");
return SDL_FALSE;
}
info->info.wl.display = data->waylandData->display;
info->info.wl.surface = data->surface;
info->info.wl.shell_surface = data->shell_surface.wl;
info->subsystem = SDL_SYSWM_WAYLAND;
return SDL_TRUE;
}
int
Wayland_SetWindowHitTest(SDL_Window *window, SDL_bool enabled)
{
return 0; /* just succeed, the real work is done elsewhere. */
}
static void
SetFullscreen(_THIS, SDL_Window * window, struct wl_output *output)
{
const SDL_VideoData *viddata = (const SDL_VideoData *) _this->driverdata;
SDL_WindowData *wind = window->driverdata;
if (viddata->shell.zxdg) {
if (output) {
zxdg_toplevel_v6_set_fullscreen(wind->shell_surface.zxdg.roleobj.toplevel, output);
} else {
zxdg_toplevel_v6_unset_fullscreen(wind->shell_surface.zxdg.roleobj.toplevel);
}
} else {
if (output) {
wl_shell_surface_set_fullscreen(wind->shell_surface.wl,
WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
0, output);
} else {
wl_shell_surface_set_toplevel(wind->shell_surface.wl);
}
}
WAYLAND_wl_display_flush( ((SDL_VideoData*)_this->driverdata)->display );
}
void Wayland_ShowWindow(_THIS, SDL_Window *window)
{
struct wl_output *output = (struct wl_output *) window->fullscreen_mode.driverdata;
SetFullscreen(_this, window, (window->flags & SDL_WINDOW_FULLSCREEN) ? output : NULL);
}
#ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH
static void SDLCALL
QtExtendedSurface_OnHintChanged(void *userdata, const char *name,
const char *oldValue, const char *newValue)
{
struct qt_extended_surface *qt_extended_surface = userdata;
if (name == NULL) {
return;
}
if (strcmp(name, SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION) == 0) {
int32_t orientation = QT_EXTENDED_SURFACE_ORIENTATION_PRIMARYORIENTATION;
if (newValue != NULL) {
if (strcmp(newValue, "portrait") == 0) {
orientation = QT_EXTENDED_SURFACE_ORIENTATION_PORTRAITORIENTATION;
} else if (strcmp(newValue, "landscape") == 0) {
orientation = QT_EXTENDED_SURFACE_ORIENTATION_LANDSCAPEORIENTATION;
} else if (strcmp(newValue, "inverted-portrait") == 0) {
orientation = QT_EXTENDED_SURFACE_ORIENTATION_INVERTEDPORTRAITORIENTATION;
} else if (strcmp(newValue, "inverted-landscape") == 0) {
orientation = QT_EXTENDED_SURFACE_ORIENTATION_INVERTEDLANDSCAPEORIENTATION;
}
}
qt_extended_surface_set_content_orientation(qt_extended_surface, orientation);
} else if (strcmp(name, SDL_HINT_QTWAYLAND_WINDOW_FLAGS) == 0) {
uint32_t flags = 0;
if (newValue != NULL) {
char *tmp = strdup(newValue);
char *saveptr = NULL;
char *flag = strtok_r(tmp, " ", &saveptr);
while (flag) {
if (strcmp(flag, "OverridesSystemGestures") == 0) {
flags |= QT_EXTENDED_SURFACE_WINDOWFLAG_OVERRIDESSYSTEMGESTURES;
} else if (strcmp(flag, "StaysOnTop") == 0) {
flags |= QT_EXTENDED_SURFACE_WINDOWFLAG_STAYSONTOP;
} else if (strcmp(flag, "BypassWindowManager") == 0) {
// See https://github.com/qtproject/qtwayland/commit/fb4267103d
flags |= 4 /* QT_EXTENDED_SURFACE_WINDOWFLAG_BYPASSWINDOWMANAGER */;
}
flag = strtok_r(NULL, " ", &saveptr);
}
free(tmp);
}
qt_extended_surface_set_window_flags(qt_extended_surface, flags);
}
}
static void QtExtendedSurface_Subscribe(struct qt_extended_surface *surface, const char *name)
{
SDL_AddHintCallback(name, QtExtendedSurface_OnHintChanged, surface);
}
static void QtExtendedSurface_Unsubscribe(struct qt_extended_surface *surface, const char *name)
{
SDL_DelHintCallback(name, QtExtendedSurface_OnHintChanged, surface);
}
#endif /* SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH */
void
Wayland_SetWindowFullscreen(_THIS, SDL_Window * window,
SDL_VideoDisplay * _display, SDL_bool fullscreen)
{
struct wl_output *output = (struct wl_output *) _display->driverdata;
SetFullscreen(_this, window, fullscreen ? output : NULL);
}
void
Wayland_RestoreWindow(_THIS, SDL_Window * window)
{
SDL_WindowData *wind = window->driverdata;
const SDL_VideoData *viddata = (const SDL_VideoData *) _this->driverdata;
if (viddata->shell.zxdg) {
} else {
wl_shell_surface_set_toplevel(wind->shell_surface.wl);
}
WAYLAND_wl_display_flush( ((SDL_VideoData*)_this->driverdata)->display );
}
void
Wayland_MaximizeWindow(_THIS, SDL_Window * window)
{
SDL_WindowData *wind = window->driverdata;
SDL_VideoData *viddata = (SDL_VideoData *) _this->driverdata;
if (viddata->shell.zxdg) {
zxdg_toplevel_v6_set_maximized(wind->shell_surface.zxdg.roleobj.toplevel);
} else {
wl_shell_surface_set_maximized(wind->shell_surface.wl, NULL);
}
WAYLAND_wl_display_flush( viddata->display );
}
int Wayland_CreateWindow(_THIS, SDL_Window *window)
{
SDL_WindowData *data;
SDL_VideoData *c;
struct wl_region *region;
data = calloc(1, sizeof *data);
if (data == NULL)
return SDL_OutOfMemory();
c = _this->driverdata;
window->driverdata = data;
if (!(window->flags & SDL_WINDOW_OPENGL)) {
SDL_GL_LoadLibrary(NULL);
window->flags |= SDL_WINDOW_OPENGL;
}
if (window->x == SDL_WINDOWPOS_UNDEFINED) {
window->x = 0;
}
if (window->y == SDL_WINDOWPOS_UNDEFINED) {
window->y = 0;
}
data->waylandData = c;
data->sdlwindow = window;
data->surface =
wl_compositor_create_surface(c->compositor);
wl_surface_set_user_data(data->surface, data);
if (c->shell.zxdg) {
data->shell_surface.zxdg.surface = zxdg_shell_v6_get_xdg_surface(c->shell.zxdg, data->surface);
/* !!! FIXME: add popup role */
data->shell_surface.zxdg.roleobj.toplevel = zxdg_surface_v6_get_toplevel(data->shell_surface.zxdg.surface);
zxdg_toplevel_v6_add_listener(data->shell_surface.zxdg.roleobj.toplevel, &toplevel_listener_zxdg, data);
zxdg_toplevel_v6_set_app_id(data->shell_surface.zxdg.roleobj.toplevel, c->classname);
} else {
data->shell_surface.wl = wl_shell_get_shell_surface(c->shell.wl, data->surface);
wl_shell_surface_set_class(data->shell_surface.wl, c->classname);
}
#ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH
if (c->surface_extension) {
data->extended_surface = qt_surface_extension_get_extended_surface(
c->surface_extension, data->surface);
QtExtendedSurface_Subscribe(data->extended_surface, SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION);
QtExtendedSurface_Subscribe(data->extended_surface, SDL_HINT_QTWAYLAND_WINDOW_FLAGS);
}
#endif /* SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH */
data->egl_window = WAYLAND_wl_egl_window_create(data->surface,
window->w, window->h);
/* Create the GLES window surface */
data->egl_surface = SDL_EGL_CreateSurface(_this, (NativeWindowType) data->egl_window);
if (data->egl_surface == EGL_NO_SURFACE) {
return SDL_SetError("failed to create a window surface");
}
if (c->shell.zxdg) {
if (data->shell_surface.zxdg.surface) {
zxdg_surface_v6_set_user_data(data->shell_surface.zxdg.surface, data);
zxdg_surface_v6_add_listener(data->shell_surface.zxdg.surface, &shell_surface_listener_zxdg, data);
}
} else {
if (data->shell_surface.wl) {
wl_shell_surface_set_user_data(data->shell_surface.wl, data);
wl_shell_surface_add_listener(data->shell_surface.wl, &shell_surface_listener_wl, data);
}
}
#ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH
if (data->extended_surface) {
qt_extended_surface_set_user_data(data->extended_surface, data);
qt_extended_surface_add_listener(data->extended_surface,
&extended_surface_listener, data);
}
#endif /* SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH */
region = wl_compositor_create_region(c->compositor);
wl_region_add(region, 0, 0, window->w, window->h);
wl_surface_set_opaque_region(data->surface, region);
wl_region_destroy(region);
if (c->relative_mouse_mode) {
Wayland_input_lock_pointer(c->input);
}
wl_surface_commit(data->surface);
WAYLAND_wl_display_flush(c->display);
return 0;
}
void Wayland_SetWindowSize(_THIS, SDL_Window * window)
{
SDL_VideoData *data = _this->driverdata;
SDL_WindowData *wind = window->driverdata;
struct wl_region *region;
WAYLAND_wl_egl_window_resize(wind->egl_window, window->w, window->h, 0, 0);
region =wl_compositor_create_region(data->compositor);
wl_region_add(region, 0, 0, window->w, window->h);
wl_surface_set_opaque_region(wind->surface, region);
wl_region_destroy(region);
}
void Wayland_SetWindowTitle(_THIS, SDL_Window * window)
{
SDL_WindowData *wind = window->driverdata;
SDL_VideoData *viddata = (SDL_VideoData *) _this->driverdata;
if (window->title != NULL) {
if (viddata->shell.zxdg) {
zxdg_toplevel_v6_set_title(wind->shell_surface.zxdg.roleobj.toplevel, window->title);
} else {
wl_shell_surface_set_title(wind->shell_surface.wl, window->title);
}
}
WAYLAND_wl_display_flush( ((SDL_VideoData*)_this->driverdata)->display );
}
void Wayland_DestroyWindow(_THIS, SDL_Window *window)
{
SDL_VideoData *data = _this->driverdata;
SDL_WindowData *wind = window->driverdata;
if (data) {
SDL_EGL_DestroySurface(_this, wind->egl_surface);
WAYLAND_wl_egl_window_destroy(wind->egl_window);
if (data->shell.zxdg) {
if (wind->shell_surface.zxdg.roleobj.toplevel) {
zxdg_toplevel_v6_destroy(wind->shell_surface.zxdg.roleobj.toplevel);
}
if (wind->shell_surface.zxdg.surface) {
zxdg_surface_v6_destroy(wind->shell_surface.zxdg.surface);
}
} else {
if (wind->shell_surface.wl) {
wl_shell_surface_destroy(wind->shell_surface.wl);
}
}
#ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH
if (wind->extended_surface) {
QtExtendedSurface_Unsubscribe(wind->extended_surface, SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION);
QtExtendedSurface_Unsubscribe(wind->extended_surface, SDL_HINT_QTWAYLAND_WINDOW_FLAGS);
qt_extended_surface_destroy(wind->extended_surface);
}
#endif /* SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH */
wl_surface_destroy(wind->surface);
SDL_free(wind);
WAYLAND_wl_display_flush(data->display);
}
window->driverdata = NULL;
}
#endif /* SDL_VIDEO_DRIVER_WAYLAND && SDL_VIDEO_OPENGL_EGL */
/* vi: set ts=4 sw=4 expandtab: */
SDL_HINT_QTWAYLAND_WINDOW_FLAGS
#define SDL_HINT_QTWAYLAND_WINDOW_FLAGS
Flags to set on QtWayland windows to integrate with the native window manager.
Definition: SDL_hints.h:521
WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT
Definition: wayland-client-protocol.h:2853
Wayland_SetWindowSize
void Wayland_SetWindowSize(_THIS, SDL_Window *window)
SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION
#define SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION
A variable describing the content orientation on QtWayland-based platforms.
Definition: SDL_hints.h:510
SDL_zxdg_shell_surface::toplevel
struct zxdg_toplevel_v6 * toplevel
Definition: SDL_waylandwindow.h:37
wl_surface_set_user_data
static void wl_surface_set_user_data(struct wl_surface *wl_surface, void *user_data)
Definition: wayland-client-protocol.h:3368
SDL_min
#define SDL_min(x, y)
Definition: SDL_stdinc.h:406
Wayland_SetWindowFullscreen
void Wayland_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *_display, SDL_bool fullscreen)
SDL_TRUE
Definition: SDL_stdinc.h:142
SDL_Window::fullscreen_mode
SDL_DisplayMode fullscreen_mode
Definition: SDL_sysvideo.h:89
wl_surface_commit
static void wl_surface_commit(struct wl_surface *wl_surface)
Definition: wayland-client-protocol.h:3619
SDL_zxdg_shell_surface::surface
struct zxdg_surface_v6 * surface
Definition: SDL_waylandwindow.h:35
wl_compositor_create_region
static struct wl_region * wl_compositor_create_region(struct wl_compositor *wl_compositor)
Definition: wayland-client-protocol.h:1207
SDL_Window::w
int w
Definition: SDL_sysvideo.h:80
EGL_NO_SURFACE
#define EGL_NO_SURFACE
Definition: egl.h:100
int32_t
signed int int32_t
Definition: SDL_config_windows.h:62
SDL_WindowData::wl
struct wl_shell_surface * wl
Definition: SDL_waylandwindow.h:49
wl_shell_surface_destroy
static void wl_shell_surface_destroy(struct wl_shell_surface *wl_shell_surface)
Definition: wayland-client-protocol.h:3022
Wayland_SetWindowHitTest
int Wayland_SetWindowHitTest(SDL_Window *window, SDL_bool enabled)
SDL_Window::x
int x
Definition: SDL_sysvideo.h:79
wl_shell_surface_set_user_data
static void wl_shell_surface_set_user_data(struct wl_shell_surface *wl_shell_surface, void *user_data)
Definition: wayland-client-protocol.h:3002
SDL_VideoData::display
struct wl_display * display
Definition: SDL_waylandvideo.h:40
Wayland_MaximizeWindow
void Wayland_MaximizeWindow(_THIS, SDL_Window *window)
zxdg_toplevel_v6_set_maximized
static void zxdg_toplevel_v6_set_maximized(struct zxdg_toplevel_v6 *zxdg_toplevel_v6)
Definition: xdg-shell-unstable-v6-client-protocol.h:1494
SDL_FALSE
Definition: SDL_stdinc.h:141
wl_shell_surface_set_toplevel
static void wl_shell_surface_set_toplevel(struct wl_shell_surface *wl_shell_surface)
Definition: wayland-client-protocol.h:3080
SDL_SYSWM_UNKNOWN
Definition: SDL_syswm.h:118
zxdg_toplevel_v6_destroy
static void zxdg_toplevel_v6_destroy(struct zxdg_toplevel_v6 *zxdg_toplevel_v6)
Definition: xdg-shell-unstable-v6-client-protocol.h:1218
SDL_waylandtouch.h
free
SDL_EventEntry * free
Definition: SDL_events.c:84
surface
EGLSurface surface
Definition: eglext.h:248
SDL_waylandwindow.h
zxdg_toplevel_v6_add_listener
static int zxdg_toplevel_v6_add_listener(struct zxdg_toplevel_v6 *zxdg_toplevel_v6, const struct zxdg_toplevel_v6_listener *listener, void *data)
Definition: xdg-shell-unstable-v6-client-protocol.h:1102
SDL_VideoDevice::driverdata
void * driverdata
Definition: SDL_sysvideo.h:377
SDL_SysWMinfo::version
SDL_version version
Definition: SDL_syswm.h:196
SDL_version::major
Uint8 major
Definition: SDL_version.h:53
Wayland_ShowWindow
void Wayland_ShowWindow(_THIS, SDL_Window *window)
data
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: SDL_opengl.h:1974
wl_shell_surface_set_fullscreen
static void wl_shell_surface_set_fullscreen(struct wl_shell_surface *wl_shell_surface, uint32_t method, uint32_t framerate, struct wl_output *output)
Definition: wayland-client-protocol.h:3142
SDL_SysWMinfo::subsystem
SDL_SYSWM_TYPE subsystem
Definition: SDL_syswm.h:197
wl_shell_surface_set_maximized
static void wl_shell_surface_set_maximized(struct wl_shell_surface *wl_shell_surface, struct wl_output *output)
Definition: wayland-client-protocol.h:3201
Wayland_input_lock_pointer
int Wayland_input_lock_pointer(struct SDL_WaylandInput *input)
SDL_WINDOWPOS_UNDEFINED
#define SDL_WINDOWPOS_UNDEFINED
Definition: SDL_video.h:130
SDL_SendWindowEvent
int SDL_SendWindowEvent(SDL_Window *window, Uint8 windowevent, int data1, int data2)
Definition: SDL_windowevents.c:88
wl_region_add
static void wl_region_add(struct wl_region *wl_region, int32_t x, int32_t y, int32_t width, int32_t height)
Definition: wayland-client-protocol.h:5283
Uint32
uint32_t Uint32
Definition: SDL_stdinc.h:181
SDL_GL_LoadLibrary
#define SDL_GL_LoadLibrary
Definition: SDL_dynapi_overrides.h:553
wl_surface_destroy
static void wl_surface_destroy(struct wl_surface *wl_surface)
Definition: wayland-client-protocol.h:3392
SDL_VideoData::input
struct SDL_WaylandInput * input
Definition: SDL_waylandvideo.h:60
Wayland_CreateWindow
int Wayland_CreateWindow(_THIS, SDL_Window *window)
wl_shell_surface_pong
static void wl_shell_surface_pong(struct wl_shell_surface *wl_shell_surface, uint32_t serial)
Definition: wayland-client-protocol.h:3034
SDL_max
#define SDL_max(x, y)
Definition: SDL_stdinc.h:407
SDL_WindowData::surface
SDL_Surface * surface
Definition: SDL_emscriptenvideo.h:41
name
GLuint const GLchar * name
Definition: SDL_opengl_glext.h:660
width
GLint GLint GLsizei width
Definition: SDL_opengl.h:1572
zxdg_surface_v6_ack_configure
static void zxdg_surface_v6_ack_configure(struct zxdg_surface_v6 *zxdg_surface_v6, uint32_t serial)
Definition: xdg-shell-unstable-v6-client-protocol.h:989
SDL_VideoData::classname
char * classname
Definition: SDL_waylandvideo.h:68
SDL_WindowData
Definition: SDL_androidwindow.h:35
zxdg_surface_v6_destroy
static void zxdg_surface_v6_destroy(struct zxdg_surface_v6 *zxdg_surface_v6)
Definition: xdg-shell-unstable-v6-client-protocol.h:882
_this
static SDL_VideoDevice * _this
Definition: SDL_video.c:121
NativeWindowType
EGLNativeWindowType NativeWindowType
Definition: eglplatform.h:112
SDL_VideoData::shell
struct SDL_VideoData::@36 shell
SDL_VideoData::relative_mouse_mode
int relative_mouse_mode
Definition: SDL_waylandvideo.h:70
Wayland_SetWindowTitle
void Wayland_SetWindowTitle(_THIS, SDL_Window *window)
Wayland_DestroyWindow
void Wayland_DestroyWindow(_THIS, SDL_Window *window)
SDL_SysWMinfo
Definition: SDL_syswm.h:194
zxdg_toplevel_v6_set_title
static void zxdg_toplevel_v6_set_title(struct zxdg_toplevel_v6 *zxdg_toplevel_v6, const char *title)
Definition: xdg-shell-unstable-v6-client-protocol.h:1256
_THIS
#define _THIS
Definition: SDL_alsa_audio.h:31
SDL_free
#define SDL_free
Definition: SDL_dynapi_overrides.h:377
SDL_DisplayMode::driverdata
void * driverdata
Definition: SDL_video.h:59
SDL_WindowData::sdlwindow
SDL_Window * sdlwindow
Definition: SDL_waylandwindow.h:43
zxdg_toplevel_v6_listener
Definition: xdg-shell-unstable-v6-client-protocol.h:1051
sort_controllers.output
output
Definition: sort_controllers.py:10
SDL_Window::min_w
int min_w
Definition: SDL_sysvideo.h:81
wl_region_destroy
static void wl_region_destroy(struct wl_region *wl_region)
Definition: wayland-client-protocol.h:5269
Wayland_GetWindowWMInfo
SDL_bool Wayland_GetWindowWMInfo(_THIS, SDL_Window *window, SDL_SysWMinfo *info)
SDL_WindowData::waylandData
SDL_VideoData * waylandData
Definition: SDL_waylandwindow.h:44
c
const GLubyte * c
Definition: SDL_opengl_glext.h:11093
SDL_hints.h
value
GLsizei const GLfloat * value
Definition: SDL_opengl_glext.h:698
SDL_version::minor
Uint8 minor
Definition: SDL_version.h:54
SDL_VideoData::wl
struct wl_shell * wl
Definition: SDL_waylandvideo.h:49
SDL_Window::title
char * title
Definition: SDL_sysvideo.h:77
SDL_Window::y
int y
Definition: SDL_sysvideo.h:79
SDL_waylanddyn.h
wl_shell_surface_set_title
static void wl_shell_surface_set_title(struct wl_shell_surface *wl_shell_surface, const char *title)
Definition: wayland-client-protocol.h:3219
zxdg_surface_v6_add_listener
static int zxdg_surface_v6_add_listener(struct zxdg_surface_v6 *zxdg_surface_v6, const struct zxdg_surface_v6_listener *listener, void *data)
Definition: xdg-shell-unstable-v6-client-protocol.h:816
wl_shell_get_shell_surface
static struct wl_shell_surface * wl_shell_get_shell_surface(struct wl_shell *wl_shell, struct wl_surface *surface)
Definition: wayland-client-protocol.h:2761
SDL_WINDOWEVENT_CLOSE
Definition: SDL_video.h:167
enabled
GLenum GLenum GLsizei const GLuint GLboolean enabled
Definition: SDL_opengl_glext.h:2479
SDL_VideoDisplay
Definition: SDL_sysvideo.h:125
SDL_Window::h
int h
Definition: SDL_sysvideo.h:80
SDL_WindowData::shell_surface
union SDL_WindowData::@38 shell_surface
SDL_SYSWM_WAYLAND
Definition: SDL_syswm.h:124
SDL_waylandvideo.h
NULL
#define NULL
Definition: begin_code.h:164
SDL_OutOfMemory
#define SDL_OutOfMemory()
Definition: SDL_error.h:52
wl_surface_set_opaque_region
static void wl_surface_set_opaque_region(struct wl_surface *wl_surface, struct wl_region *region)
Definition: wayland-client-protocol.h:3558
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:139
uint32_t
unsigned int uint32_t
Definition: SDL_config_windows.h:63
SDL_WINDOW_RESIZABLE
Definition: SDL_video.h:105
SDL_Window::min_h
int min_h
Definition: SDL_sysvideo.h:81
SDL_SetError
#define SDL_SetError
Definition: SDL_dynapi_overrides.h:30
flags
GLbitfield flags
Definition: SDL_opengl_glext.h:1480
SDL_VideoData::compositor
struct wl_compositor * compositor
Definition: SDL_waylandvideo.h:42
height
GLint GLint GLsizei GLsizei height
Definition: SDL_opengl.h:1572
Wayland_RestoreWindow
void Wayland_RestoreWindow(_THIS, SDL_Window *window)
wl_shell_surface_listener
Definition: wayland-client-protocol.h:2873
SDL_WindowData::zxdg
SDL_zxdg_shell_surface zxdg
Definition: SDL_waylandwindow.h:48
wl_compositor_create_surface
static struct wl_surface * wl_compositor_create_surface(struct wl_compositor *wl_compositor)
Definition: wayland-client-protocol.h:1191
SDL_Window::max_w
int max_w
Definition: SDL_sysvideo.h:82
window
EGLSurface EGLNativeWindowType * window
Definition: eglext.h:1025
xdg-shell-unstable-v6-client-protocol.h
SDL_Window
The type used to identify a window.
Definition: SDL_sysvideo.h:73
SDL_AddHintCallback
#define SDL_AddHintCallback
Definition: SDL_dynapi_overrides.h:192
SDL_zxdg_shell_surface::roleobj
union SDL_zxdg_shell_surface::@37 roleobj
SDL_WINDOW_FULLSCREEN
Definition: SDL_video.h:100
SDL_DelHintCallback
#define SDL_DelHintCallback
Definition: SDL_dynapi_overrides.h:193
zxdg_toplevel_v6_set_app_id
static void zxdg_toplevel_v6_set_app_id(struct zxdg_toplevel_v6 *zxdg_toplevel_v6, const char *app_id)
Definition: xdg-shell-unstable-v6-client-protocol.h:1287
SDL_VideoData
Definition: SDL_androidvideo.h:35
SDL_waylandevents_c.h
wl_shell_surface_set_class
static void wl_shell_surface_set_class(struct wl_shell_surface *wl_shell_surface, const char *class_)
Definition: wayland-client-protocol.h:3236
zxdg_toplevel_v6_unset_fullscreen
static void zxdg_toplevel_v6_unset_fullscreen(struct zxdg_toplevel_v6 *zxdg_toplevel_v6)
Definition: xdg-shell-unstable-v6-client-protocol.h:1552
SDL_Window::max_h
int max_h
Definition: SDL_sysvideo.h:82
SDL_SysWMinfo::info
union SDL_SysWMinfo::@18 info
zxdg_shell_v6_get_xdg_surface
static struct zxdg_surface_v6 * zxdg_shell_v6_get_xdg_surface(struct zxdg_shell_v6 *zxdg_shell_v6, struct wl_surface *surface)
Definition: xdg-shell-unstable-v6-client-protocol.h:469
SDL_VideoData::zxdg
struct zxdg_shell_v6 * zxdg
Definition: SDL_waylandvideo.h:48
SDL_WINDOW_OPENGL
Definition: SDL_video.h:101
SDL_WINDOWEVENT_RESIZED
Definition: SDL_video.h:155
SDL_SysWMinfo::wl
struct SDL_SysWMinfo::@18::@20 wl
zxdg_surface_v6_set_user_data
static void zxdg_surface_v6_set_user_data(struct zxdg_surface_v6 *zxdg_surface_v6, void *user_data)
Definition: xdg-shell-unstable-v6-client-protocol.h:857
SDL_Window::driverdata
void * driverdata
Definition: SDL_sysvideo.h:111
zxdg_surface_v6_get_toplevel
static struct zxdg_toplevel_v6 * zxdg_surface_v6_get_toplevel(struct zxdg_surface_v6 *zxdg_surface_v6)
Definition: xdg-shell-unstable-v6-client-protocol.h:900
SDL_Window::flags
Uint32 flags
Definition: SDL_sysvideo.h:83
zxdg_surface_v6_listener
Definition: xdg-shell-unstable-v6-client-protocol.h:782
zxdg_toplevel_v6_set_fullscreen
static void zxdg_toplevel_v6_set_fullscreen(struct zxdg_toplevel_v6 *zxdg_toplevel_v6, struct wl_output *output)
Definition: xdg-shell-unstable-v6-client-protocol.h:1542
wl_shell_surface_add_listener
static int wl_shell_surface_add_listener(struct wl_shell_surface *wl_shell_surface, const struct wl_shell_surface_listener *listener, void *data)
Definition: wayland-client-protocol.h:2928
SDLCALL
#define SDLCALL
Definition: SDL_internal.h:45
SDL_WindowData::egl_surface
EGLSurface egl_surface
Definition: SDL_androidwindow.h:37
SDL_VideoDisplay::driverdata
void * driverdata
Definition: SDL_sysvideo.h:138
SDL_version::patch
Uint8 patch
Definition: SDL_version.h:55
SDL_WindowData::egl_window
struct wl_egl_window * egl_window
Definition: SDL_waylandwindow.h:51