Commit graph

8337 commits

Author SHA1 Message Date
Alfred Reynolds
fd04003739 SDL
- add a new SDL_HINT_MAC_BACKGROUND_APP hint, when set or set to 1 don't force the app to be foreground
2015-07-29 17:19:15 -07:00
Alfred Reynolds
3ca91435d1 Fix up monitor enumeration for Windows 8.1 case. 2015-07-29 17:19:13 -07:00
Alfred Reynolds
ffcd86ba00 Fix SDL_GetWindowPosition to be properly monitor-aware and return the monitor x,y when fullscreened. 2015-07-29 17:19:11 -07:00
Alfred Reynolds
54d9c96cbd Turn on debug info generation for release configs. 2015-07-29 17:19:09 -07:00
Alfred Reynolds
8431c71e2b Move GetDisplayDPI to the end of the file. 2015-07-29 17:19:06 -07:00
Alfred Reynolds
a7866ff147 Fix build. 2015-07-29 17:19:04 -07:00
Alfred Reynolds
9a88ae1678 Add X11 implementation of SDL_GetDisplayDPI. 2015-07-29 17:19:02 -07:00
Alfred Reynolds
e26124316e Add SDL_GetDisplayDPI routine and implement for Windows. 2015-07-29 17:18:56 -07:00
Ryan C. Gordon
70bf81aaec x11: Catch fatal X errors when calling glXMakeCurrent().
In extremely rare cases, probably due to misconfigured drivers, one might
see this happen, and rather than terminate the process, we try to recover
by reporting an error to the app.

Fixes Bugzilla #3068.
2015-07-28 00:12:50 -04:00
Alex Szpakowski
1ddb3c562d iOS: Avoid generating an OpenGL error (but still fail to create the context) if the specified MSAA sample count is unsupported. 2015-07-19 19:56:16 -03:00
Alex Szpakowski
d81533aeed Added MSAA support for OpenGL ES contexts on iOS.
Note that extra steps must be taken when using glReadPixels to read the contents of the main OpenGL ES framebuffer on iOS, if multisampling is used. See the OpenGL ES section of README-ios.md for details.
2015-07-19 19:44:40 -03:00
Ryan C. Gordon
af2a41f99d Fixed dynapi for new SDL_WarpMouseGlobal() function signature. 2015-07-18 00:04:49 -04:00
Ryan C. Gordon
1192b74f69 Patched to compile on Raspberry Pi. 2015-07-18 00:03:34 -04:00
Ryan C. Gordon
0a790ca20c SDL_WarpMouseGlobal() should return non-void.
There are platforms it isn't implemented on (and currently can't be
implemented on!), and there's currently no way for an app to know this.

This shouldn't break ABI on apps that moved to a revision between 2.0.3 and
2.0.4.

--HG--
extra : rebase_source : 289ffe9b7b92eb812f3d1421c52a561d0d37b717
2015-07-17 21:03:58 -04:00
Philipp Wiesemann
b032dd985f Fixed spaces in header file. 2015-07-16 21:48:35 +02:00
Philipp Wiesemann
098d4934ea Windows: Fixed wrong debugger output if logging empty string as info or warning. 2015-07-16 21:31:21 +02:00
Philipp Wiesemann
b7e03d261f Fixed typo in test header file comment. 2015-07-15 21:12:04 +02:00
Philipp Wiesemann
0aa4f76ebd PSP: Fixed error handling in SDL_SemWaitTimeout().
Signed integers were converted to unsigned before being checked if smaller 0.

