premake/config/SDL_config_linux.template.h
author Sam Lantinga <slouken@libsdl.org>
Sun, 17 Aug 2014 14:57:52 -0700
changeset 9086 c5e33f9a0d03
parent 8991 13b0df1793e8
child 9619 b94b6d0bff0f
permissions -rw-r--r--
Fixed bug 2655 - OSX: Window position and global mouse coord spaces are different

Tim McDaniel

On OSX, with revision 8729, the coordinate space for window position and the coordinate space for global mouse position don't match. For a non-fullscreen window, the window position is global relative to the bottom of the menubar. The global mouse position is relative to the top of the screen. This affects Cocoa_WarpMouse and potentially other things as well. Further, the coordinate system for window position is now affected by what screen it is on. For example, if I have two equal size screens oriented side by side such that the tops of the screens are equal in global space, with the menubar on one screen, and a window straddles the two screens, the window's y position makes no sense. The window's y position depends on what screen "most" of the window is on. So if I move the window horizontally just a bit, the y position of my window is now different by the size of the menubar, even though the window was not moved vertically.

I'd like to reiterate that this was a fairly fundamental change (and a breaking change for us). If SDL OSX is to really support multi-display configurations, this is especially problematic.

If the real concern is preventing windows from going under the menubar, then perhaps a solution involving something like overriding [NSWindow constrainFrameRect] would be less problematic than redefining the global window coord space for the main display.
     1 /* include/SDL_config.h.  Generated from SDL_config.h.in by configure.  */
     2 /*
     3   Simple DirectMedia Layer
     4   Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
     5 
     6   This software is provided 'as-is', without any express or implied
     7   warranty.  In no event will the authors be held liable for any damages
     8   arising from the use of this software.
     9 
    10   Permission is granted to anyone to use this software for any purpose,
    11   including commercial applications, and to alter it and redistribute it
    12   freely, subject to the following restrictions:
    13 
    14   1. The origin of this software must not be misrepresented; you must not
    15      claim that you wrote the original software. If you use this software
    16      in a product, an acknowledgment in the product documentation would be
    17      appreciated but is not required.
    18   2. Altered source versions must be plainly marked as such, and must not be
    19      misrepresented as being the original software.
    20   3. This notice may not be removed or altered from any source distribution.
    21 */
    22 
    23 #ifndef _SDL_config_linux_h
    24 #define _SDL_config_linux_h
    25 
    26 /**
    27  *  \file SDL_config.h.in
    28  *
    29  *  This is a set of defines to configure the SDL features
    30  */
    31 
    32 /* General platform specific identifiers */
    33 #include "SDL_platform.h"
    34 
    35 /* Make sure that this isn't included by Visual C++ */
    36 #ifdef _MSC_VER
    37 #error You should run hg revert SDL_config.h 
    38 #endif
    39 
    40 /* C language features */
    41 /* #undef const */
    42 /* #undef inline */
    43 /* #undef volatile */
    44 
    45 /* C datatypes */
    46 #ifdef __LP64__
    47 #define SIZEOF_VOIDP 8
    48 #else
    49 #define SIZEOF_VOIDP 4
    50 #endif
    51 #define HAVE_GCC_ATOMICS 1
    52 /* #undef HAVE_GCC_SYNC_LOCK_TEST_AND_SET */
    53 
    54 /* Comment this if you want to build without any C library requirements */
    55 #define HAVE_LIBC 1
    56 #if HAVE_LIBC
    57 
    58 /* Useful headers */
    59 #define HAVE_ALLOCA_H 1
    60 #define HAVE_SYS_TYPES_H 1
    61 #define HAVE_STDIO_H 1
    62 #define STDC_HEADERS 1
    63 #define HAVE_STDLIB_H 1
    64 #define HAVE_STDARG_H 1
    65 #define HAVE_MALLOC_H 1
    66 #define HAVE_MEMORY_H 1
    67 #define HAVE_STRING_H 1
    68 #define HAVE_STRINGS_H 1
    69 #define HAVE_INTTYPES_H 1
    70 #define HAVE_STDINT_H 1
    71 #define HAVE_CTYPE_H 1
    72 #define HAVE_MATH_H 1
    73 #define HAVE_ICONV_H 1
    74 #define HAVE_SIGNAL_H 1
    75 /* #undef HAVE_ALTIVEC_H */
    76 /* #undef HAVE_PTHREAD_NP_H */
    77 /* #undef HAVE_LIBUDEV_H */
    78 #define HAVE_DBUS_DBUS_H 1
    79 
    80 /* C library functions */
    81 #define HAVE_MALLOC 1
    82 #define HAVE_CALLOC 1
    83 #define HAVE_REALLOC 1
    84 #define HAVE_FREE 1
    85 #define HAVE_ALLOCA 1
    86 #ifndef __WIN32__ /* Don't use C runtime versions of these on Windows */
    87 #define HAVE_GETENV 1
    88 #define HAVE_SETENV 1
    89 #define HAVE_PUTENV 1
    90 #define HAVE_UNSETENV 1
    91 #endif
    92 #define HAVE_QSORT 1
    93 #define HAVE_ABS 1
    94 #define HAVE_BCOPY 1
    95 #define HAVE_MEMSET 1
    96 #define HAVE_MEMCPY 1
    97 #define HAVE_MEMMOVE 1
    98 #define HAVE_MEMCMP 1
    99 #define HAVE_STRLEN 1
   100 /* #undef HAVE_STRLCPY */
   101 /* #undef HAVE_STRLCAT */
   102 #define HAVE_STRDUP 1
   103 /* #undef HAVE__STRREV */
   104 /* #undef HAVE__STRUPR */
   105 /* #undef HAVE__STRLWR */
   106 /* #undef HAVE_INDEX */
   107 /* #undef HAVE_RINDEX */
   108 #define HAVE_STRCHR 1
   109 #define HAVE_STRRCHR 1
   110 #define HAVE_STRSTR 1
   111 /* #undef HAVE_ITOA */
   112 /* #undef HAVE__LTOA */
   113 /* #undef HAVE__UITOA */
   114 /* #undef HAVE__ULTOA */
   115 #define HAVE_STRTOL 1
   116 #define HAVE_STRTOUL 1
   117 /* #undef HAVE__I64TOA */
   118 /* #undef HAVE__UI64TOA */
   119 #define HAVE_STRTOLL 1
   120 #define HAVE_STRTOULL 1
   121 #define HAVE_STRTOD 1
   122 #define HAVE_ATOI 1
   123 #define HAVE_ATOF 1
   124 #define HAVE_STRCMP 1
   125 #define HAVE_STRNCMP 1
   126 /* #undef HAVE__STRICMP */
   127 #define HAVE_STRCASECMP 1
   128 /* #undef HAVE__STRNICMP */
   129 #define HAVE_STRNCASECMP 1
   130 #define HAVE_VSSCANF 1
   131 #define HAVE_VSNPRINTF 1
   132 #define HAVE_M_PI /**/
   133 #define HAVE_ATAN 1
   134 #define HAVE_ATAN2 1
   135 #define HAVE_CEIL 1
   136 #define HAVE_COPYSIGN 1
   137 #define HAVE_COS 1
   138 #define HAVE_COSF 1
   139 #define HAVE_FABS 1
   140 #define HAVE_FLOOR 1
   141 #define HAVE_LOG 1
   142 #define HAVE_POW 1
   143 #define HAVE_SCALBN 1
   144 #define HAVE_SIN 1
   145 #define HAVE_SINF 1
   146 #define HAVE_SQRT 1
   147 #define HAVE_FSEEKO 1
   148 #define HAVE_FSEEKO64 1
   149 #define HAVE_SIGACTION 1
   150 #define HAVE_SA_SIGACTION 1
   151 #define HAVE_SETJMP 1
   152 #define HAVE_NANOSLEEP 1
   153 #define HAVE_SYSCONF 1
   154 /* #undef HAVE_SYSCTLBYNAME */
   155 #define HAVE_CLOCK_GETTIME 1
   156 /* #undef HAVE_GETPAGESIZE */
   157 #define HAVE_MPROTECT 1
   158 #define HAVE_ICONV 1
   159 #define HAVE_PTHREAD_SETNAME_NP 1
   160 /* #undef HAVE_PTHREAD_SET_NAME_NP */
   161 #define HAVE_SEM_TIMEDWAIT 1
   162 
   163 #else
   164 #define HAVE_STDARG_H 1
   165 #define HAVE_STDDEF_H 1
   166 #define HAVE_STDINT_H 1
   167 #endif /* HAVE_LIBC */
   168 
   169 /* SDL internal assertion support */
   170 /* #undef SDL_DEFAULT_ASSERT_LEVEL */
   171 
   172 /* Paste generated code here */
   173 
   174 /* Enable assembly routines */
   175 #define SDL_ASSEMBLY_ROUTINES 1
   176 /* #undef SDL_ALTIVEC_BLITTERS */
   177 
   178 #endif /* _SDL_config_h */