Commit Graph

13835 Commits (43571769f16b45ddcb9d7dd1d4c6e21cd39e691e)

Author SHA1 Message Date
Ryan C. Gordon 20ec137763 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 acdb494ffd 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 4986563d2f Fixed assertion failure in diskaudio target caused by new hotplugging support.
Fixes Bugzilla #3032.
2015-06-30 13:46:06 -04:00
Sam Lantinga bf9bd59c01 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 f1b7a8434f Fixed compiling if SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM is not defined 2015-06-25 07:17:08 -07:00
Philipp Wiesemann c5857ab498 Mac OS X: Fixed typo in build script comment. 2015-06-26 20:12:10 +02:00
Philipp Wiesemann 9b6f159c3d Emscripten: Corrected build instructions in documentation.
And fixed a typo.
2015-06-26 20:11:41 +02:00
Sam Lantinga 3a08b46336 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 82eec4b630 Fixed whitespace in SDL_evdev.c 2015-06-24 17:55:38 -07:00
Sam Lantinga 9f50d63dd5 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 cbbdd27ad3 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 e4e4e1b82a 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 b7aa856c8f 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 ded3a16e72 Fixed compiler warning about shadowed local variables. 2015-06-23 01:44:44 -04:00
Ryan C. Gordon 437a6d9da9 Updated Mac OS X documentation for fatbuilt.sh -> gcc-fat.sh transition. 2015-06-22 21:30:08 -04:00
Philipp Wiesemann 8cea1b986e Windows: Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 19:37:37 +02:00
Philipp Wiesemann 72590685c0 Backed out changeset 4ad56dbf4a6f 2015-06-21 19:36:35 +02:00
Philipp Wiesemann 0e45984fa0 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
Eric Wing 7d5147bad3 resync'd overscan patch with SDL mainline. 2015-04-17 21:25:19 -07:00
Philipp Wiesemann 5a578a0783 Fixed return value of SDL_SaveBMP_RW() depending on set errors after NULL input.
If SDL_SaveBMP_RW() was called with NULL passed as SDL_RWops argument, different
values were returned depending on SDL_GetError(). If no error was set before the
call (or SDL_ClearError() was called) then 0 was returned. This is wrong because
nothing was saved. If an error was set before the call then -1 was returned.

This was fixed by directly returning -1 for NULL input instead of deciding based
on SDL_GetError(). No new error is set because this would otherwise override a
maybe more useful error set in SDL_RWFromFile() which is used by SDL_SaveBMP().
2015-04-16 22:04:35 +02:00
Philipp Wiesemann db878a4336 Linux: Removed not needed platform info from two entries of controller database.
Not needed because entries of this file are selected by conditional compilation.
2015-04-16 22:02:03 +02:00
Philipp Wiesemann 3e1d36299a Fixed typo in internal joystick documentation comments. 2015-04-15 21:29:55 +02:00
Philipp Wiesemann e6b7b38c6c Emscripten: Simplified implementation of joystick update function.
The function was implemented using four loops but only needed two.
2015-04-15 21:27:10 +02:00
Philipp Wiesemann 86fb92a7da Emscripten: Fixed memory leak if SDL_GetPrefPath() failed. 2015-04-15 21:25:15 +02:00
Philipp Wiesemann e97fc56209 Android: Fixed lint warning about order of elements in AndroidManifest.xml. 2015-04-13 20:52:38 +02:00
Philipp Wiesemann 0fbd3372d4 WinRT: Fixed format string for error message. 2015-04-13 20:52:18 +02:00
Ryan C. Gordon 3a0270593e Patched to compile on C89 compilers. 2015-04-12 21:02:21 -04:00
Ryan C. Gordon c539b3f9e9 Make X11 and Wayland ProcessHitTest() code less verbose. 2015-04-12 20:59:48 -04:00
Ryan C. Gordon d10201be08 Implemented SetWindowHitTest() for Wayland (thanks, x414e54!).
Fixes Bugzilla #2941.
2015-04-12 20:40:06 -04:00
Ryan C. Gordon c6538cb977 Merged. 2015-04-12 20:28:28 -04:00
Alex Szpakowski a27fad1e24 Fixed orientation issues in the iOS extended launch screen. 2015-04-12 01:50:28 -03:00
Rohit Nirmal cf6b9752f9 Ignore some more test binaries. 2015-04-10 22:31:52 -05:00
Philipp Wiesemann 26b4898ac2 Windows: Fixed format string for error message. 2015-04-11 20:43:11 +02:00
Philipp Wiesemann 56c82bc828 Mac: Fixed typo in two error messages. 2015-04-11 20:41:49 +02:00
Ryan C. Gordon 1a73b4eba2 Some Raspberry Pi build fixes (including Raspberry Pi 2 support).
Fixes Bugzilla #2879.
2015-04-11 05:58:37 +00:00
Alex Szpakowski fe6c797cad Fixed an iOS view orientation issue when SDL_GL_CreateContext or SDL_CreateRenderer is called. 2015-04-10 23:30:31 -03:00
Ryan C. Gordon 6ae7a20647 Placate static analysis with an assertion. 2015-04-10 21:40:50 -04:00
Ryan C. Gordon 2afa4aeda8 Fixed memory leak in failure case that static analysis found. 2015-04-10 21:15:51 -04:00
Philipp Wiesemann 7bd7221997 PSP: Removed empty statement. 2015-04-10 23:45:13 +02:00
Philipp Wiesemann ce2d5f70e4 Wayland: Removed empty statement. 2015-04-10 23:44:55 +02:00
Ryan C. Gordon 562414c74c Merged Alex Szpakowski's iOS-improvement branch to default.
Fixes Bugzilla #2798.
Fixes Bugzilla #2212.
Fixes Bugzilla #2826.
Fixes Bugzilla #2661.
Fixes Bugzilla #1885.
Fixes Bugzilla #1578.
Fixes Bugzilla #2751.