Found by Cppcheck.
2015-07-15 21:11:24 +02:00
Philipp Wiesemann
8a0443bf99 Fixed comment in test program. 2015-07-15 21:10:38 +02:00
Ryan C. Gordon
1a7d03ff75 X11: center parentless message boxes on the primary display if possible.
This relies on a successful SDL_Init(SDL_INIT_VIDEO) to work, since it's
silly to reproduce all the Xinerama/XRandR code in the message box parts. If
X11 is available but SDL hasn't been initialized, the message box will center
in the primary screen, which will be positioned weirdly on multi-head setups,
but this should fix the most significant common case.
2015-07-14 23:46:35 -04:00
Ryan C. Gordon
aac01f81ad Added test/testdisplayinfo.c 2015-07-14 21:28:26 -04:00
Ryan C. Gordon
19a66a9295 x11: Patched to compile on systems without the Xutf8LookupString() function. 2015-07-11 00:59:56 -04:00
Philipp Wiesemann
633a357db0 Fixed memory leak in test harness.
Found by Cppcheck.
2015-07-06 21:02:20 +02:00
Sam Lantinga
34ada3ba72 Better fix for bug 3048, don't crash if the window title is NULL 2015-07-05 15:45:48 -07:00
David Ludwig
da7dadee1c Fixed bug 3048, "Crashes in Cocoa_SetWindowTitle" 2015-07-04 21:04:49 -04:00
Ryan C. Gordon
e8e6c58c5b Cocoa: support drag-and-drop of multiple objects. 2015-07-04 14:09:09 -04:00
Sam Lantinga
f508c26ce4 Fixed style 2015-07-03 09:18:14 -07:00
Sam Lantinga
103603e7c1 commit a7d7af2a419b453188ffe87386455fc26c1306fa
Author: Benoit Pierre <benoit.pierre@gmail.com>
Date:   Fri Jul 3 02:17:10 2015 +0200

    fix 14dd48ae5bc43b61b2a0dd0b3177d22edec707ef regression

    The window manager detection code in X11_HasWindowManager does not work
    with Awesome (http://awesome.naquadah.org/). Remove it, and reuse the
    result of the more correct checks in X11_CheckWindowManager.
2015-07-03 09:17:24 -07:00
Philipp Wiesemann
cba1bef679 Added missing file to the release archive. 2015-07-02 20:11:40 +02:00
Philipp Wiesemann
b7b9530412 Removed redundant variable check when processing gestures. 2015-07-01 21:10:54 +02:00
Sam Lantinga
6b25782e9e Hack to fix missing window decorations after toggling fullscreen mode in Mac OS X 10.10 2015-06-30 19:30:02 -07:00
Ryan C. Gordon
198218f62e X11: Added a test for a weird X11 error we get with Xinerama, rarely. 2015-06-30 15:00:48 -04:00
Ryan C. Gordon
97c1a0ef23 X11: Call XRefreshKeyboardMapping() when we get various MappingNotify events.
According to the Xlib docs, you need to do this or Xlib's internal state gets
out of sync.
2015-06-30 14:41:17 -04:00
Ryan C. Gordon
1361eae8c4 X11: Don't ignore keyboard mapping changes.
MappingNotify events don't have a window associated with them, so SDL was
dropping these before the point where we would have handled them.
2015-06-30 14:39:39 -04:00
Ryan C. Gordon
50c053a80c Fixed assertion failure in diskaudio target caused by new hotplugging support.
Fixes Bugzilla #3032.

--HG--
extra : rebase_source : aa80f1133f83b9149da70a4840c8600d0dd1c9b1
2015-06-30 13:46:06 -04:00
Sam Lantinga
3039a59198 Fixed bug 2464 - Configure a sdl2-config.cmake.in together with sdl2.pc.in
Leonardo

Despite having a CMakeLists.txt file, SDL2 seems to be mainly built using the autotools system by package-managers. It is nice to have it but it is only useful if you are building SDL2 by yourself.

People that want to use CMake to find their already-installed SDL2 are using a FindSDL2.cmake module based on the old FindSDL.cmake. This is not deprecated but it is discouraged by the CMake devs (see http://www.cmake.org/Bug/view.php?id=14826), as these modules needs maintainers to be included in the official CMake installation.

To fix that, SDL and its accompanying libraries could configure a simple sdl2-config.cmake file, much like it does with sdl2.pc.in. We don't need to configure a full sdl2-config.cmake as in this post, http://forums.libsdl.org/viewtopic.php?t=10068&sid=ccf8abbf0d73fb03ae9cded991e60959 (because it depends on it being built with CMake). Using something as simple as http://www.cmake.org/Wiki/CMake/Tutorials/Packaging#Package_Configuration_Files is deemed enough. Here is another: http://quickgit.kde.org/?p=prison.git&a=blob&f=lib%2Fprison%2FPrisonConfig.cmake.in
2015-06-29 22:24:00 -07:00
Sam Lantinga
af046372c7 Fixed compiling if SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM is not defined 2015-06-25 07:17:08 -07:00
Philipp Wiesemann
fa861eb3cc Mac OS X: Fixed typo in build script comment. 2015-06-26 20:12:10 +02:00
Philipp Wiesemann
c62442af8e Emscripten: Corrected build instructions in documentation.
And fixed a typo.
2015-06-26 20:11:41 +02:00
Sam Lantinga
ff8a1efc51 Fixed bug 2834 - Patch to support dead keys on Windows
Elise Maurer

When inputting text, dead-keys are currently not handled correctly on Windows with the latest SDL2 tip as well as the 2.0.3 release.

Using a French AZERTY keyboard, when I type the `^` key followed by `e` key to compose the `` character, I erroneously get two SDL_TEXTINPUT events, one with the `^` character and one with the `e` character.

I've looked at the history for SDL_windowsevents.c and there's been some back-and-forth with several methods for handling text input:

  * r8142 removed any handling of WM_CHAR because keyboard input was being handled through WM_KEYDOWN along with ToUnicode since r7645.

  * But using ToUnicode actually breaks dead-keys (googling for "ToUnicode dead keys" reports many horror stories of people trying to work around that and failing).

  * It seems like r7645 introduced a double-fix: it fixed WM_CHAR to properly handle Unicode, and also (unnecessarily?) added text input handling to WM_KEYDOWN. Later, r8142 removed the WM_CHAR stuff instead of the WM_KEYDOWN stuff.

The attached patch restores handling of text input through WM_CHAR and removes it from WM_KEYDOWN. I've tested it with French, English and Russian layouts and it seems to do its job. Obviously, with such matters, it's still a risky change.
2015-06-25 11:49:48 -07:00
Sam Lantinga
a499d8068f Fixed whitespace in SDL_evdev.c 2015-06-24 17:55:38 -07:00
Sam Lantinga
649f5f8162 Fixed an issue with mouse/keyboard removal
Sometimes, on removal SDL_EVDEV_udev_callback() gets called with zero udev_class. This in turn seems to be caused the SDL_udev.c:guess_device_class() failing to find the attributes of the parent device.

Apparently this is normal, attributes are not guaranteed to be in place during removal, depending on timing. This lack of attributes causes guess_device_class() to return zero.

This fix mimics the code in linux/SDL_sysjoystick.c:joystick_udev_callback() which effectively has the same fix already in place.
2015-06-24 17:54:39 -07:00
Alfred Reynolds
909e7e1691 SDL
- disable compiling in XAudio2 support. We both need the DX SDK to make this code plus we need to work out the runtime dependency problem this code bring in on windows (needing the DX runtime installed).

CR: SamL
2015-06-24 10:56:51 -07:00
Alfred Reynolds
96e1ee365e SDL
- do the scancode to keyboard code lookup for the grave key, so that we can show users the correct keyface for the key, rather than forcing it to "`".  Note that if a game is using SDLK_* for its KB mapping then after this change on some keyboards the top left key will no longer be mapped correctly with the old data.

CR: SamL
2015-06-24 10:56:37 -07:00
Sam Lantinga
73e7210e2c Fixed bug 3030 - SDL_RecreateWindow fails to restore title, icon, etc.
Adam M.

It loses the title and icon when window recreation fails. For instance, this may happen when trying to create an OpenGL ES window on a system that doesn't support it. But at that point, the title and icon have already been lost.
2015-06-22 23:36:06 -07:00
Ryan C. Gordon
e3f67f4302 Fixed compiler warning about shadowed local variables. 2015-06-23 01:44:44 -04:00
Ryan C. Gordon
a101d1ee7c Updated Mac OS X documentation for fatbuilt.sh -> gcc-fat.sh transition. 2015-06-22 21:30:08 -04:00
Philipp Wiesemann
360ec82b28 Windows: Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 19:37:37 +02:00
Philipp Wiesemann
d4b997d284 Backed out changeset 30a317c4af6c 2015-06-21 19:36:35 +02:00
Philipp Wiesemann
38a1a45a02 Fixed crash if initialization of EGL failed but was tried again later.
The internal function SDL_EGL_LoadLibrary() did not delete and remove a mostly
uninitialized data structure if loading the library first failed. A later try to
use EGL then skipped initialization and assumed it was previously successful
because the data structure now already existed. This led to at least one crash
in the internal function SDL_EGL_ChooseConfig() because a NULL pointer was
dereferenced to make a call to eglBindAPI().
2015-06-21 17:33:46 +02:00