Commit Graph

3399 Commits

Author SHA1 Message Date
Philipp Wiesemann
850185f401 Fixed crash if creating textures failed in testshape program. 2017-06-02 22:15:23 +02:00
Philipp Wiesemann
00394996eb Fixed crash if calling SDL_CreateShapedWindow() on unsupported platforms. 2017-06-02 22:15:12 +02:00
Bastien Bouclet
545fba7886 x11: Don't send duplicate events when reconciling the keyboard state
Failing to check if a key was known to be pressed by SDL was causing
SDL_SendKeyboardKey to send duplicate key pressed events with the repeat
property set to true.

Fixes Bugzilla #3637.
2017-04-22 19:53:52 +02:00
Ryan C. Gordon
5dc350133f test: Makefile.in should copy bitmap and wave files to build directory.
I've lost count of the times I've forgotten to do this manually and wondered
why loopwave can't open sample.wav.  :)
2017-05-29 18:24:06 -04:00
Ryan C. Gordon
b135557df9 linux: Don't crash if fcitx support is requested but unavailable.
Fixes Bugzilla #3642.
2017-05-29 02:48:51 -04:00
Ryan C. Gordon
29a047df39 Fixed whitespace code style. 2017-05-29 00:51:38 -04:00
Ryan C. Gordon
1c5f483a8a linux: removed IBus_utf8_strlen(), use SDL_utf8strlen() instead. 2017-05-29 00:51:02 -04:00
Ryan C. Gordon
a1faea980c fcitx: removed incompatibly-licensed code. 2017-05-29 00:54:08 -04:00
Ryan C. Gordon
d4086e4a70 stdlib: added SDL_utf8strlen(). 2017-05-29 03:01:05 -04:00
Philipp Wiesemann
fc510bd798 nacl: Fixed crash if allocating memory for audio device failed. 2017-05-28 21:50:47 +02:00
Philipp Wiesemann
7c5078d8bd qnx: Removed unnecessary check for available audio devices. 2017-05-28 21:50:37 +02:00
Philipp Wiesemann
1e60ea76db qnx: Removed unnecessary call to SDL_zerop() after SDL_calloc(). 2017-05-28 21:50:27 +02:00
Philipp Wiesemann
1b9dc59918 haiku: Fixed SDL_SetClipboardText() putting random data in clipboard. 2017-05-28 21:50:11 +02:00
Ryan C. Gordon
de52dc2948 haiku: Correctly set keyboard focus (thanks, Kai!).
The message sent upon the window being activated or deactivated, to trigger
the call to SDL_SetKeyboardFocus was missing a mandatory parameter. So
keyboard focus was never properly set.

Fixes Bugzilla #3658.
2017-05-28 15:36:09 -04:00
Ryan C. Gordon
643f1cb73d power: Add Linux org.freedesktop.UPower D-Bus implementation.
Fixes Bugzilla #3485.

(I think.)
2017-05-28 07:14:11 -04:00
Ryan C. Gordon
b3f94acbf9 linux: Simplify D-Bus interface, remove lots of boilerplate. 2017-05-28 07:11:52 -04:00
Ryan C. Gordon
191f578b57 linux: Make system D-Bus connection available (in addition to session). 2017-05-28 07:08:10 -04:00
Ryan C. Gordon
e5918acf46 wasapi: properly report init failure if on pre-Vista version of Windows.
We really should change the Init interface to return 0 on success and -1 on
error, like everything else, to avoid this sort of confusion.
2017-05-28 00:41:55 -04:00
Philipp Wiesemann
604a4b1b30 haiku: Fixed SDL_SetClipboardText() allocating too much memory and cutting text.
It allocated pointers instead of chars and passed a wrong size to SDL_strlcpy().
2017-05-27 23:30:21 +02:00
Philipp Wiesemann
3639895eac Removed unused errno includes. 2017-05-27 23:30:07 +02:00
Ryan C. Gordon
6fbde875e2 code style: wrap a single-statement if in braces. 2017-05-27 00:33:26 -04:00
Ryan C. Gordon
3fbd21ce40 windows: msgboxes should specify a parent HWND if possible (thanks, Ismael!).
This lets them be properly modal.

Fixes Bugzilla #3650.
2017-05-27 00:30:06 -04:00
Philipp Wiesemann
90ed3daa3e Changed messages about not recognized keys to include discourse link. 2017-05-26 22:45:52 +02:00
Philipp Wiesemann
759319729c emscripten: Fixed compiling on C89 compilers. 2017-05-26 22:45:40 +02:00
Philipp Wiesemann
b84fe2c06b ios: Fixed math include in demos. 2017-05-25 23:01:59 +02:00
Philipp Wiesemann
1e13d93fea directfb: Changed internal function to be static. 2017-05-25 23:01:34 +02:00
Philipp Wiesemann
189b5851b7 android: Fixed parameter list in function definitions. 2017-05-25 23:01:16 +02:00
Philipp Wiesemann
6c0aea4270 wayland: Fixed freeing memory of SDL_malloc() with plain free(). 2017-05-25 23:00:58 +02:00
Philipp Wiesemann
c66f0471e1 Removed unused internal window shape functions. 2017-05-25 23:00:43 +02:00
Ryan C. Gordon
a7fc2822d4 audio: rename bsd target to netbsd.
Apparently this is no longer a generic BSD audio target, and hasn't been for
years, so rename it for NetBSD.
2017-05-24 19:56:59 -04:00
Ryan C. Gordon
6844d92c23 coreaudio: we don't need to track number of allocated audio buffers anymore.
CoreAudio takes care of iterating through the buffers and freeing them now,
so we don't have to manage this ourselves.
2017-05-24 13:28:13 -04:00
Ryan C. Gordon
fc4402e5ff coreaudio: Better handling of audio buffer queue management.
We don't fill buffers just to throw them away during shutdown now, we let the
AudioQueue free its own buffers during disposal (which fixes possible warnings
getting printed to stderr by CoreAudio), and we stop the queue after running
any queued audio during shutdown, which prevents dropping the end of the
audio playback if you opened the device with an enormous sample buffer.