(whew!)

Notable changes, from Alex's notes:

- The SDL_WINDOW_ALLOW_HIGHDPI flag is now needed (along with SDL_GL_GetDrawableSize or SDL_GetRendererOutputSize) to use Retina / high DPI resolutions, bringing SDL?s Retina-related behavior on iOS in line with Mac OS X. Window dimensions and display modes are now in the ?points? (non-high DPI) coordinate system rather than pixels, whereas SDL_GL_GetDrawableSize is in pixels.

- Reworked the custom extended launch screen code:
	- It now hides after the first SDL_PumpEvents call rather than SDL_CreateWindow, and it fades out in a similar manner to the system launch screen behavior.
	- It now mirrors the system launch screen behavior when deciding which image to display: it falls back to using the Launch Images dictionary in Info.plist if the iOS 8+ launch screen nib isn?t available, and if the Launch Images dictionary doesn?t exist it uses the old standard launch image names.
	- The extended launch screen can now be disabled via the SDL_IPHONE_LAUNCHSCREEN define in SDL_config_iphoneos.h.

- Added support for SDL_HINT_ACCELEROMETER_AS_JOYSTICK.

- Added access to a window view's renderbuffer and framebuffer to syswm.

- Added OpenGL ES debug labels for the Renderbuffer and Framebuffer Objects created with SDL_GL_CreateContext.

- Added support for sRGB OpenGL ES contexts on iOS 7+.

- Updated OpenGL ES contexts to support native-resolution rendering (when SDL_WINDOW_ALLOW_HIGHDPI is enabled) on the iPhone 6 Plus, i.e. 1080x1920 rather than 1242x2208.

- Updated SDL_GL_CreateContext, SDL_GL_SwapWindow, SDL_GL_MakeCurrent, and SDL_GL_DeleteContext to be more robust.

- Updated SDL windows to display a UIView at all times, even when an OpenGL context is not active. This allows rotation, touch events, and other windowing-related events to work properly without an active OpenGL context. It also makes it easier to use SDL_GetWindowWMInfo after creating a SDL window.

- Updated the iOS-specific Objective-C code to use cleaner and more modern language features and APIs, including ARC instead of manual reference counting.

- Updated SDL_HINT_ORIENTATIONS to allow disabling custom orientations if the hint is set with no valid orientation names.

- Fixed several rotation and orientation bugs with windows and display modes, especially in iOS 8+.

- Fixed SDL_SetWindowFullscreen failing to update the status bar visibility on iOS 7+.

- Fixed the orientation of the offset applied to the window?s view when the onscreen keyboard is shown in iOS 8+.

- Fixed SDL_IsScreenKeyboardShown (patch by Phil Hassey.)

- Fixed several major memory leaks caused by missing autorelease pool blocks in the iOS-specific Objective-C code.

- Removed several dead code paths.

- The iOS 7 SDK (Xcode 5) or newer is now required to build SDL for iOS.
2015-04-09 22:28:37 -04:00
Alex Szpakowski c4035654a9 Added framebuffer and colorbuffer members to the uikit portion of the SDL_SysWMinfo struct, removed SDL_iOSGetViewRenderbuffer and SDL_iOSGetViewFramebuffer. 2015-04-09 19:28:00 -03:00
Philipp Wiesemann 67549d3320 Backed out changeset 064a1998a957 2015-04-09 22:14:05 +02:00
Philipp Wiesemann f87963488b Wayland: Fixed not freeing memory if initialization failed. 2015-04-09 21:13:41 +02:00
Philipp Wiesemann dc33fb942d Wayland: Fixed accessing not fully initialized subsystem if errors happened.
The VideoInit() implementation returned 0 on errors instead of -1.
2015-04-09 21:13:20 +02:00
Philipp Wiesemann 8a573844c9 Wayland: Fixed accessing not fully initialized window if no memory available.
The CreateWindow() implementation returned 0 on no more memory instead of -1.
2015-04-09 21:11:43 +02:00
Philipp Wiesemann 049ef9a35b Android: Fixed calling a getter method twice. 2015-04-08 22:24:33 +02:00
Philipp Wiesemann 458b94da5f Android: Fixed creating mouse coordinates which are not needed if hint is set. 2015-04-08 22:18:10 +02:00
Philipp Wiesemann b473d30f19 Android: Fixed not resetting mouse pointer state if hint was changed at runtime. 2015-04-08 22:15:25 +02:00
Alex Szpakowski fcd0f06a88 Renamed SDL_iPhoneGetViewFramebuffer/Renderbuffer to SDL_iOSGetViewFramebuffer/Renderbuffer. Added #defines for SDL_iOSSetAnimationCallback and SDL_iOSSetEventPump, which point to SDL_iPhoneSetAnimationCallback and SDL_iPhoneSetEventPump. 2015-04-08 15:59:29 -03:00