* Some refactoring and bug fixes. Thanks Michał Kuchta!
authorBrandon Schaefer <brandon.schaefer@canonical.com>
Wed, 01 Mar 2017 14:50:59 -0800
changeset 10923ab8850aa5e19
parent 10922 5f4b80b748dd
child 10924 abfe0c4d98ac
* Some refactoring and bug fixes. Thanks Michał Kuchta!
configure
include/SDL_config.h
include/SDL_revision.h
src/video/SDL_video.c
src/video/mir/SDL_mirevents.c
src/video/mir/SDL_mirvideo.c
src/video/mir/SDL_mirwindow.c
test/configure
     1.1 --- a/configure	Tue Feb 28 19:48:52 2017 -0500
     1.2 +++ b/configure	Wed Mar 01 14:50:59 2017 -0800
     1.3 @@ -745,6 +745,7 @@
     1.4  docdir
     1.5  oldincludedir
     1.6  includedir
     1.7 +runstatedir
     1.8  localstatedir
     1.9  sharedstatedir
    1.10  sysconfdir
    1.11 @@ -916,6 +917,7 @@
    1.12  sysconfdir='${prefix}/etc'
    1.13  sharedstatedir='${prefix}/com'
    1.14  localstatedir='${prefix}/var'
    1.15 +runstatedir='${localstatedir}/run'
    1.16  includedir='${prefix}/include'
    1.17  oldincludedir='/usr/include'
    1.18  docdir='${datarootdir}/doc/${PACKAGE}'
    1.19 @@ -1168,6 +1170,15 @@
    1.20    | -silent | --silent | --silen | --sile | --sil)
    1.21      silent=yes ;;
    1.22  
    1.23 +  -runstatedir | --runstatedir | --runstatedi | --runstated \
    1.24 +  | --runstate | --runstat | --runsta | --runst | --runs \
    1.25 +  | --run | --ru | --r)
    1.26 +    ac_prev=runstatedir ;;
    1.27 +  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
    1.28 +  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
    1.29 +  | --run=* | --ru=* | --r=*)
    1.30 +    runstatedir=$ac_optarg ;;
    1.31 +
    1.32    -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
    1.33      ac_prev=sbindir ;;
    1.34    -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
    1.35 @@ -1305,7 +1316,7 @@
    1.36  for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
    1.37  		datadir sysconfdir sharedstatedir localstatedir includedir \
    1.38  		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
    1.39 -		libdir localedir mandir
    1.40 +		libdir localedir mandir runstatedir
    1.41  do
    1.42    eval ac_val=\$$ac_var
    1.43    # Remove trailing slashes.
    1.44 @@ -1458,6 +1469,7 @@
    1.45    --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
    1.46    --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
    1.47    --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
    1.48 +  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
    1.49    --libdir=DIR            object code libraries [EPREFIX/lib]
    1.50    --includedir=DIR        C header files [PREFIX/include]
    1.51    --oldincludedir=DIR     C header files for non-gcc [/usr/include]
    1.52 @@ -19209,7 +19221,7 @@
    1.53  main ()
    1.54  {
    1.55  
    1.56 -                    MirTouchAction actions = mir_touch_actions
    1.57 +                    MirWindowAttrib attrib = mir_window_attrib_state
    1.58  
    1.59    ;
    1.60    return 0;
     2.1 --- a/include/SDL_config.h	Tue Feb 28 19:48:52 2017 -0500
     2.2 +++ b/include/SDL_config.h	Wed Mar 01 14:50:59 2017 -0800
     2.3 @@ -1,3 +1,4 @@
     2.4 +/* include/SDL_config.h.  Generated from SDL_config.h.in by configure.  */
     2.5  /*
     2.6    Simple DirectMedia Layer
     2.7    Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
     2.8 @@ -22,32 +23,349 @@
     2.9  #ifndef SDL_config_h_
    2.10  #define SDL_config_h_
    2.11  
    2.12 +/**
    2.13 + *  \file SDL_config.h.in
    2.14 + *
    2.15 + *  This is a set of defines to configure the SDL features
    2.16 + */
    2.17 +
    2.18 +/* General platform specific identifiers */
    2.19  #include "SDL_platform.h"
    2.20  
    2.21 -/**
    2.22 - *  \file SDL_config.h
    2.23 - */
    2.24 -
    2.25 -/* Add any platform that doesn't build using the configure system. */
    2.26 -#if defined(__WIN32__)
    2.27 -#include "SDL_config_windows.h"
    2.28 -#elif defined(__WINRT__)
    2.29 -#include "SDL_config_winrt.h"
    2.30 -#elif defined(__MACOSX__)
    2.31 -#include "SDL_config_macosx.h"
    2.32 -#elif defined(__IPHONEOS__)
    2.33 -#include "SDL_config_iphoneos.h"
    2.34 -#elif defined(__ANDROID__)
    2.35 -#include "SDL_config_android.h"
    2.36 -#elif defined(__PSP__)
    2.37 -#include "SDL_config_psp.h"
    2.38 -#else
    2.39 -/* This is a minimal configuration just to get SDL running on new platforms */
    2.40 -#include "SDL_config_minimal.h"
    2.41 -#endif /* platform config */
    2.42 -
    2.43 -#ifdef USING_GENERATED_CONFIG_H
    2.44 -#error Wrong SDL_config.h, check your include path?
    2.45 +/* Make sure that this isn't included by Visual C++ */
    2.46 +#ifdef _MSC_VER
    2.47 +#error You should run hg revert SDL_config.h 
    2.48  #endif
    2.49  
    2.50 +/* C language features */
    2.51 +/* #undef const */
    2.52 +/* #undef inline */
    2.53 +/* #undef volatile */
    2.54 +
    2.55 +/* C datatypes */
    2.56 +#ifdef __LP64__
    2.57 +#define SIZEOF_VOIDP 8
    2.58 +#else
    2.59 +#define SIZEOF_VOIDP 4
    2.60 +#endif
    2.61 +#define HAVE_GCC_ATOMICS 1
    2.62 +/* #undef HAVE_GCC_SYNC_LOCK_TEST_AND_SET */
    2.63 +
    2.64 +/* #undef HAVE_DDRAW_H */
    2.65 +/* #undef HAVE_DINPUT_H */
    2.66 +/* #undef HAVE_DSOUND_H */
    2.67 +/* #undef HAVE_DXGI_H */
    2.68 +/* #undef HAVE_XINPUT_H */
    2.69 +
    2.70 +/* Comment this if you want to build without any C library requirements */
    2.71 +#define HAVE_LIBC 1
    2.72 +#if HAVE_LIBC
    2.73 +
    2.74 +/* Useful headers */
    2.75 +#define HAVE_ALLOCA_H 1
    2.76 +#define HAVE_SYS_TYPES_H 1
    2.77 +#define HAVE_STDIO_H 1
    2.78 +#define STDC_HEADERS 1
    2.79 +#define HAVE_STDLIB_H 1
    2.80 +#define HAVE_STDARG_H 1
    2.81 +#define HAVE_MALLOC_H 1
    2.82 +#define HAVE_MEMORY_H 1
    2.83 +#define HAVE_STRING_H 1
    2.84 +#define HAVE_STRINGS_H 1
    2.85 +#define HAVE_INTTYPES_H 1
    2.86 +#define HAVE_STDINT_H 1
    2.87 +#define HAVE_CTYPE_H 1
    2.88 +#define HAVE_MATH_H 1
    2.89 +#define HAVE_ICONV_H 1
    2.90 +#define HAVE_SIGNAL_H 1
    2.91 +/* #undef HAVE_ALTIVEC_H */
    2.92 +/* #undef HAVE_PTHREAD_NP_H */
    2.93 +#define HAVE_LIBUDEV_H 1
    2.94 +#define HAVE_DBUS_DBUS_H 1
    2.95 +#define HAVE_IBUS_IBUS_H 1
    2.96 +/* #undef HAVE_FCITX_FRONTEND_H */
    2.97 +#define HAVE_LIBSAMPLERATE_H 1
    2.98 +
    2.99 +/* C library functions */
   2.100 +#define HAVE_MALLOC 1
   2.101 +#define HAVE_CALLOC 1
   2.102 +#define HAVE_REALLOC 1
   2.103 +#define HAVE_FREE 1
   2.104 +#define HAVE_ALLOCA 1
   2.105 +#ifndef __WIN32__ /* Don't use C runtime versions of these on Windows */
   2.106 +#define HAVE_GETENV 1
   2.107 +#define HAVE_SETENV 1
   2.108 +#define HAVE_PUTENV 1
   2.109 +#define HAVE_UNSETENV 1
   2.110 +#endif
   2.111 +#define HAVE_QSORT 1
   2.112 +#define HAVE_ABS 1
   2.113 +#define HAVE_BCOPY 1
   2.114 +#define HAVE_MEMSET 1
   2.115 +#define HAVE_MEMCPY 1
   2.116 +#define HAVE_MEMMOVE 1
   2.117 +#define HAVE_MEMCMP 1
   2.118 +#define HAVE_STRLEN 1
   2.119 +/* #undef HAVE_STRLCPY */
   2.120 +/* #undef HAVE_STRLCAT */
   2.121 +#define HAVE_STRDUP 1
   2.122 +/* #undef HAVE__STRREV */
   2.123 +/* #undef HAVE__STRUPR */
   2.124 +/* #undef HAVE__STRLWR */
   2.125 +/* #undef HAVE_INDEX */
   2.126 +/* #undef HAVE_RINDEX */
   2.127 +#define HAVE_STRCHR 1
   2.128 +#define HAVE_STRRCHR 1
   2.129 +#define HAVE_STRSTR 1
   2.130 +/* #undef HAVE_ITOA */
   2.131 +/* #undef HAVE__LTOA */
   2.132 +/* #undef HAVE__UITOA */
   2.133 +/* #undef HAVE__ULTOA */
   2.134 +#define HAVE_STRTOL 1
   2.135 +#define HAVE_STRTOUL 1
   2.136 +/* #undef HAVE__I64TOA */
   2.137 +/* #undef HAVE__UI64TOA */
   2.138 +#define HAVE_STRTOLL 1
   2.139 +#define HAVE_STRTOULL 1
   2.140 +#define HAVE_STRTOD 1
   2.141 +#define HAVE_ATOI 1
   2.142 +#define HAVE_ATOF 1
   2.143 +#define HAVE_STRCMP 1
   2.144 +#define HAVE_STRNCMP 1
   2.145 +/* #undef HAVE__STRICMP */
   2.146 +#define HAVE_STRCASECMP 1
   2.147 +/* #undef HAVE__STRNICMP */
   2.148 +#define HAVE_STRNCASECMP 1
   2.149 +/* #undef HAVE_SSCANF */
   2.150 +#define HAVE_VSSCANF 1
   2.151 +/* #undef HAVE_SNPRINTF */
   2.152 +#define HAVE_VSNPRINTF 1
   2.153 +#define HAVE_M_PI /**/
   2.154 +#define HAVE_ATAN 1
   2.155 +#define HAVE_ATAN2 1
   2.156 +#define HAVE_ACOS 1
   2.157 +#define HAVE_ASIN 1
   2.158 +#define HAVE_CEIL 1
   2.159 +#define HAVE_COPYSIGN 1
   2.160 +#define HAVE_COS 1
   2.161 +#define HAVE_COSF 1
   2.162 +#define HAVE_FABS 1
   2.163 +#define HAVE_FLOOR 1
   2.164 +#define HAVE_LOG 1
   2.165 +#define HAVE_POW 1
   2.166 +#define HAVE_SCALBN 1
   2.167 +#define HAVE_SIN 1
   2.168 +#define HAVE_SINF 1
   2.169 +#define HAVE_SQRT 1
   2.170 +#define HAVE_SQRTF 1
   2.171 +#define HAVE_TAN 1
   2.172 +#define HAVE_TANF 1
   2.173 +#define HAVE_FSEEKO 1
   2.174 +#define HAVE_FSEEKO64 1
   2.175 +#define HAVE_SIGACTION 1
   2.176 +#define HAVE_SA_SIGACTION 1
   2.177 +#define HAVE_SETJMP 1
   2.178 +#define HAVE_NANOSLEEP 1
   2.179 +#define HAVE_SYSCONF 1
   2.180 +/* #undef HAVE_SYSCTLBYNAME */
   2.181 +#define HAVE_CLOCK_GETTIME 1
   2.182 +/* #undef HAVE_GETPAGESIZE */
   2.183 +#define HAVE_MPROTECT 1
   2.184 +#define HAVE_ICONV 1
   2.185 +#define HAVE_PTHREAD_SETNAME_NP 1
   2.186 +/* #undef HAVE_PTHREAD_SET_NAME_NP */
   2.187 +#define HAVE_SEM_TIMEDWAIT 1
   2.188 +#define HAVE_GETAUXVAL 1
   2.189 +
   2.190 +#else
   2.191 +#define HAVE_STDARG_H 1
   2.192 +#define HAVE_STDDEF_H 1
   2.193 +#define HAVE_STDINT_H 1
   2.194 +#endif /* HAVE_LIBC */
   2.195 +
   2.196 +/* SDL internal assertion support */
   2.197 +/* #undef SDL_DEFAULT_ASSERT_LEVEL */
   2.198 +
   2.199 +/* Allow disabling of core subsystems */
   2.200 +/* #undef SDL_ATOMIC_DISABLED */
   2.201 +/* #undef SDL_AUDIO_DISABLED */
   2.202 +/* #undef SDL_CPUINFO_DISABLED */
   2.203 +/* #undef SDL_EVENTS_DISABLED */
   2.204 +/* #undef SDL_FILE_DISABLED */
   2.205 +/* #undef SDL_JOYSTICK_DISABLED */
   2.206 +/* #undef SDL_HAPTIC_DISABLED */
   2.207 +/* #undef SDL_LOADSO_DISABLED */
   2.208 +/* #undef SDL_RENDER_DISABLED */
   2.209 +/* #undef SDL_THREADS_DISABLED */
   2.210 +/* #undef SDL_TIMERS_DISABLED */
   2.211 +/* #undef SDL_VIDEO_DISABLED */
   2.212 +/* #undef SDL_POWER_DISABLED */
   2.213 +/* #undef SDL_FILESYSTEM_DISABLED */
   2.214 +
   2.215 +/* Enable various audio drivers */
   2.216 +#define SDL_AUDIO_DRIVER_ALSA 1
   2.217 +#define SDL_AUDIO_DRIVER_ALSA_DYNAMIC "libasound.so.2"
   2.218 +/* #undef SDL_AUDIO_DRIVER_ARTS */
   2.219 +/* #undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC */
   2.220 +#define SDL_AUDIO_DRIVER_PULSEAUDIO 1
   2.221 +#define SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC "libpulse-simple.so.0"
   2.222 +/* #undef SDL_AUDIO_DRIVER_HAIKU */
   2.223 +/* #undef SDL_AUDIO_DRIVER_BSD */
   2.224 +/* #undef SDL_AUDIO_DRIVER_COREAUDIO */
   2.225 +#define SDL_AUDIO_DRIVER_DISK 1
   2.226 +#define SDL_AUDIO_DRIVER_DUMMY 1
   2.227 +/* #undef SDL_AUDIO_DRIVER_ANDROID */
   2.228 +/* #undef SDL_AUDIO_DRIVER_XAUDIO2 */
   2.229 +/* #undef SDL_AUDIO_DRIVER_DSOUND */
   2.230 +/* #undef SDL_AUDIO_DRIVER_ESD */
   2.231 +/* #undef SDL_AUDIO_DRIVER_ESD_DYNAMIC */
   2.232 +/* #undef SDL_AUDIO_DRIVER_NACL */
   2.233 +/* #undef SDL_AUDIO_DRIVER_NAS */
   2.234 +/* #undef SDL_AUDIO_DRIVER_NAS_DYNAMIC */
   2.235 +/* #undef SDL_AUDIO_DRIVER_SNDIO */
   2.236 +/* #undef SDL_AUDIO_DRIVER_SNDIO_DYNAMIC */
   2.237 +#define SDL_AUDIO_DRIVER_OSS 1
   2.238 +/* #undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H */
   2.239 +/* #undef SDL_AUDIO_DRIVER_PAUDIO */
   2.240 +/* #undef SDL_AUDIO_DRIVER_QSA */
   2.241 +/* #undef SDL_AUDIO_DRIVER_SUNAUDIO */
   2.242 +/* #undef SDL_AUDIO_DRIVER_WINMM */
   2.243 +/* #undef SDL_AUDIO_DRIVER_FUSIONSOUND */
   2.244 +/* #undef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC */
   2.245 +/* #undef SDL_AUDIO_DRIVER_EMSCRIPTEN */
   2.246 +
   2.247 +/* Enable various input drivers */
   2.248 +#define SDL_INPUT_LINUXEV 1
   2.249 +#define SDL_INPUT_LINUXKD 1
   2.250 +/* #undef SDL_INPUT_TSLIB */
   2.251 +/* #undef SDL_JOYSTICK_HAIKU */
   2.252 +/* #undef SDL_JOYSTICK_DINPUT */
   2.253 +/* #undef SDL_JOYSTICK_XINPUT */
   2.254 +/* #undef SDL_JOYSTICK_DUMMY */
   2.255 +/* #undef SDL_JOYSTICK_IOKIT */
   2.256 +#define SDL_JOYSTICK_LINUX 1
   2.257 +/* #undef SDL_JOYSTICK_ANDROID */
   2.258 +/* #undef SDL_JOYSTICK_WINMM */
   2.259 +/* #undef SDL_JOYSTICK_USBHID */
   2.260 +/* #undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H */
   2.261 +/* #undef SDL_JOYSTICK_EMSCRIPTEN */
   2.262 +/* #undef SDL_HAPTIC_DUMMY */
   2.263 +#define SDL_HAPTIC_LINUX 1
   2.264 +/* #undef SDL_HAPTIC_IOKIT */
   2.265 +/* #undef SDL_HAPTIC_DINPUT */
   2.266 +/* #undef SDL_HAPTIC_XINPUT */
   2.267 +
   2.268 +/* Enable various shared object loading systems */
   2.269 +#define SDL_LOADSO_DLOPEN 1
   2.270 +/* #undef SDL_LOADSO_DUMMY */
   2.271 +/* #undef SDL_LOADSO_LDG */
   2.272 +/* #undef SDL_LOADSO_WINDOWS */
   2.273 +
   2.274 +/* Enable various threading systems */
   2.275 +#define SDL_THREAD_PTHREAD 1
   2.276 +#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
   2.277 +/* #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP */
   2.278 +/* #undef SDL_THREAD_WINDOWS */
   2.279 +
   2.280 +/* Enable various timer systems */
   2.281 +/* #undef SDL_TIMER_HAIKU */
   2.282 +/* #undef SDL_TIMER_DUMMY */
   2.283 +#define SDL_TIMER_UNIX 1
   2.284 +/* #undef SDL_TIMER_WINDOWS */
   2.285 +
   2.286 +/* Enable various video drivers */
   2.287 +/* #undef SDL_VIDEO_DRIVER_HAIKU */
   2.288 +/* #undef SDL_VIDEO_DRIVER_COCOA */
   2.289 +/* #undef SDL_VIDEO_DRIVER_DIRECTFB */
   2.290 +/* #undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC */
   2.291 +#define SDL_VIDEO_DRIVER_DUMMY 1
   2.292 +/* #undef SDL_VIDEO_DRIVER_WINDOWS */
   2.293 +#define SDL_VIDEO_DRIVER_WAYLAND 1
   2.294 +#define SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH 1
   2.295 +#define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC "libwayland-client.so.0"
   2.296 +#define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL "libwayland-egl.so.1"
   2.297 +#define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR "libwayland-cursor.so.0"
   2.298 +#define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON "libxkbcommon.so.0"
   2.299 +#define SDL_VIDEO_DRIVER_MIR 1
   2.300 +#define SDL_VIDEO_DRIVER_MIR_DYNAMIC "libmirclient.so.9"
   2.301 +#define SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON "libxkbcommon.so.0"
   2.302 +#define SDL_VIDEO_DRIVER_X11 1
   2.303 +/* #undef SDL_VIDEO_DRIVER_RPI */
   2.304 +/* #undef SDL_VIDEO_DRIVER_ANDROID */
   2.305 +/* #undef SDL_VIDEO_DRIVER_EMSCRIPTEN */
   2.306 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC "libX11.so.6"
   2.307 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "libXext.so.6"
   2.308 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR "libXcursor.so.1"
   2.309 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA "libXinerama.so.1"
   2.310 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "libXi.so.6"
   2.311 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "libXrandr.so.2"
   2.312 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "libXss.so.1"
   2.313 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "libXxf86vm.so.1"
   2.314 +#define SDL_VIDEO_DRIVER_X11_XCURSOR 1
   2.315 +#define SDL_VIDEO_DRIVER_X11_XDBE 1
   2.316 +#define SDL_VIDEO_DRIVER_X11_XINERAMA 1
   2.317 +#define SDL_VIDEO_DRIVER_X11_XINPUT2 1
   2.318 +#define SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH 1
   2.319 +#define SDL_VIDEO_DRIVER_X11_XRANDR 1
   2.320 +#define SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1
   2.321 +#define SDL_VIDEO_DRIVER_X11_XSHAPE 1
   2.322 +#define SDL_VIDEO_DRIVER_X11_XVIDMODE 1
   2.323 +#define SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1
   2.324 +#define SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY 1
   2.325 +#define SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM 1
   2.326 +/* #undef SDL_VIDEO_DRIVER_NACL */
   2.327 +/* #undef SDL_VIDEO_DRIVER_VIVANTE */
   2.328 +/* #undef SDL_VIDEO_DRIVER_VIVANTE_VDK */
   2.329 +
   2.330 +/* #undef SDL_VIDEO_RENDER_D3D */
   2.331 +/* #undef SDL_VIDEO_RENDER_D3D11 */
   2.332 +#define SDL_VIDEO_RENDER_OGL 1
   2.333 +#define SDL_VIDEO_RENDER_OGL_ES 1
   2.334 +#define SDL_VIDEO_RENDER_OGL_ES2 1
   2.335 +/* #undef SDL_VIDEO_RENDER_DIRECTFB */
   2.336 +
   2.337 +/* Enable OpenGL support */
   2.338 +#define SDL_VIDEO_OPENGL 1
   2.339 +#define SDL_VIDEO_OPENGL_ES 1
   2.340 +#define SDL_VIDEO_OPENGL_ES2 1
   2.341 +/* #undef SDL_VIDEO_OPENGL_BGL */
   2.342 +/* #undef SDL_VIDEO_OPENGL_CGL */
   2.343 +#define SDL_VIDEO_OPENGL_EGL 1
   2.344 +#define SDL_VIDEO_OPENGL_GLX 1
   2.345 +/* #undef SDL_VIDEO_OPENGL_WGL */
   2.346 +/* #undef SDL_VIDEO_OPENGL_OSMESA */
   2.347 +/* #undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC */
   2.348 +
   2.349 +/* Enable system power support */
   2.350 +#define SDL_POWER_LINUX 1
   2.351 +/* #undef SDL_POWER_WINDOWS */
   2.352 +/* #undef SDL_POWER_MACOSX */
   2.353 +/* #undef SDL_POWER_HAIKU */
   2.354 +/* #undef SDL_POWER_ANDROID */
   2.355 +/* #undef SDL_POWER_EMSCRIPTEN */
   2.356 +/* #undef SDL_POWER_HARDWIRED */
   2.357 +
   2.358 +/* Enable system filesystem support */
   2.359 +/* #undef SDL_FILESYSTEM_HAIKU */
   2.360 +/* #undef SDL_FILESYSTEM_COCOA */
   2.361 +/* #undef SDL_FILESYSTEM_DUMMY */
   2.362 +#define SDL_FILESYSTEM_UNIX 1
   2.363 +/* #undef SDL_FILESYSTEM_WINDOWS */
   2.364 +/* #undef SDL_FILESYSTEM_NACL */
   2.365 +/* #undef SDL_FILESYSTEM_ANDROID */
   2.366 +/* #undef SDL_FILESYSTEM_EMSCRIPTEN */
   2.367 +
   2.368 +/* Enable assembly routines */
   2.369 +#define SDL_ASSEMBLY_ROUTINES 1
   2.370 +/* #undef SDL_ALTIVEC_BLITTERS */
   2.371 +
   2.372 +/* Enable ime support */
   2.373 +#define SDL_USE_IME 1
   2.374 +
   2.375 +/* Enable dynamic udev support */
   2.376 +#define SDL_UDEV_DYNAMIC "libudev.so.1"
   2.377 +
   2.378 +/* Enable dynamic libsamplerate support */
   2.379 +#define SDL_LIBSAMPLERATE_DYNAMIC "libsamplerate.so.0"
   2.380 +
   2.381  #endif /* SDL_config_h_ */
     3.1 --- a/include/SDL_revision.h	Tue Feb 28 19:48:52 2017 -0500
     3.2 +++ b/include/SDL_revision.h	Wed Mar 01 14:50:59 2017 -0800
     3.3 @@ -1,2 +1,2 @@
     3.4 -#define SDL_REVISION "hg-0:aaaaaaaaaaah"
     3.5 -#define SDL_REVISION_NUMBER 0
     3.6 +#define SDL_REVISION "hg-10922:5f4b80b748dd"
     3.7 +#define SDL_REVISION_NUMBER 10922
     4.1 --- a/src/video/SDL_video.c	Tue Feb 28 19:48:52 2017 -0500
     4.2 +++ b/src/video/SDL_video.c	Wed Mar 01 14:50:59 2017 -0800
     4.3 @@ -210,6 +210,7 @@
     4.4  #if SDL_VIDEO_OPENGL
     4.5      /* Ugh, find a way to cache this value! */
     4.6      {
     4.7 +        /*
     4.8          SDL_Window *window;
     4.9          SDL_GLContext context;
    4.10          SDL_bool hasAcceleratedOpenGL = SDL_FALSE;
    4.11 @@ -225,7 +226,6 @@
    4.12                  if (glGetStringFunc) {
    4.13                      vendor = (const char *) glGetStringFunc(GL_VENDOR);
    4.14                  }
    4.15 -                /* Add more vendors here at will... */
    4.16                  if (vendor &&
    4.17                      (SDL_strstr(vendor, "ATI Technologies") ||
    4.18                       SDL_strstr(vendor, "NVIDIA"))) {
    4.19 @@ -235,7 +235,8 @@
    4.20              }
    4.21              SDL_DestroyWindow(window);
    4.22          }
    4.23 -        return hasAcceleratedOpenGL;
    4.24 +        */
    4.25 +        return 1;//hasAcceleratedOpenGL;
    4.26      }
    4.27  #elif SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2
    4.28      /* Let's be optimistic about this! */
     5.1 --- a/src/video/mir/SDL_mirevents.c	Tue Feb 28 19:48:52 2017 -0500
     5.2 +++ b/src/video/mir/SDL_mirevents.c	Wed Mar 01 14:50:59 2017 -0800
     5.3 @@ -237,7 +237,7 @@
     5.4  }
     5.5  
     5.6  static void
     5.7 -MIR_HandleInput(MirInputEvent const* input_event, SDL_Window* window)
     5.8 +HandleInput(MirInputEvent const* input_event, SDL_Window* window)
     5.9  {
    5.10      switch (MIR_mir_input_event_get_type(input_event)) {
    5.11          case (mir_input_event_type_key):
    5.12 @@ -257,7 +257,7 @@
    5.13  }
    5.14  
    5.15  static void
    5.16 -MIR_HandleResize(MirResizeEvent const* resize_event, SDL_Window* window)
    5.17 +HandleResize(MirResizeEvent const* resize_event, SDL_Window* window)
    5.18  {
    5.19      int new_w = MIR_mir_resize_event_get_width (resize_event);
    5.20      int new_h = MIR_mir_resize_event_get_height(resize_event);
    5.21 @@ -270,7 +270,7 @@
    5.22  }
    5.23  
    5.24  static void
    5.25 -MIR_HandleWindow(MirWindowEvent const* event, SDL_Window* window)
    5.26 +HandleWindow(MirWindowEvent const* event, SDL_Window* window)
    5.27  {
    5.28      MirWindowAttrib attrib = MIR_mir_window_event_get_attribute(event);
    5.29      int value              = MIR_mir_window_event_get_attribute_value(event);
    5.30 @@ -294,13 +294,13 @@
    5.31      if (window) {
    5.32          switch (event_type) {
    5.33              case (mir_event_type_input):
    5.34 -                MIR_HandleInput(MIR_mir_event_get_input_event(ev), window);
    5.35 +                HandleInput(MIR_mir_event_get_input_event(ev), window);
    5.36                  break;
    5.37              case (mir_event_type_resize):
    5.38 -                MIR_HandleResize(MIR_mir_event_get_resize_event(ev), window);
    5.39 +                HandleResize(MIR_mir_event_get_resize_event(ev), window);
    5.40                  break;
    5.41              case (mir_event_type_window):
    5.42 -                MIR_HandleWindow(MIR_mir_event_get_window_event(ev), window);
    5.43 +                HandleWindow(MIR_mir_event_get_window_event(ev), window);
    5.44                  break;
    5.45              default:
    5.46                  break;
     6.1 --- a/src/video/mir/SDL_mirvideo.c	Tue Feb 28 19:48:52 2017 -0500
     6.2 +++ b/src/video/mir/SDL_mirvideo.c	Wed Mar 01 14:50:59 2017 -0800
     6.3 @@ -27,6 +27,8 @@
     6.4  
     6.5  #if SDL_VIDEO_DRIVER_MIR
     6.6  
     6.7 +#include "SDL_log.h"
     6.8 +
     6.9  #include "SDL_mirwindow.h"
    6.10  #include "SDL_video.h"
    6.11  
    6.12 @@ -98,7 +100,19 @@
    6.13      int available = 0;
    6.14  
    6.15      if (SDL_MIR_LoadSymbols()) {
    6.16 -        /* !!! FIXME: try to make a MirConnection here. */
    6.17 +
    6.18 +        /* Lets ensure we can connect to the mir server */
    6.19 +        MirConnection* connection = MIR_mir_connect_sync(NULL, __PRETTY_FUNCTION__);
    6.20 +
    6.21 +        if (!MIR_mir_connection_is_valid(connection)) {
    6.22 +            SDL_LogWarn(SDL_LOG_CATEGORY_VIDEO, "Unable to connect to the mir server %s",
    6.23 +                MIR_mir_connection_get_error_message(connection));
    6.24 +
    6.25 +            return available;
    6.26 +        }
    6.27 +
    6.28 +        MIR_mir_connection_release(connection);
    6.29 +
    6.30          available = 1;
    6.31          SDL_MIR_UnloadSymbols();
    6.32      }
     7.1 --- a/src/video/mir/SDL_mirwindow.c	Tue Feb 28 19:48:52 2017 -0500
     7.2 +++ b/src/video/mir/SDL_mirwindow.c	Wed Mar 01 14:50:59 2017 -0800
     7.3 @@ -37,14 +37,14 @@
     7.4  #include "SDL_mirdyn.h"
     7.5  
     7.6  int
     7.7 -IsSurfaceValid(MIR_Window* mir_window)
     7.8 +IsMirWindowValid(MIR_Window* mir_window)
     7.9  {
    7.10      if (!MIR_mir_window_is_valid(mir_window->window)) {
    7.11          const char* error = MIR_mir_window_get_error_message(mir_window->window);
    7.12          return SDL_SetError("Failed to created a mir surface: %s", error);
    7.13      }
    7.14  
    7.15 -    return 0;
    7.16 +    return 1;
    7.17  }
    7.18  
    7.19  MirPixelFormat
    7.20 @@ -194,153 +194,90 @@
    7.21      return SDL_FALSE;
    7.22  }
    7.23  
    7.24 +static void
    7.25 +UpdateMirWindowState(MIR_Data* mir_data, MIR_Window* mir_window, MirWindowState window_state)
    7.26 +{
    7.27 +    if (IsMirWindowValid(mir_window)) {
    7.28 +        MirWindowSpec* spec = MIR_mir_create_window_spec(mir_data->connection);
    7.29 +        MIR_mir_window_spec_set_state(spec, window_state);
    7.30 +
    7.31 +        MIR_mir_window_apply_spec(mir_window->window, spec);
    7.32 +        MIR_mir_window_spec_release(spec);
    7.33 +    }
    7.34 +}
    7.35 +
    7.36  void
    7.37  MIR_SetWindowFullscreen(_THIS, SDL_Window* window,
    7.38                          SDL_VideoDisplay* display,
    7.39                          SDL_bool fullscreen)
    7.40  {
    7.41 -    MIR_Data*   mir_data   = _this->driverdata;
    7.42 -    MIR_Window* mir_window = window->driverdata;
    7.43 -    MirWindowSpec* spec;
    7.44 -    MirWindowState state;
    7.45 +    if (IsMirWindowValid(window->driverdata)) {
    7.46 +        MirWindowState state;
    7.47  
    7.48 -    if (IsSurfaceValid(mir_window) < 0)
    7.49 -        return;
    7.50 +        if (fullscreen) {
    7.51 +            state = mir_window_state_fullscreen;
    7.52 +        }
    7.53 +        else {
    7.54 +            state = mir_window_state_restored;
    7.55 +        }
    7.56  
    7.57 -    if (fullscreen) {
    7.58 -        state = mir_window_state_fullscreen;
    7.59 -    } else {
    7.60 -        state = mir_window_state_restored;
    7.61 +        UpdateMirWindowState(_this->driverdata, window->driverdata, state);
    7.62      }
    7.63 -
    7.64 -    spec = MIR_mir_create_window_spec(mir_data->connection);
    7.65 -    MIR_mir_window_spec_set_state(spec, state);
    7.66 -
    7.67 -    MIR_mir_window_apply_spec(mir_window->window, spec);
    7.68 -    MIR_mir_window_spec_release(spec);
    7.69  }
    7.70  
    7.71  void
    7.72  MIR_MaximizeWindow(_THIS, SDL_Window* window)
    7.73  {
    7.74 -    MIR_Data*   mir_data   = _this->driverdata;
    7.75 -    MIR_Window* mir_window = window->driverdata;
    7.76 -    MirWindowSpec* spec;
    7.77 -
    7.78 -    if (IsSurfaceValid(mir_window) < 0)
    7.79 -        return;
    7.80 -
    7.81 -    spec = MIR_mir_create_window_spec(mir_data->connection);
    7.82 -    MIR_mir_window_spec_set_state(spec, mir_window_state_maximized);
    7.83 -
    7.84 -    MIR_mir_window_apply_spec(mir_window->window, spec);
    7.85 -    MIR_mir_window_spec_release(spec);
    7.86 +    UpdateMirWindowState(_this->driverdata, window->driverdata, mir_window_state_maximized);
    7.87  }
    7.88  
    7.89  void
    7.90  MIR_MinimizeWindow(_THIS, SDL_Window* window)
    7.91  {
    7.92 -    MIR_Data*   mir_data   = _this->driverdata;
    7.93 -    MIR_Window* mir_window = window->driverdata;
    7.94 -    MirWindowSpec* spec;
    7.95 -
    7.96 -    if (IsSurfaceValid(mir_window) < 0)
    7.97 -        return;
    7.98 -
    7.99 -    spec = MIR_mir_create_window_spec(mir_data->connection);
   7.100 -    MIR_mir_window_spec_set_state(spec, mir_window_state_minimized);
   7.101 -
   7.102 -    MIR_mir_window_apply_spec(mir_window->window, spec);
   7.103 -    MIR_mir_window_spec_release(spec);
   7.104 +    UpdateMirWindowState(_this->driverdata, window->driverdata, mir_window_state_minimized);
   7.105  }
   7.106  
   7.107  void
   7.108  MIR_RestoreWindow(_THIS, SDL_Window * window)
   7.109  {
   7.110 -    MIR_Data*   mir_data   = _this->driverdata;
   7.111 -    MIR_Window* mir_window = window->driverdata;
   7.112 -    MirWindowSpec* spec;
   7.113 -
   7.114 -    if (IsSurfaceValid(mir_window) < 0)
   7.115 -        return;
   7.116 -
   7.117 -    spec = MIR_mir_create_window_spec(mir_data->connection);
   7.118 -    MIR_mir_window_spec_set_state(spec, mir_window_state_restored);
   7.119 -
   7.120 -    MIR_mir_window_apply_spec(mir_window->window, spec);
   7.121 -    MIR_mir_window_spec_release(spec);
   7.122 +    UpdateMirWindowState(_this->driverdata, window->driverdata, mir_window_state_restored);
   7.123  }
   7.124  
   7.125  void
   7.126  MIR_HideWindow(_THIS, SDL_Window* window)
   7.127  {
   7.128 -    MIR_Data*   mir_data   = _this->driverdata;
   7.129 -    MIR_Window* mir_window = window->driverdata;
   7.130 -    MirWindowSpec* spec;
   7.131 +    UpdateMirWindowState(_this->driverdata, window->driverdata, mir_window_state_hidden);
   7.132 +}
   7.133  
   7.134 -    if (IsSurfaceValid(mir_window) < 0)
   7.135 -        return;
   7.136 +static void
   7.137 +UpdateMirWindowSize(MIR_Data* mir_data, MIR_Window* mir_window, int width, int height)
   7.138 +{
   7.139 +    if (IsMirWindowValid(mir_window)) {
   7.140 +        MirWindowSpec* spec = MIR_mir_create_window_spec(mir_data->connection);
   7.141 +        MIR_mir_window_spec_set_width (spec, width);
   7.142 +        MIR_mir_window_spec_set_height(spec, height);
   7.143  
   7.144 -    spec = MIR_mir_create_window_spec(mir_data->connection);
   7.145 -    MIR_mir_window_spec_set_state(spec, mir_window_state_hidden);
   7.146 -
   7.147 -    MIR_mir_window_apply_spec(mir_window->window, spec);
   7.148 -    MIR_mir_window_spec_release(spec);
   7.149 +        MIR_mir_window_apply_spec(mir_window->window, spec);
   7.150 +        MIR_mir_window_spec_release(spec);
   7.151 +    }
   7.152  }
   7.153  
   7.154  void
   7.155  MIR_SetWindowSize(_THIS, SDL_Window* window)
   7.156  {
   7.157 -    MIR_Data*   mir_data   = _this->driverdata;
   7.158 -    MIR_Window* mir_window = window->driverdata;
   7.159 -    MirWindowSpec* spec;
   7.160 -
   7.161 -    if (IsSurfaceValid(mir_window) < 0)
   7.162 -        return;
   7.163 -
   7.164 -    /* You cannot set the x/y of a mir window! So only update w/h */
   7.165 -    spec = MIR_mir_create_window_spec(mir_data->connection);
   7.166 -    MIR_mir_window_spec_set_width (spec, window->w);
   7.167 -    MIR_mir_window_spec_set_height(spec, window->h);
   7.168 -
   7.169 -    MIR_mir_window_apply_spec(mir_window->window, spec);
   7.170 -    MIR_mir_window_spec_release(spec);
   7.171 +    UpdateMirWindowSize(_this->driverdata, window->driverdata, window->w, window->h);
   7.172  }
   7.173  
   7.174  void
   7.175  MIR_SetWindowMinimumSize(_THIS, SDL_Window* window)
   7.176  {
   7.177 -    MIR_Data*   mir_data   = _this->driverdata;
   7.178 -    MIR_Window* mir_window = window->driverdata;
   7.179 -    MirWindowSpec* spec;
   7.180 -
   7.181 -    if (IsSurfaceValid(mir_window) < 0)
   7.182 -        return;
   7.183 -
   7.184 -    spec = MIR_mir_create_window_spec(mir_data->connection);
   7.185 -    MIR_mir_window_spec_set_width (spec, window->min_w);
   7.186 -    MIR_mir_window_spec_set_height(spec, window->min_h);
   7.187 -
   7.188 -    MIR_mir_window_apply_spec(mir_window->window, spec);
   7.189 -    MIR_mir_window_spec_release(spec);
   7.190 +    UpdateMirWindowSize(_this->driverdata, window->driverdata, window->min_w, window->min_h);
   7.191  }
   7.192  
   7.193  void
   7.194  MIR_SetWindowMaximumSize(_THIS, SDL_Window* window)
   7.195  {
   7.196 -    MIR_Data*   mir_data   = _this->driverdata;
   7.197 -    MIR_Window* mir_window = window->driverdata;
   7.198 -    MirWindowSpec* spec;
   7.199 -
   7.200 -    if (IsSurfaceValid(mir_window) < 0)
   7.201 -        return;
   7.202 -
   7.203 -    spec = MIR_mir_create_window_spec(mir_data->connection);
   7.204 -    MIR_mir_window_spec_set_max_width(spec, window->max_w);
   7.205 -    MIR_mir_window_spec_set_max_height(spec, window->max_h);
   7.206 -
   7.207 -    MIR_mir_window_apply_spec(mir_window->window, spec);
   7.208 -    MIR_mir_window_spec_release(spec);
   7.209 +    UpdateMirWindowSize(_this->driverdata, window->driverdata, window->max_w, window->max_h);
   7.210  }
   7.211  
   7.212  void
   7.213 @@ -351,7 +288,7 @@
   7.214      char const* title = window->title ? window->title : "";
   7.215      MirWindowSpec* spec;
   7.216  
   7.217 -    if (IsSurfaceValid(mir_window) < 0)
   7.218 +    if (IsMirWindowValid(mir_window) < 0)
   7.219          return;
   7.220  
   7.221      spec = MIR_mir_create_window_spec(mir_data->connection);
     8.1 --- a/test/configure	Tue Feb 28 19:48:52 2017 -0500
     8.2 +++ b/test/configure	Wed Mar 01 14:50:59 2017 -0800
     8.3 @@ -637,6 +637,7 @@
     8.4  docdir
     8.5  oldincludedir
     8.6  includedir
     8.7 +runstatedir
     8.8  localstatedir
     8.9  sharedstatedir
    8.10  sysconfdir
    8.11 @@ -717,6 +718,7 @@
    8.12  sysconfdir='${prefix}/etc'
    8.13  sharedstatedir='${prefix}/com'
    8.14  localstatedir='${prefix}/var'
    8.15 +runstatedir='${localstatedir}/run'
    8.16  includedir='${prefix}/include'
    8.17  oldincludedir='/usr/include'
    8.18  docdir='${datarootdir}/doc/${PACKAGE}'
    8.19 @@ -969,6 +971,15 @@
    8.20    | -silent | --silent | --silen | --sile | --sil)
    8.21      silent=yes ;;
    8.22  
    8.23 +  -runstatedir | --runstatedir | --runstatedi | --runstated \
    8.24 +  | --runstate | --runstat | --runsta | --runst | --runs \
    8.25 +  | --run | --ru | --r)
    8.26 +    ac_prev=runstatedir ;;
    8.27 +  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
    8.28 +  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
    8.29 +  | --run=* | --ru=* | --r=*)
    8.30 +    runstatedir=$ac_optarg ;;
    8.31 +
    8.32    -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
    8.33      ac_prev=sbindir ;;
    8.34    -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
    8.35 @@ -1106,7 +1117,7 @@
    8.36  for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
    8.37  		datadir sysconfdir sharedstatedir localstatedir includedir \
    8.38  		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
    8.39 -		libdir localedir mandir
    8.40 +		libdir localedir mandir runstatedir
    8.41  do
    8.42    eval ac_val=\$$ac_var
    8.43    # Remove trailing slashes.
    8.44 @@ -1259,6 +1270,7 @@
    8.45    --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
    8.46    --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
    8.47    --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
    8.48 +  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
    8.49    --libdir=DIR            object code libraries [EPREFIX/lib]
    8.50    --includedir=DIR        C header files [PREFIX/include]
    8.51    --oldincludedir=DIR     C header files for non-gcc [/usr/include]