Fixes Bugzilla #3555.
2017-05-24 13:25:31 -04:00
Charlie Birks
126e5a1dbf Emscripten: Prevent default on arrow keys 2017-05-24 14:04:39 +01:00
Patrick Monaghan
f839b209b9 Emscripten: fixed incorrect conversion of touch motion events to mouse motion events 2017-05-24 14:04:25 +01:00
Ryan C. Gordon
3fd35f6bb0 coreaudio: looks like we need more like a 10ms buffer minimum, not 50ms. 2017-05-24 01:28:03 -04:00
Ryan C. Gordon
793c788b1c coreaudio: dynamically allocate AudioQueueBuffers.
We need more than two buffers to flip between if they are small, or CoreAudio
won't make any sound; apparently it needs X milliseconds of audio queued when
it needs to play more or it drops any queued buffers. We are currently
guessing 50 milliseconds as a minimum, but there's probably a more proper
way to get the minimum time period from the system.

Fixes Bugzilla #3656.
2017-05-24 00:12:22 -04:00
Philipp Wiesemann
088f57a62a Removed unnecessary call to free() in testoverlay2 program. 2017-05-20 23:30:47 +02:00
Philipp Wiesemann
fa3944ba39 Removed unused signal includes and handler in test programs. 2017-05-20 23:30:32 +02:00
Philipp Wiesemann
bf8ccf08bb Removed redundant mouse clean up on quit for some platforms.
SDL_MouseQuit() already frees cursors and sets fields to NULL.
2017-05-19 23:30:59 +02:00
Ryan C. Gordon
a9c7bc85f1 android: add screenSize to AndroidManifest's configChanges (thanks, Daniel!).
Fixes Bugzilla #3448.

"Starting with Android API 13, another configuration change must be declared
to be handled by the app if it is desired to not let the system handle
rotation itself:

https://developer.android.com/guide/topics/resources/runtime-changes.html#HandlingTheChange

This will have effect if either a developer or SDL per default will set target
API > 12. Currently it is set to 12, but this might change in the future, like
when applying this patch: https://bugzilla.libsdl.org/show_bug.cgi?id=3445

The effect of not having this change applied is that the SDL app is destroyed
upon rotation. Even when the manifest has an additional entry to e.g. always
stay in landscape mode, the onDestroy() call will happen on devices that are
portrait per default, when switching off screen due to power save. The device
will then (at least try to) rotate into portrait to show the portrait screen
lock after resume.

I believe it is safe to apply this patch even with target API still set to 12,
the additional parameter is simply ignored."
2017-05-19 15:06:05 -04:00
Ryan C. Gordon
e889757bb3 assert: Better Emscripten support.
(Better than nothing, that is.)

Fixes Bugzilla #3459.
2017-05-19 14:51:03 -04:00
Ryan C. Gordon
d6f418641d assert: Check for Clang _and_ GCC, in case they ever drop compatibility. 2017-05-19 14:49:16 -04:00
Ryan C. Gordon
8917f8634d assert: allow assertions to work on platforms without threads.
Partially fixes Bugzilla #3459.
2017-05-19 12:54:17 -04:00
Ryan C. Gordon
91e6054b03 wasapi: don't mark capture devices as failed for AUDCLNT_S_BUFFER_EMPTY.
Fixes Bugzilla #3633.
2017-05-19 12:40:55 -04:00
Ryan C. Gordon
02773811b3 render: GL_DestroyRender() should activate first.
Otherwise, we might destroy a different GL context's resources.
2017-05-18 21:00:11 -04:00
Ryan C. Gordon
cff9e5a876 test: info now reports usable display bounds and DPI (thanks, Eric!).
Fixes Bugzilla #3652.
2017-05-18 16:29:10 -04:00
Ryan C. Gordon
81ab6c98fd Patched to compile on Windows. 2017-05-18 16:27:36 -04:00
Ryan C. Gordon
13b6d9959a wasapi: Replace tabs with strings in source code. 2017-05-18 15:46:06 -04:00
Ryan C. Gordon
adabc38439 wasapi: Deal with AUDCLNT_S_BUFFER_EMPTY when flushing audio device. 2017-05-18 15:43:51 -04:00
Ryan C. Gordon
4073a6694f audio: One more callbackspec fix (thanks, Simon!). 2017-05-18 15:33:17 -04:00