SDL_x11video.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_X11
#include <unistd.h> /* For getpid() and readlink() */
#include "SDL_video.h"
#include "SDL_mouse.h"
#include "SDL_timer.h"
#include "../SDL_sysvideo.h"
#include "../SDL_pixels_c.h"
#include "SDL_x11video.h"
#include "SDL_x11framebuffer.h"
#include "SDL_x11shape.h"
#include "SDL_x11touch.h"
#include "SDL_x11xinput2.h"
#if SDL_VIDEO_OPENGL_EGL
#include "SDL_x11opengles.h"
#endif
#include "SDL_x11vulkan.h"
/* Initialization/Query functions */
static int X11_VideoInit(_THIS);
static void X11_VideoQuit(_THIS);
/* Find out what class name we should use */
static char *
get_classname()
{
char *spot;
#if defined(__LINUX__) || defined(__FREEBSD__)
char procfile[1024];
char linkfile[1024];
int linksize;
#endif
/* First allow environment variable override */
spot = SDL_getenv("SDL_VIDEO_X11_WMCLASS");
if (spot) {
return SDL_strdup(spot);
}
/* Next look at the application's executable name */
#if defined(__LINUX__) || defined(__FREEBSD__)
#if defined(__LINUX__)
SDL_snprintf(procfile, SDL_arraysize(procfile), "/proc/%d/exe", getpid());
#elif defined(__FREEBSD__)
SDL_snprintf(procfile, SDL_arraysize(procfile), "/proc/%d/file",
getpid());
#else
#error Where can we find the executable name?
#endif
linksize = readlink(procfile, linkfile, sizeof(linkfile) - 1);
if (linksize > 0) {
linkfile[linksize] = '\0';
spot = SDL_strrchr(linkfile, '/');
if (spot) {
return SDL_strdup(spot + 1);
} else {
return SDL_strdup(linkfile);
}
}
#endif /* __LINUX__ || __FREEBSD__ */
/* Finally use the default we've used forever */
return SDL_strdup("SDL_App");
}
/* X11 driver bootstrap functions */
static int
X11_Available(void)
{
Display *display = NULL;
if (SDL_X11_LoadSymbols()) {
display = X11_XOpenDisplay(NULL);
if (display != NULL) {
X11_XCloseDisplay(display);
}
SDL_X11_UnloadSymbols();
}
return (display != NULL);
}
static void
X11_DeleteDevice(SDL_VideoDevice * device)
{
SDL_VideoData *data = (SDL_VideoData *) device->driverdata;
if (device->vulkan_config.loader_handle) {
device->Vulkan_UnloadLibrary(device);
}
if (data->display) {
X11_XCloseDisplay(data->display);
}
SDL_free(data->windowlist);
SDL_free(device->driverdata);
SDL_free(device);
SDL_X11_UnloadSymbols();
}
/* An error handler to reset the vidmode and then call the default handler. */
static SDL_bool safety_net_triggered = SDL_FALSE;
static int (*orig_x11_errhandler) (Display *, XErrorEvent *) = NULL;
static int
X11_SafetyNetErrHandler(Display * d, XErrorEvent * e)
{
SDL_VideoDevice *device = NULL;
/* if we trigger an error in our error handler, don't try again. */
if (!safety_net_triggered) {
safety_net_triggered = SDL_TRUE;
device = SDL_GetVideoDevice();
if (device != NULL) {
int i;
for (i = 0; i < device->num_displays; i++) {
SDL_VideoDisplay *display = &device->displays[i];
if (SDL_memcmp(&display->current_mode, &display->desktop_mode,
sizeof (SDL_DisplayMode)) != 0) {
X11_SetDisplayMode(device, display, &display->desktop_mode);
}
}
}
}
if (orig_x11_errhandler != NULL) {
return orig_x11_errhandler(d, e); /* probably terminate. */
}
return 0;
}
static SDL_VideoDevice *
X11_CreateDevice(int devindex)
{
SDL_VideoDevice *device;
SDL_VideoData *data;
const char *display = NULL; /* Use the DISPLAY environment variable */
if (!SDL_X11_LoadSymbols()) {
return NULL;
}
/* Need for threading gl calls. This is also required for the proprietary
nVidia driver to be threaded. */
X11_XInitThreads();
/* Initialize all variables that we clean on shutdown */
device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
if (!device) {
SDL_OutOfMemory();
return NULL;
}
data = (struct SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData));
if (!data) {
SDL_free(device);
SDL_OutOfMemory();
return NULL;
}
device->driverdata = data;
data->global_mouse_changed = SDL_TRUE;
/* FIXME: Do we need this?
if ( (SDL_strncmp(X11_XDisplayName(display), ":", 1) == 0) ||
(SDL_strncmp(X11_XDisplayName(display), "unix:", 5) == 0) ) {
local_X11 = 1;
} else {
local_X11 = 0;
}
*/
data->display = X11_XOpenDisplay(display);
#ifdef SDL_VIDEO_DRIVER_X11_DYNAMIC
/* On some systems if linking without -lX11, it fails and you get following message.
* Xlib: connection to ":0.0" refused by server
* Xlib: XDM authorization key matches an existing client!
*
* It succeeds if retrying 1 second later
* or if running xhost +localhost on shell.
*/
if (data->display == NULL) {
SDL_Delay(1000);
data->display = X11_XOpenDisplay(display);
}
#endif
if (data->display == NULL) {
SDL_free(device->driverdata);
SDL_free(device);
SDL_SetError("Couldn't open X11 display");
return NULL;
}
#ifdef X11_DEBUG
X11_XSynchronize(data->display, True);
#endif
/* Hook up an X11 error handler to recover the desktop resolution. */
safety_net_triggered = SDL_FALSE;
orig_x11_errhandler = X11_XSetErrorHandler(X11_SafetyNetErrHandler);
/* Set the function pointers */
device->VideoInit = X11_VideoInit;
device->VideoQuit = X11_VideoQuit;
device->ResetTouch = X11_ResetTouch;
device->GetDisplayModes = X11_GetDisplayModes;
device->GetDisplayBounds = X11_GetDisplayBounds;
device->GetDisplayUsableBounds = X11_GetDisplayUsableBounds;
device->GetDisplayDPI = X11_GetDisplayDPI;
device->SetDisplayMode = X11_SetDisplayMode;
device->SuspendScreenSaver = X11_SuspendScreenSaver;
device->PumpEvents = X11_PumpEvents;
device->CreateSDLWindow = X11_CreateWindow;
device->CreateSDLWindowFrom = X11_CreateWindowFrom;
device->SetWindowTitle = X11_SetWindowTitle;
device->SetWindowIcon = X11_SetWindowIcon;
device->SetWindowPosition = X11_SetWindowPosition;
device->SetWindowSize = X11_SetWindowSize;
device->SetWindowMinimumSize = X11_SetWindowMinimumSize;
device->SetWindowMaximumSize = X11_SetWindowMaximumSize;
device->GetWindowBordersSize = X11_GetWindowBordersSize;
device->SetWindowOpacity = X11_SetWindowOpacity;
device->SetWindowModalFor = X11_SetWindowModalFor;
device->SetWindowInputFocus = X11_SetWindowInputFocus;
device->ShowWindow = X11_ShowWindow;
device->HideWindow = X11_HideWindow;
device->RaiseWindow = X11_RaiseWindow;
device->MaximizeWindow = X11_MaximizeWindow;
device->MinimizeWindow = X11_MinimizeWindow;
device->RestoreWindow = X11_RestoreWindow;
device->SetWindowBordered = X11_SetWindowBordered;
device->SetWindowResizable = X11_SetWindowResizable;
device->SetWindowFullscreen = X11_SetWindowFullscreen;
device->SetWindowGammaRamp = X11_SetWindowGammaRamp;
device->SetWindowGrab = X11_SetWindowGrab;
device->DestroyWindow = X11_DestroyWindow;
device->CreateWindowFramebuffer = X11_CreateWindowFramebuffer;
device->UpdateWindowFramebuffer = X11_UpdateWindowFramebuffer;
device->DestroyWindowFramebuffer = X11_DestroyWindowFramebuffer;
device->GetWindowWMInfo = X11_GetWindowWMInfo;
device->SetWindowHitTest = X11_SetWindowHitTest;
device->shape_driver.CreateShaper = X11_CreateShaper;
device->shape_driver.SetWindowShape = X11_SetWindowShape;
device->shape_driver.ResizeWindowShape = X11_ResizeWindowShape;
#if SDL_VIDEO_OPENGL_GLX
device->GL_LoadLibrary = X11_GL_LoadLibrary;
device->GL_GetProcAddress = X11_GL_GetProcAddress;
device->GL_UnloadLibrary = X11_GL_UnloadLibrary;
device->GL_CreateContext = X11_GL_CreateContext;
device->GL_MakeCurrent = X11_GL_MakeCurrent;
device->GL_SetSwapInterval = X11_GL_SetSwapInterval;
device->GL_GetSwapInterval = X11_GL_GetSwapInterval;
device->GL_SwapWindow = X11_GL_SwapWindow;
device->GL_DeleteContext = X11_GL_DeleteContext;
#elif SDL_VIDEO_OPENGL_EGL
device->GL_LoadLibrary = X11_GLES_LoadLibrary;
device->GL_GetProcAddress = X11_GLES_GetProcAddress;
device->GL_UnloadLibrary = X11_GLES_UnloadLibrary;
device->GL_CreateContext = X11_GLES_CreateContext;
device->GL_MakeCurrent = X11_GLES_MakeCurrent;
device->GL_SetSwapInterval = X11_GLES_SetSwapInterval;
device->GL_GetSwapInterval = X11_GLES_GetSwapInterval;
device->GL_SwapWindow = X11_GLES_SwapWindow;
device->GL_DeleteContext = X11_GLES_DeleteContext;
#endif
device->SetClipboardText = X11_SetClipboardText;
device->GetClipboardText = X11_GetClipboardText;
device->HasClipboardText = X11_HasClipboardText;
device->StartTextInput = X11_StartTextInput;
device->StopTextInput = X11_StopTextInput;
device->SetTextInputRect = X11_SetTextInputRect;
device->free = X11_DeleteDevice;
#if SDL_VIDEO_VULKAN
device->Vulkan_LoadLibrary = X11_Vulkan_LoadLibrary;
device->Vulkan_UnloadLibrary = X11_Vulkan_UnloadLibrary;
device->Vulkan_GetInstanceExtensions = X11_Vulkan_GetInstanceExtensions;
device->Vulkan_CreateSurface = X11_Vulkan_CreateSurface;
#endif
return device;
}
VideoBootStrap X11_bootstrap = {
"x11", "SDL X11 video driver",
X11_Available, X11_CreateDevice
};
static int (*handler) (Display *, XErrorEvent *) = NULL;
static int
X11_CheckWindowManagerErrorHandler(Display * d, XErrorEvent * e)
{
if (e->error_code == BadWindow) {
return (0);
} else {
return (handler(d, e));
}
}
static void
X11_CheckWindowManager(_THIS)
{
SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
Display *display = data->display;
Atom _NET_SUPPORTING_WM_CHECK;
int status, real_format;
Atom real_type;
unsigned long items_read = 0, items_left = 0;
unsigned char *propdata = NULL;
Window wm_window = 0;
#ifdef DEBUG_WINDOW_MANAGER
char *wm_name;
#endif
/* Set up a handler to gracefully catch errors */
X11_XSync(display, False);
handler = X11_XSetErrorHandler(X11_CheckWindowManagerErrorHandler);
_NET_SUPPORTING_WM_CHECK = X11_XInternAtom(display, "_NET_SUPPORTING_WM_CHECK", False);
status = X11_XGetWindowProperty(display, DefaultRootWindow(display), _NET_SUPPORTING_WM_CHECK, 0L, 1L, False, XA_WINDOW, &real_type, &real_format, &items_read, &items_left, &propdata);
if (status == Success) {
if (items_read) {
wm_window = ((Window*)propdata)[0];
}
if (propdata) {
X11_XFree(propdata);
propdata = NULL;
}
}
if (wm_window) {
status = X11_XGetWindowProperty(display, wm_window, _NET_SUPPORTING_WM_CHECK, 0L, 1L, False, XA_WINDOW, &real_type, &real_format, &items_read, &items_left, &propdata);
if (status != Success || !items_read || wm_window != ((Window*)propdata)[0]) {
wm_window = None;
}
if (status == Success && propdata) {
X11_XFree(propdata);
propdata = NULL;
}
}
/* Reset the error handler, we're done checking */
X11_XSync(display, False);
X11_XSetErrorHandler(handler);
if (!wm_window) {
#ifdef DEBUG_WINDOW_MANAGER
printf("Couldn't get _NET_SUPPORTING_WM_CHECK property\n");
#endif
return;
}
data->net_wm = SDL_TRUE;
#ifdef DEBUG_WINDOW_MANAGER
wm_name = X11_GetWindowTitle(_this, wm_window);
printf("Window manager: %s\n", wm_name);
SDL_free(wm_name);
#endif
}
int
X11_VideoInit(_THIS)
{
SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
/* Get the window class name, usually the name of the application */
data->classname = get_classname();
/* Get the process PID to be associated to the window */
data->pid = getpid();
/* I have no idea how random this actually is, or has to be. */
data->window_group = (XID) (((size_t) data->pid) ^ ((size_t) _this));
/* Look up some useful Atoms */
#define GET_ATOM(X) data->X = X11_XInternAtom(data->display, #X, False)
GET_ATOM(WM_PROTOCOLS);
GET_ATOM(WM_DELETE_WINDOW);
GET_ATOM(WM_TAKE_FOCUS);
GET_ATOM(_NET_WM_STATE);
GET_ATOM(_NET_WM_STATE_HIDDEN);
GET_ATOM(_NET_WM_STATE_FOCUSED);
GET_ATOM(_NET_WM_STATE_MAXIMIZED_VERT);
GET_ATOM(_NET_WM_STATE_MAXIMIZED_HORZ);
GET_ATOM(_NET_WM_STATE_FULLSCREEN);
GET_ATOM(_NET_WM_STATE_ABOVE);
GET_ATOM(_NET_WM_STATE_SKIP_TASKBAR);
GET_ATOM(_NET_WM_STATE_SKIP_PAGER);
GET_ATOM(_NET_WM_ALLOWED_ACTIONS);
GET_ATOM(_NET_WM_ACTION_FULLSCREEN);
GET_ATOM(_NET_WM_NAME);
GET_ATOM(_NET_WM_ICON_NAME);
GET_ATOM(_NET_WM_ICON);
GET_ATOM(_NET_WM_PING);
GET_ATOM(_NET_WM_WINDOW_OPACITY);
GET_ATOM(_NET_WM_USER_TIME);
GET_ATOM(_NET_ACTIVE_WINDOW);
GET_ATOM(_NET_FRAME_EXTENTS);
GET_ATOM(UTF8_STRING);
GET_ATOM(PRIMARY);
GET_ATOM(XdndEnter);
GET_ATOM(XdndPosition);
GET_ATOM(XdndStatus);
GET_ATOM(XdndTypeList);
GET_ATOM(XdndActionCopy);
GET_ATOM(XdndDrop);
GET_ATOM(XdndFinished);
GET_ATOM(XdndSelection);
GET_ATOM(XKLAVIER_STATE);
/* Detect the window manager */
X11_CheckWindowManager(_this);
if (X11_InitModes(_this) < 0) {
return -1;
}
X11_InitXinput2(_this);
if (X11_InitKeyboard(_this) != 0) {
return -1;
}
X11_InitMouse(_this);
X11_InitTouch(_this);
#if SDL_USE_LIBDBUS
SDL_DBus_Init();
#endif
return 0;
}
void
X11_VideoQuit(_THIS)
{
SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
if (data->clipboard_window) {
X11_XDestroyWindow(data->display, data->clipboard_window);
}
SDL_free(data->classname);
#ifdef X_HAVE_UTF8_STRING
if (data->im) {
X11_XCloseIM(data->im);
}
#endif
X11_QuitModes(_this);
X11_QuitKeyboard(_this);
X11_QuitMouse(_this);
X11_QuitTouch(_this);
/* !!! FIXME: other subsystems use D-Bus, so we shouldn't quit it here;
have SDL.c do this at a higher level, or add refcounting. */
#if SDL_USE_LIBDBUS
SDL_DBus_Quit();
#endif
}
SDL_bool
X11_UseDirectColorVisuals(void)
{
return SDL_getenv("SDL_VIDEO_X11_NODIRECTCOLOR") ? SDL_FALSE : SDL_TRUE;
}
#endif /* SDL_VIDEO_DRIVER_X11 */
/* vim: set ts=4 sw=4 expandtab: */
SDL_VideoDevice::Vulkan_LoadLibrary
int(* Vulkan_LoadLibrary)(_THIS, const char *path)
Definition: SDL_sysvideo.h:270
X11_PumpEvents
void X11_PumpEvents(_THIS)
SDL_VideoDevice::GetDisplayDPI
int(* GetDisplayDPI)(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi)
Definition: SDL_sysvideo.h:186
SDL_VideoDevice::vulkan_config
struct SDL_VideoDevice::@35 vulkan_config
X11_SetWindowHitTest
int X11_SetWindowHitTest(SDL_Window *window, SDL_bool enabled)
SDL_VideoData::_NET_WM_STATE_FULLSCREEN
Atom _NET_WM_STATE_FULLSCREEN
Definition: SDL_x11video.h:100
X11_ResizeWindowShape
int X11_ResizeWindowShape(SDL_Window *window)
SDL_VideoData::XdndEnter
Atom XdndEnter
Definition: SDL_x11video.h:116
SDL_VideoData::pid
pid_t pid
Definition: SDL_x11video.h:79
SDL_VideoData::_NET_WM_ALLOWED_ACTIONS
Atom _NET_WM_ALLOWED_ACTIONS
Definition: SDL_x11video.h:104
X11_bootstrap
VideoBootStrap X11_bootstrap
SDL_VideoDevice::RestoreWindow
void(* RestoreWindow)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:227
X11_SetWindowTitle
void X11_SetWindowTitle(_THIS, SDL_Window *window)
X11_CreateWindowFramebuffer
int X11_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch)
SDL_TRUE
Definition: SDL_stdinc.h:142
SDL_VideoDevice::SetWindowHitTest
int(* SetWindowHitTest)(SDL_Window *window, SDL_bool enabled)
Definition: SDL_sysvideo.h:305
e
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const char return SDL_ThreadFunction const char void return Uint32 return Uint32 SDL_AssertionHandler void SDL_SpinLock SDL_atomic_t int int return SDL_atomic_t return void void void return void return int return SDL_AudioSpec SDL_AudioSpec return int int return return int SDL_RWops int SDL_AudioSpec Uint8 Uint32 * e
Definition: SDL_dynapi_procs.h:117
X11_SetDisplayMode
int X11_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode)
X11_InitXinput2
void X11_InitXinput2(_THIS)
SDL_VideoData::_NET_WM_STATE_MAXIMIZED_VERT
Atom _NET_WM_STATE_MAXIMIZED_VERT
Definition: SDL_x11video.h:98
X11_GetClipboardText
char * X11_GetClipboardText(_THIS)
X11_QuitKeyboard
void X11_QuitKeyboard(_THIS)
X11_SetTextInputRect
void X11_SetTextInputRect(_THIS, SDL_Rect *rect)
SDL_VideoData::display
struct wl_display * display
Definition: SDL_waylandvideo.h:40
SDL_VideoDevice::free
void(* free)(_THIS)
Definition: SDL_sysvideo.h:390
SDL_FALSE
Definition: SDL_stdinc.h:141
X11_SetWindowShape
int X11_SetWindowShape(SDL_WindowShaper *shaper, SDL_Surface *shape, SDL_WindowShapeMode *shapeMode)
X11_UseDirectColorVisuals
SDL_bool X11_UseDirectColorVisuals(void)
SDL_VideoDevice::driverdata
void * driverdata
Definition: SDL_sysvideo.h:377
SDL_VideoDevice::GL_SetSwapInterval
int(* GL_SetSwapInterval)(_THIS, int interval)
Definition: SDL_sysvideo.h:260
SDL_VideoDevice::ShowWindow
void(* ShowWindow)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:222
SDL_DisplayMode
The structure that defines a display mode.
Definition: SDL_video.h:53
SDL_VideoData::WM_PROTOCOLS
Atom WM_PROTOCOLS
Definition: SDL_x11video.h:92
X11_ResetTouch
void X11_ResetTouch(_THIS)
SDL_VideoData::windowlist
SDL_WindowData ** windowlist
Definition: SDL_x11video.h:83
X11_StartTextInput
void X11_StartTextInput(_THIS)
SDL_VideoDevice::StartTextInput
void(* StartTextInput)(_THIS)
Definition: SDL_sysvideo.h:286
SDL_x11opengles.h
SDL_VideoDevice::SetWindowSize
void(* SetWindowSize)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:215
X11_UpdateWindowFramebuffer
int X11_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects)
data
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: SDL_opengl.h:1974
SDL_VideoDevice::GetWindowBordersSize
int(* GetWindowBordersSize)(_THIS, SDL_Window *window, int *top, int *left, int *bottom, int *right)
Definition: SDL_sysvideo.h:218
X11_SetWindowFullscreen
void X11_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen)
SDL_VideoData::_NET_FRAME_EXTENTS
Atom _NET_FRAME_EXTENTS
Definition: SDL_x11video.h:113
X11_MinimizeWindow
void X11_MinimizeWindow(_THIS, SDL_Window *window)
SDL_VideoData::_NET_WM_WINDOW_OPACITY
Atom _NET_WM_WINDOW_OPACITY
Definition: SDL_x11video.h:110
X11_InitMouse
void X11_InitMouse(_THIS)
X11_DestroyWindowFramebuffer
void X11_DestroyWindowFramebuffer(_THIS, SDL_Window *window)
SDL_VideoData::window_group
XID window_group
Definition: SDL_x11video.h:85
SDL_VideoData::XdndPosition
Atom XdndPosition
Definition: SDL_x11video.h:117
SDL_VideoData::_NET_WM_ICON
Atom _NET_WM_ICON
Definition: SDL_x11video.h:108
SDL_VideoData::im
XIM im
Definition: SDL_x11video.h:80
SDL_VideoDevice::GL_LoadLibrary
int(* GL_LoadLibrary)(_THIS, const char *path)
Definition: SDL_sysvideo.h:254
SDL_VideoData::global_mouse_changed
SDL_bool global_mouse_changed
Definition: SDL_x11video.h:133
X11_SetWindowOpacity
int X11_SetWindowOpacity(_THIS, SDL_Window *window, float opacity)
X11_MaximizeWindow
void X11_MaximizeWindow(_THIS, SDL_Window *window)
SDL_VideoData::classname
char * classname
Definition: SDL_waylandvideo.h:68
SDL_VideoDevice::SetDisplayMode
int(* SetDisplayMode)(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode)
Definition: SDL_sysvideo.h:204
SDL_VideoDevice::SetWindowBordered
void(* SetWindowBordered)(_THIS, SDL_Window *window, SDL_bool bordered)
Definition: SDL_sysvideo.h:228
X11_GetDisplayBounds
int X11_GetDisplayBounds(_THIS, SDL_VideoDisplay *sdl_display, SDL_Rect *rect)
SDL_VideoData::_NET_WM_STATE
Atom _NET_WM_STATE
Definition: SDL_x11video.h:95
_this
static SDL_VideoDevice * _this
Definition: SDL_video.c:121
SDL_VideoDevice::HideWindow
void(* HideWindow)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:223
device
static SDL_AudioDeviceID device
Definition: loopwave.c:37
SDL_x11shape.h
size_t
unsigned int size_t
Definition: SDL_config_windows.h:68
SDL_x11touch.h
SDL_VideoData::_NET_WM_STATE_SKIP_TASKBAR
Atom _NET_WM_STATE_SKIP_TASKBAR
Definition: SDL_x11video.h:102
SDL_VideoDevice::RaiseWindow
void(* RaiseWindow)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:224
SDL_ShapeDriver::SetWindowShape
int(* SetWindowShape)(SDL_WindowShaper *shaper, SDL_Surface *shape, SDL_WindowShapeMode *shape_mode)
Definition: SDL_sysvideo.h:61
SDL_VideoData::_NET_WM_STATE_HIDDEN
Atom _NET_WM_STATE_HIDDEN
Definition: SDL_x11video.h:96
SDL_VideoDevice::SetTextInputRect
void(* SetTextInputRect)(_THIS, SDL_Rect *rect)
Definition: SDL_sysvideo.h:288
SDL_VideoData::_NET_WM_USER_TIME
Atom _NET_WM_USER_TIME
Definition: SDL_x11video.h:111
SDL_VideoData::_NET_ACTIVE_WINDOW
Atom _NET_ACTIVE_WINDOW
Definition: SDL_x11video.h:112
SDL_video.h
SDL_VideoDevice::Vulkan_GetInstanceExtensions
SDL_bool(* Vulkan_GetInstanceExtensions)(_THIS, SDL_Window *window, unsigned *count, const char **names)
Definition: SDL_sysvideo.h:272
SDL_VideoData::WM_DELETE_WINDOW
Atom WM_DELETE_WINDOW
Definition: SDL_x11video.h:93
X11_HasClipboardText
SDL_bool X11_HasClipboardText(_THIS)
SDL_VideoData::XdndActionCopy
Atom XdndActionCopy
Definition: SDL_x11video.h:120
SDL_VideoDevice::GetWindowWMInfo
SDL_bool(* GetWindowWMInfo)(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info)
Definition: SDL_sysvideo.h:247
SDL_VideoData::PRIMARY
Atom PRIMARY
Definition: SDL_x11video.h:115
X11_CreateWindow
int X11_CreateWindow(_THIS, SDL_Window *window)
X11_GetDisplayModes
void X11_GetDisplayModes(_THIS, SDL_VideoDisplay *display)
SDL_VideoDevice::GL_CreateContext
SDL_GLContext(* GL_CreateContext)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:257
X11_SuspendScreenSaver
void X11_SuspendScreenSaver(_THIS)
SDL_VideoData::_NET_WM_STATE_SKIP_PAGER
Atom _NET_WM_STATE_SKIP_PAGER
Definition: SDL_x11video.h:103
d
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const char return SDL_ThreadFunction const char void return Uint32 return Uint32 SDL_AssertionHandler void SDL_SpinLock SDL_atomic_t int int return SDL_atomic_t return void void void return void return int return SDL_AudioSpec SDL_AudioSpec return int int return return int SDL_RWops int SDL_AudioSpec Uint8 ** d
Definition: SDL_dynapi_procs.h:117
SDL_VideoDevice::Vulkan_CreateSurface
SDL_bool(* Vulkan_CreateSurface)(_THIS, SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface)
Definition: SDL_sysvideo.h:273
SDL_VideoData::_NET_WM_ICON_NAME
Atom _NET_WM_ICON_NAME
Definition: SDL_x11video.h:107
X11_SetWindowGammaRamp
int X11_SetWindowGammaRamp(_THIS, SDL_Window *window, const Uint16 *ramp)
X11_InitModes
int X11_InitModes(_THIS)
_THIS
#define _THIS
Definition: SDL_alsa_audio.h:31
SDL_VideoDevice::GL_MakeCurrent
int(* GL_MakeCurrent)(_THIS, SDL_Window *window, SDL_GLContext context)
Definition: SDL_sysvideo.h:258
SDL_free
#define SDL_free
Definition: SDL_dynapi_overrides.h:377
SDL_mouse.h
VideoBootStrap
Definition: SDL_sysvideo.h:393
X11_CreateWindowFrom
int X11_CreateWindowFrom(_THIS, SDL_Window *window, const void *data)
SDL_VideoData::XKLAVIER_STATE
Atom XKLAVIER_STATE
Definition: SDL_x11video.h:124
SDL_VideoDevice::num_displays
int num_displays
Definition: SDL_sysvideo.h:311
SDL_VideoDevice::Vulkan_UnloadLibrary
void(* Vulkan_UnloadLibrary)(_THIS)
Definition: SDL_sysvideo.h:271
SDL_memcmp
#define SDL_memcmp
Definition: SDL_dynapi_overrides.h:389
SDL_X11_LoadSymbols
int SDL_X11_LoadSymbols(void)
SDL_VideoDevice::SetWindowMinimumSize
void(* SetWindowMinimumSize)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:216
X11_SetWindowInputFocus
int X11_SetWindowInputFocus(_THIS, SDL_Window *window)
X11_GetDisplayDPI
int X11_GetDisplayDPI(_THIS, SDL_VideoDisplay *sdl_display, float *ddpi, float *hdpi, float *vdpi)
SDL_VideoDisplay::current_mode
SDL_DisplayMode current_mode
Definition: SDL_sysvideo.h:132
X11_RestoreWindow
void X11_RestoreWindow(_THIS, SDL_Window *window)
SDL_VideoDevice::displays
SDL_VideoDisplay * displays
Definition: SDL_sysvideo.h:312
SDL_VideoDevice::GetDisplayBounds
int(* GetDisplayBounds)(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect)
Definition: SDL_sysvideo.h:181
X11_GetWindowBordersSize
int X11_GetWindowBordersSize(_THIS, SDL_Window *window, int *top, int *left, int *bottom, int *right)
SDL_VideoDevice::DestroyWindow
void(* DestroyWindow)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:234
SDL_VideoDevice::StopTextInput
void(* StopTextInput)(_THIS)
Definition: SDL_sysvideo.h:287
SDL_VideoData::_NET_WM_ACTION_FULLSCREEN
Atom _NET_WM_ACTION_FULLSCREEN
Definition: SDL_x11video.h:105
SDL_VideoDevice::SetWindowIcon
void(* SetWindowIcon)(_THIS, SDL_Window *window, SDL_Surface *icon)
Definition: SDL_sysvideo.h:213
SDL_VideoData::clipboard_window
Window clipboard_window
Definition: SDL_x11video.h:86
X11_ShowWindow
void X11_ShowWindow(_THIS, SDL_Window *window)
X11_DestroyWindow
void X11_DestroyWindow(_THIS, SDL_Window *window)
X11_QuitMouse
void X11_QuitMouse(_THIS)
SDL_x11framebuffer.h
X11_CreateShaper
SDL_WindowShaper * X11_CreateShaper(SDL_Window *window)
SDL_x11vulkan.h
SDL_Delay
#define SDL_Delay
Definition: SDL_dynapi_overrides.h:486
SDL_VideoDisplay
Definition: SDL_sysvideo.h:125
SDL_getenv
#define SDL_getenv
Definition: SDL_dynapi_overrides.h:378
X11_SetClipboardText
int X11_SetClipboardText(_THIS, const char *text)
SDL_VideoDevice::DestroyWindowFramebuffer
void(* DestroyWindowFramebuffer)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:237
SDL_VideoDevice::ResetTouch
void(* ResetTouch)(_THIS)
Definition: SDL_sysvideo.h:171
SDL_VideoDevice::GL_UnloadLibrary
void(* GL_UnloadLibrary)(_THIS)
Definition: SDL_sysvideo.h:256
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:50
SDL_x11xinput2.h
SDL_VideoDevice::GetDisplayModes
void(* GetDisplayModes)(_THIS, SDL_VideoDisplay *display)
Definition: SDL_sysvideo.h:196
X11_SetWindowMinimumSize
void X11_SetWindowMinimumSize(_THIS, SDL_Window *window)
SDL_VideoDevice::SetWindowMaximumSize
void(* SetWindowMaximumSize)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:217
NULL
#define NULL
Definition: begin_code.h:164
SDL_VideoDevice::CreateSDLWindow
int(* CreateSDLWindow)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:210
SDL_OutOfMemory
#define SDL_OutOfMemory()
Definition: SDL_error.h:52
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:139
SDL_VideoDisplay::desktop_mode
SDL_DisplayMode desktop_mode
Definition: SDL_sysvideo.h:131
X11_SetWindowModalFor
int X11_SetWindowModalFor(_THIS, SDL_Window *modal_window, SDL_Window *parent_window)
SDL_VideoData::_NET_WM_STATE_MAXIMIZED_HORZ
Atom _NET_WM_STATE_MAXIMIZED_HORZ
Definition: SDL_x11video.h:99
SDL_VideoDevice::VideoQuit
void(* VideoQuit)(_THIS)
Definition: SDL_sysvideo.h:166
X11_StopTextInput
void X11_StopTextInput(_THIS)
SDL_SetError
#define SDL_SetError
Definition: SDL_dynapi_overrides.h:30
SDL_ShapeDriver::CreateShaper
SDL_WindowShaper *(* CreateShaper)(SDL_Window *window)
Definition: SDL_sysvideo.h:60
SDL_calloc
#define SDL_calloc
Definition: SDL_dynapi_overrides.h:375
SDL_VideoData::XdndTypeList
Atom XdndTypeList
Definition: SDL_x11video.h:119
SDL_ShapeDriver::ResizeWindowShape
int(* ResizeWindowShape)(SDL_Window *window)
Definition: SDL_sysvideo.h:62
SDL_VideoDevice::SetWindowOpacity
int(* SetWindowOpacity)(_THIS, SDL_Window *window, float opacity)
Definition: SDL_sysvideo.h:219
X11_InitKeyboard
int X11_InitKeyboard(_THIS)
X11_QuitModes
void X11_QuitModes(_THIS)
SDL_VideoDevice::SetWindowPosition
void(* SetWindowPosition)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:214
SDL_VideoDevice::GL_SwapWindow
int(* GL_SwapWindow)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:262
SDL_strdup
#define SDL_strdup
Definition: SDL_dynapi_overrides.h:397
SDL_VideoData::XdndStatus
Atom XdndStatus
Definition: SDL_x11video.h:118
SDL_VideoData::XdndFinished
Atom XdndFinished
Definition: SDL_x11video.h:122
SDL_VideoDevice::MinimizeWindow
void(* MinimizeWindow)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:226
SDL_VideoData::_NET_WM_STATE_FOCUSED
Atom _NET_WM_STATE_FOCUSED
Definition: SDL_x11video.h:97
X11_RaiseWindow
void X11_RaiseWindow(_THIS, SDL_Window *window)
X11_InitTouch
void X11_InitTouch(_THIS)
SDL_VideoData::net_wm
SDL_bool net_wm
Definition: SDL_x11video.h:89
X11_SetWindowIcon
void X11_SetWindowIcon(_THIS, SDL_Window *window, SDL_Surface *icon)
X11_GetWindowTitle
char * X11_GetWindowTitle(_THIS, Window xwindow)
SDL_VideoData::XdndDrop
Atom XdndDrop
Definition: SDL_x11video.h:121
SDL_VideoDevice::SetWindowInputFocus
int(* SetWindowInputFocus)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:221
SDL_VideoDevice
Definition: SDL_sysvideo.h:147
SDL_x11video.h
SDL_VideoData
Definition: SDL_androidvideo.h:35
SDL_VideoDevice::HasClipboardText
SDL_bool(* HasClipboardText)(_THIS)
Definition: SDL_sysvideo.h:299
SDL_GetVideoDevice
SDL_VideoDevice * SDL_GetVideoDevice(void)
Definition: SDL_video.c:586
SDL_VideoDevice::shape_driver
SDL_ShapeDriver shape_driver
Definition: SDL_sysvideo.h:244
SDL_VideoDevice::VideoInit
int(* VideoInit)(_THIS)
Definition: SDL_sysvideo.h:160
SDL_snprintf
#define SDL_snprintf
Definition: SDL_dynapi_overrides.h:40
SDL_VideoDevice::CreateSDLWindowFrom
int(* CreateSDLWindowFrom)(_THIS, SDL_Window *window, const void *data)
Definition: SDL_sysvideo.h:211
SDL_VideoData::int
int
Definition: SDL_windowsvideo.h:135
SDL_arraysize
#define SDL_arraysize(array)
Definition: SDL_stdinc.h:93
SDL_VideoDevice::SetWindowFullscreen
void(* SetWindowFullscreen)(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen)
Definition: SDL_sysvideo.h:230
SDL_VideoDevice::SetWindowModalFor
int(* SetWindowModalFor)(_THIS, SDL_Window *modal_window, SDL_Window *parent_window)
Definition: SDL_sysvideo.h:220
SDL_VideoDevice::UpdateWindowFramebuffer
int(* UpdateWindowFramebuffer)(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects)
Definition: SDL_sysvideo.h:236
SDL_VideoData::XdndSelection
Atom XdndSelection
Definition: SDL_x11video.h:123
SDL_X11_UnloadSymbols
void SDL_X11_UnloadSymbols(void)
SDL_VideoData::UTF8_STRING
Atom UTF8_STRING
Definition: SDL_x11video.h:114
SDL_VideoDevice::GL_DeleteContext
void(* GL_DeleteContext)(_THIS, SDL_GLContext context)
Definition: SDL_sysvideo.h:263
SDL_VideoDevice::GetClipboardText
char *(* GetClipboardText)(_THIS)
Definition: SDL_sysvideo.h:298
X11_SetWindowSize
void X11_SetWindowSize(_THIS, SDL_Window *window)
SDL_VideoDevice::SetWindowTitle
void(* SetWindowTitle)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:212
SDL_VideoDevice::SetWindowResizable
void(* SetWindowResizable)(_THIS, SDL_Window *window, SDL_bool resizable)
Definition: SDL_sysvideo.h:229
X11_GetDisplayUsableBounds
int X11_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *sdl_display, SDL_Rect *rect)
SDL_VideoDevice::GetDisplayUsableBounds
int(* GetDisplayUsableBounds)(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect)
Definition: SDL_sysvideo.h:191
SDL_VideoDevice::GL_GetSwapInterval
int(* GL_GetSwapInterval)(_THIS)
Definition: SDL_sysvideo.h:261
SDL_VideoData::_NET_WM_NAME
Atom _NET_WM_NAME
Definition: SDL_x11video.h:106
SDL_VideoDevice::MaximizeWindow
void(* MaximizeWindow)(_THIS, SDL_Window *window)
Definition: SDL_sysvideo.h:225
SDL_VideoDevice::SetClipboardText
int(* SetClipboardText)(_THIS, const char *text)
Definition: SDL_sysvideo.h:297
SDL_VideoData::_NET_WM_STATE_ABOVE
Atom _NET_WM_STATE_ABOVE
Definition: SDL_x11video.h:101
SDL_timer.h
SDL_VideoDevice::SetWindowGammaRamp
int(* SetWindowGammaRamp)(_THIS, SDL_Window *window, const Uint16 *ramp)
Definition: SDL_sysvideo.h:231
SDL_VideoData::_NET_WM_PING
Atom _NET_WM_PING
Definition: SDL_x11video.h:109
X11_SetWindowBordered
void X11_SetWindowBordered(_THIS, SDL_Window *window, SDL_bool bordered)
X11_HideWindow
void X11_HideWindow(_THIS, SDL_Window *window)
SDL_VideoDevice::SuspendScreenSaver
void(* SuspendScreenSaver)(_THIS)
Definition: SDL_sysvideo.h:283
SDL_strrchr
#define SDL_strrchr
Definition: SDL_dynapi_overrides.h:402
SDL_VideoDevice::SetWindowGrab
void(* SetWindowGrab)(_THIS, SDL_Window *window, SDL_bool grabbed)
Definition: SDL_sysvideo.h:233
X11_SetWindowResizable
void X11_SetWindowResizable(_THIS, SDL_Window *window, SDL_bool resizable)
X11_SetWindowGrab
void X11_SetWindowGrab(_THIS, SDL_Window *window, SDL_bool grabbed)
SDL_VideoDevice::loader_handle
void * loader_handle
Definition: SDL_sysvideo.h:372
SDL_VideoDevice::CreateWindowFramebuffer
int(* CreateWindowFramebuffer)(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch)
Definition: SDL_sysvideo.h:235
SDL_VideoDevice::GL_GetProcAddress
void *(* GL_GetProcAddress)(_THIS, const char *proc)
Definition: SDL_sysvideo.h:255
SDL_VideoData::WM_TAKE_FOCUS
Atom WM_TAKE_FOCUS
Definition: SDL_x11video.h:94
X11_GetWindowWMInfo
SDL_bool X11_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info)
X11_SetWindowMaximumSize
void X11_SetWindowMaximumSize(_THIS, SDL_Window *window)
X11_QuitTouch
void X11_QuitTouch(_THIS)
SDL_VideoDevice::PumpEvents
void(* PumpEvents)(_THIS)
Definition: SDL_sysvideo.h:280
X11_SetWindowPosition
void X11_SetWindowPosition(_THIS, SDL_Window *window)