19682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/*
29682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    SDL - Simple DirectMedia Layer
39682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    Copyright (C) 1997-2012 Sam Lantinga
49682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
59682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    This library is free software; you can redistribute it and/or
69682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    modify it under the terms of the GNU Lesser General Public
79682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    License as published by the Free Software Foundation; either
89682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    version 2.1 of the License, or (at your option) any later version.
99682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
109682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    This library is distributed in the hope that it will be useful,
119682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    but WITHOUT ANY WARRANTY; without even the implied warranty of
129682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
139682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    Lesser General Public License for more details.
149682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
159682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    You should have received a copy of the GNU Lesser General Public
169682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    License along with this library; if not, write to the Free Software
179682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
189682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
199682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    Sam Lantinga
209682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    slouken@libsdl.org
219682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall*/
229682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include "SDL_config.h"
239682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
249682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#ifndef _SDL_x11video_h
259682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define _SDL_x11video_h
269682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
279682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include <X11/Xlib.h>
289682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include <X11/Xutil.h>
299682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include <X11/Xatom.h>
309682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
319682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include "SDL_mouse.h"
329682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include "../SDL_sysvideo.h"
339682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
349682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#if SDL_VIDEO_DRIVER_X11_DGAMOUSE
359682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include "../Xext/extensions/xf86dga.h"
369682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#endif
379682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#if SDL_VIDEO_DRIVER_X11_XINERAMA
389682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include "../Xext/extensions/Xinerama.h"
399682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#endif
409682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#if SDL_VIDEO_DRIVER_X11_XRANDR
419682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include <X11/extensions/Xrandr.h>
429682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#endif
439682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#if SDL_VIDEO_DRIVER_X11_VIDMODE
449682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include "../Xext/extensions/xf86vmode.h"
459682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#endif
469682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#if SDL_VIDEO_DRIVER_X11_XME
479682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include "../Xext/extensions/xme.h"
489682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#endif
499682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
509682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include "SDL_x11dyn.h"
519682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
529682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/* Hidden "this" pointer for the video functions */
539682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define _THIS	SDL_VideoDevice *this
549682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
559682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/* Private display data */
569682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallstruct SDL_PrivateVideoData {
579682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    int local_X11;		/* Flag: true if local display */
589682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    Display *X11_Display;	/* Used for events and window management */
599682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    Display *GFX_Display;	/* Used for graphics and colormap stuff */
609682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    Visual *SDL_Visual;		/* The visual used by our window */
619682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    Window WMwindow;		/* Input window, managed by window manager */
629682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    Window FSwindow;		/* Fullscreen window, completely unmanaged */
639682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    Window SDL_Window;		/* Shared by both displays (no X security?) */
649682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    Atom WM_DELETE_WINDOW;	/* "close-window" protocol atom */
659682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    WMcursor *BlankCursor;	/* The invisible cursor */
669682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    XIM X11_IM;		/* Used to communicate with the input method (IM) server */
679682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    XIC X11_IC;		/* Used for retaining the state, properties, and semantics of communication with                                                  the input method (IM) server */
689682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
699682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    char *SDL_windowid;		/* Flag: true if we have been passed a window */
709682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
719682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    /* Direct Graphics Access extension information */
729682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    int using_dga;
739682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
749682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#ifndef NO_SHARED_MEMORY
759682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    /* MIT shared memory extension information */
769682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    int use_mitshm;
779682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    XShmSegmentInfo shminfo;
789682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#endif
799682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
809682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    /* The variables used for displaying graphics */
819682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    XImage *Ximage;		/* The X image for our window */
829682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    GC	gc;			/* The graphic context for drawing */
839682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
849682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    /* The current width and height of the fullscreen mode */
859682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    int window_w;
869682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    int window_h;
879682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
889682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    /* Support for internal mouse warping */
899682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    struct {
909682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall        int x;
919682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall        int y;
929682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    } mouse_last;
939682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    struct {
949682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall        int numerator;
959682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall        int denominator;
969682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall        int threshold;
979682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    } mouse_accel;
989682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    int mouse_relative;
999682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
1009682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    /* The current list of available video modes */
1019682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    SDL_Rect **modelist;
1029682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
1039682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    /* available visuals of interest to us, sorted deepest first */
1049682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    struct {
1059682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	Visual *visual;
1069682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	int depth;		/* number of significant bits/pixel */
1079682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	int bpp;		/* pixel quantum in bits */
1089682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    } visuals[2*5];		/* at most 2 entries for 8, 15, 16, 24, 32 */
1099682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    int nvisuals;
1109682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
1119682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    Visual *vis;		/* current visual in use */
1129682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    int depth;			/* current visual depth (not bpp) */
1139682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
1149682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    /* Variables used by the X11 video mode code */
1159682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#if SDL_VIDEO_DRIVER_X11_XINERAMA
1169682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    SDL_NAME(XineramaScreenInfo) xinerama_info;
1179682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#endif
1189682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#if SDL_VIDEO_DRIVER_X11_XRANDR
1199682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    XRRScreenConfiguration* screen_config;
1209682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    int saved_size_id;
1219682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    Rotation saved_rotation;
1229682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#endif
1239682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#if SDL_VIDEO_DRIVER_X11_VIDMODE
1249682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    SDL_NAME(XF86VidModeModeInfo) saved_mode;
1259682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    struct {
1269682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall        int x, y;
1279682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    } saved_view;
1289682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#endif
1299682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#if SDL_VIDEO_DRIVER_X11_XME /* XiG XME fullscreen */
1309682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    XiGMiscResolutionInfo saved_res;
1319682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#endif
1329682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
1339682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    int use_xinerama;
1349682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    int use_xrandr;
1359682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    int use_vidmode;
1369682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    int use_xme;
1379682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    int currently_fullscreen;
1389682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
1399682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    /* Automatic mode switching support (entering/leaving fullscreen) */
1409682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    Uint32 switch_waiting;
1419682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    Uint32 switch_time;
1429682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
1439682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    /* Prevent too many XSync() calls */
1449682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    int blit_queued;
1459682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
1469682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    /* Colormap handling */
1479682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    Colormap DisplayColormap;	/* The default display colormap */
1489682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    Colormap XColorMap;		/* The current window colormap */
1499682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    int *XPixels;		/* pixels value allocation counts */
1509682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    float gamma_saved[3];	/* Saved gamma values for VidMode gamma */
1519682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    int gamma_changed;		/* flag: has VidMode gamma been modified? */
1529682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
1539682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    short *iconcolors;		/* List of colors used by the icon */
1549682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
1559682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    /* Screensaver settings */
1569682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall    int allow_screensaver;
1579682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall};
1589682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
159e4c5d95ed37611acc6a186522315195b4ebfb9efJesse Hallextern int X11_wmXAdjust;
160e4c5d95ed37611acc6a186522315195b4ebfb9efJesse Hallextern int X11_wmYAdjust;
161e4c5d95ed37611acc6a186522315195b4ebfb9efJesse Hall
1629682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/* Old variable names */
1639682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define local_X11		(this->hidden->local_X11)
1649682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define SDL_Display		(this->hidden->X11_Display)
1659682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define GFX_Display		(this->hidden->GFX_Display)
1669682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define SDL_Screen		DefaultScreen(this->hidden->X11_Display)
1679682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define SDL_Visual		(this->hidden->vis)
1689682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define SDL_Root		RootWindow(SDL_Display, SDL_Screen)
1699682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define WMwindow		(this->hidden->WMwindow)
1709682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define FSwindow		(this->hidden->FSwindow)
1719682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define SDL_Window		(this->hidden->SDL_Window)
1729682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define WM_DELETE_WINDOW	(this->hidden->WM_DELETE_WINDOW)
1739682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define SDL_BlankCursor		(this->hidden->BlankCursor)
1749682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define SDL_IM			(this->hidden->X11_IM)
1759682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define SDL_IC			(this->hidden->X11_IC)
1769682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define SDL_windowid		(this->hidden->SDL_windowid)
1779682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define using_dga		(this->hidden->using_dga)
1789682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define use_mitshm		(this->hidden->use_mitshm)
1799682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define shminfo			(this->hidden->shminfo)
1809682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define SDL_Ximage		(this->hidden->Ximage)
1819682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define SDL_GC			(this->hidden->gc)
1829682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define window_w		(this->hidden->window_w)
1839682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define window_h		(this->hidden->window_h)
1849682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define mouse_last		(this->hidden->mouse_last)
1859682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define mouse_accel		(this->hidden->mouse_accel)
1869682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define mouse_relative		(this->hidden->mouse_relative)
1879682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define SDL_modelist		(this->hidden->modelist)
1889682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define xinerama_info		(this->hidden->xinerama_info)
1899682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define saved_mode		(this->hidden->saved_mode)
1909682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define saved_view		(this->hidden->saved_view)
1919682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define saved_res		(this->hidden->saved_res)
1929682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define screen_config		(this->hidden->screen_config)
1939682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define saved_size_id		(this->hidden->saved_size_id)
1949682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define saved_rotation		(this->hidden->saved_rotation)
1959682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define use_xinerama		(this->hidden->use_xinerama)
1969682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define use_vidmode		(this->hidden->use_vidmode)
1979682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define use_xrandr		(this->hidden->use_xrandr)
1989682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define use_xme			(this->hidden->use_xme)
1999682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define currently_fullscreen	(this->hidden->currently_fullscreen)
2009682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define switch_waiting		(this->hidden->switch_waiting)
2019682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define switch_time		(this->hidden->switch_time)
2029682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define blit_queued		(this->hidden->blit_queued)
2039682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define SDL_DisplayColormap	(this->hidden->DisplayColormap)
2049682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define SDL_PrivateColormap	(this->hidden->PrivateColormap)
2059682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define SDL_XColorMap		(this->hidden->XColorMap)
2069682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define SDL_XPixels		(this->hidden->XPixels)
2079682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define gamma_saved		(this->hidden->gamma_saved)
2089682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define gamma_changed		(this->hidden->gamma_changed)
2099682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define SDL_iconcolors		(this->hidden->iconcolors)
2109682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define allow_screensaver	(this->hidden->allow_screensaver)
2119682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
2129682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/* Some versions of XFree86 have bugs - detect if this is one of them */
2139682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#define BUGGY_XFREE86(condition, buggy_version) \
2149682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall((SDL_strcmp(ServerVendor(SDL_Display), "The XFree86 Project, Inc") == 0) && \
2159682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall (VendorRelease(SDL_Display) condition buggy_version))
2169682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
2179682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#endif /* _SDL_x11video_h */
218