Commit graph

9645 commits

Author SHA1 Message Date
Sam Lantinga
a4a9743a98 Fixed bug 3688 - cmake / pthread check related patch proposal
Juha Niemimäki

Fix for PTHREAD_MUTEX_RECURSIVE_NP check and restoring the original flags

Two fixes proposed:

1) Looks like there is a copy-paste issue regarding PTHREAD_MUTEX_RECURSIVE_NP check.

2) Compiler flag restoration doesn't look symmetrical regarding if/endif blocks. Moved to an outer block (if PTHREADS).
2017-07-10 18:40:35 -07:00
Sam Lantinga
396a81c053 Fixed bug 3609 - Windows build fails due to conflicting types for 'XINPUT_GAMEPAD_EX'
Ozkan Sezer

(In reply to Ryan C. Gordon from comment #9)
> I've put this patch in as https://hg.libsdl.org/SDL/rev/117d4ce1390e ...can
> you verify this works on the latest MinGW?
>
> Thanks,
> --ryan.


This patch is wrong: the structure in question has nothing to do with any
gcc version in use.  I suggest reverting this adding a conigury check for
it, instead.  Something like the following should do it: (configure needs
regenerating.)
2017-07-10 18:31:28 -07:00
Sam Lantinga
9df90cd84b Fixed bug 3696 - SDL_ShowMessageBox displays different error from intended
Mark Callow

SDL_ShowMessageBox calls SDL_CaptureMouse which, in the UIKit driver, raises a “That operation is not supported” error, overwriting the SDL error that an application may be trying to report.

This is because UIKit SDL_CaptureMouse returns SDL_Unsupported() which ends up calling SDL_SetError() which has the following code:

    /* If we are in debug mode, print out an error message */
    SDL_LogDebug(SDL_LOG_CATEGORY_ERROR, "%s", SDL_GetError());

The SDL_GetError call here overwrites the static buffer…..

Although an application can avoid this by using SDL_GetErrorMsg(char* errstr,  int maxlen) to avoid the static buffer, SDL should be fixed.

The fix is simple. In SDL_SetError change

    SDL_LogDebug(SDL_LOG_CATEGORY_ERROR, "%s", SDL_GetError());

to

    SDL_LogDebug(SDL_LOG_CATEGORY_ERROR, "%s", error);

where error is the pointer to the buffer where it assembled the message.
2017-07-10 17:16:12 -07:00
Sam Lantinga
0eef8c07fb Fixed bug 3697 - Main thread gets stuck on left mouse down
Amruth Raj

- My app runs in full screen to play video(I use SDL_WINDOW_FULLSCREEN_DESKTOP)
- Cmd-tab to go out of full screen to another app
- Cmd-tab again to get back to my app
- Press left mouse button at one of the edges of the screen, don't release yet.
After this point the main thread is stuck until I release the left mouse button and hence video rendering doesn't happen anymore.

On debugging more, I see that thread 0 is stuck as shown below with sendEvent processing left mouse down. It comes out only after it receives a left mouse up. There are some frames below which show NSWindowResizing, but my window flag doesn't have SDL_WINDOW_RESIZABLE set.

Thread 0:: CrBrowserMain Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fffbe13d34a mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fffbe13c797 mach_msg + 55
2 com.apple.CoreFoundation 0x00007fffa889d434 __CFRunLoopServiceMachPort + 212
3 com.apple.CoreFoundation 0x00007fffa889c8c1 __CFRunLoopRun + 1361
4 com.apple.CoreFoundation 0x00007fffa889c114 CFRunLoopRunSpecific + 420
5 com.apple.HIToolbox 0x00007fffa7dfdebc RunCurrentEventLoopInMode + 240
6 com.apple.HIToolbox 0x00007fffa7dfdcf1 ReceiveNextEventCommon + 432
7 com.apple.HIToolbox 0x00007fffa7dfdb26 _BlockUntilNextEventMatchingListInModeWithFilter + 71
8 com.apple.AppKit 0x00007fffa6396a54 _DPSNextEvent + 1120
9 com.apple.AppKit 0x00007fffa6b127ee -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 2796
10 com.apple.AppKit 0x00007fffa66f568d +[NSWindow(NSWindowResizing) _mouseHysteresisCheck:withExpiration:andDistance:finalMouseLocation:] + 525
11 com.apple.AppKit 0x00007fffa65eedb5 -[NSWindow(NSWindowResizing) _hitTestWithHysteresisCheck:forEvent:allowWindowDragging:] + 394
12 com.apple.AppKit 0x00007fffa6c8f0db -[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] + 1873
13 com.apple.AppKit 0x00007fffa6c8ca6c -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 1942
14 com.apple.AppKit 0x00007fffa6c8bf0a -[NSWindow(NSEventRouting) sendEvent:] + 541
15 org.libsdl.SDL2 0x000000010d46d74a -[SDLWindow sendEvent:] + 90
16 com.apple.AppKit 0x00007fffa6b10681 -[NSApplication(NSEvent) sendEvent:] + 1145
17 org.libsdl.SDL2 0x000000010d46532b -[SDLApplication sendEvent:] + 139
18 org.libsdl.SDL2 0x000000010d466b2f Cocoa_PumpEvents + 495
19 org.libsdl.SDL2 0x000000010d44c1d5 SDL_PumpEvents_REAL + 53
20 org.libsdl.SDL2 0x000000010d44c2f5 SDL_WaitEventTimeout_REAL + 53
21 org.libsdl.SDL2 0x000000010d44c2b7 SDL_PollEvent_REAL + 23
22 org.libsdl.SDL2 0x000000010d51bb24 SDL_PollEvent + 36
23 libTest.dylib 0x000000010cf3e0e8 SDLEventProcessor::processEvents(int) + 568
24 Test 0x000000010cde6bba BrowserApp::RunAppMessageLoop(BAInstData*, CefStringBase, CefStringBase) + 810
25 Test 0x000000010ce04bbc main + 17980
26 libdyld.dylib 0x00007fffbe016235 start + 1

I further noticed that while entering full screen in SDL_cocoawindow.m NSResizableWindowMask is set. If I clear it inside windowDidEnterFullScreen, then, the issue doesn't repro.

This is discussed at https://discourse.libsdl.org/t/main-thread-gets-stuck-on-left-mouse-down/22753/3 and thanks to Eric for the pointers.
2017-07-10 17:07:19 -07:00
Sam Lantinga
5d57381107 Updated Visual Studio 2008 project 2017-07-10 15:55:13 -07:00
Philipp Wiesemann
62b378d322 Updated generated configure script. 2017-07-09 23:00:43 +02:00
Philipp Wiesemann
c8245961bc Fixed typo in log message in testime program. 2017-07-09 23:00:35 +02:00
Philipp Wiesemann
4e6f38a43b Fixed compiler warning about redundant declaration.
SDL_RecordGesture() is already in the gesture header with additional specifiers.
2017-07-09 23:00:25 +02:00
Philipp Wiesemann
68bbfeaf55 Fixed missing audio entries in configure summary. 2017-07-07 23:00:47 +02:00
Philipp Wiesemann
10cf50a315 haiku: Fixed compiling without OpenGL support. 2017-07-07 23:00:22 +02:00
Philipp Wiesemann
9abd5d5785 qnx: Fixed setting a field twice. 2017-07-07 23:00:10 +02:00
Ryan C. Gordon
a40e02b690 audio: trying to pacify static analysis. 2017-07-05 12:04:37 -04:00
Ryan C. Gordon
ab5678844c x11: pass a long to XChangeProperty, not an int.
The Xlib documentation demands that 32-bit values here be passed in a long,
even when long itself isn't a 32-bit value. Otherwise libx11 might read
memory incorrectly.

Fixes Bugzilla #3692.
2017-07-04 20:44:07 -04:00
Ryan C. Gordon
f5d0d8363e power: whoops, that should be "==" not "!=". 2017-07-03 16:45:12 -04:00
Ryan C. Gordon
ecb0c96305 power: Linux /sys/class testing should skip "device" scopes.
(the PS4 game controllers report their batteries through this interface, which
is cool, but not helpful for powering the rest of the system.  :)   )

--HG--
extra : rebase_source : 7cdf3dcc31596180113fa7b973b5a64ec94fdb62
2017-07-03 16:38:37 -04:00
Philipp Wiesemann
a3d91f447b aix: Fixed audio debug output.
DEBUG_AUDIO is checked with #ifdef not #if.
2017-07-02 22:46:49 +02:00
Philipp Wiesemann
5ad39d7303 haiku: Fixed using wrong constant for internal error handling.
SDL_CreateWindow() worked because ENOMEM is negative on Haiku.
2017-07-02 22:46:23 +02:00
Philipp Wiesemann
8394c102dc qnx: Removed unused bootstrap declaration.
QNX_bootstrap is the VideoBootStrap. QSAAUDIO_bootstrap is still there.
2017-07-02 22:46:00 +02:00
Philipp Wiesemann
cc2d4b5582 qnx: Fixed configure script setting wrong variable. 2017-07-02 22:45:31 +02:00
Ryan C. Gordon
8afa42a3b8 qnx: fixed potential buffer overflow. 2017-07-01 19:52:12 -04:00
Ryan C. Gordon
14c4ea3981 Support for QNX 7.0 (thanks, Elad!).
Fixes Bugzilla #3686.
2017-07-01 17:50:47 -04:00
Philipp Wiesemann
35b983c052 haiku: Fixed memory leak if destroying window. 2017-07-01 23:01:57 +02:00
Philipp Wiesemann
ea2b8b379f aix: Fixed compile error. 2017-07-01 23:01:49 +02:00
Philipp Wiesemann
db60eff521 netbsd: Fixed comment. 2017-07-01 23:00:07 +02:00
Philipp Wiesemann
2ff012ab3d netbsd: Removed unused field. 2017-06-29 23:00:18 +02:00
Philipp Wiesemann
22ab12da37 netbsd: Fixed compile error. 2017-06-29 23:00:09 +02:00
Philipp Wiesemann
7941386b35 winrt: Fixed SDL include. 2017-06-24 23:45:44 +02:00
Philipp Wiesemann
4fc0c3bc05 raspberrypi: Fixed typos in README. 2017-06-24 23:45:34 +02:00
Philipp Wiesemann
ca30563db8 Fixed handling only one event per frame in testshape program. 2017-06-24 23:45:19 +02:00
Ryan C. Gordon
a2d3bf71c1 xinput: use the full range of the haptic motors (thanks, Trent!).
XInput goes from 0 to 64k; we were feeding it values in the range of 0 to 32k.

Fixes Bugzilla #3002.
2017-06-21 01:22:00 -04:00
Philipp Wiesemann
3d08ff5573 haiku: Removed unused internal function.
Its functionality is already in SDL_GL_GetAttribute().
2017-06-18 23:00:42 +02:00
Philipp Wiesemann
bf7056fe89 pandora: Fixed compiler warning about redefining SDL_REVISION.
Makefile must not create the revision header anymore because it already exists.
2017-06-18 23:00:27 +02:00
Philipp Wiesemann
0072c1184d haiku: Added support for some values set with SDL_GL_SetAttribute(). 2017-06-17 22:30:28 +02:00
Philipp Wiesemann
ea5028f893 haiku: Fixed missing slash in path from SDL_GetPrefPath(). 2017-06-17 22:30:09 +02:00
Philipp Wiesemann
089f483673 pandora: Fixed compile error. 2017-06-16 23:30:38 +02:00
Philipp Wiesemann
33c14a6441 directfb: Fixed quitting keyboard twice.
SDL_VideoQuit() already calls SDL_KeyboardQuit().
2017-06-16 23:30:30 +02:00
Philipp Wiesemann
754286bf0b nacl: Fixed unnecessary large input text array. 2017-06-16 23:30:13 +02:00
Sam Lantinga
cccb905d15 Get the parent of non-SDL-created windows, for completeness 2017-06-16 11:14:08 -07:00
Sam Lantinga
4a3e42f60b Clean up parent window when destroying a window 2017-06-16 10:50:29 -07:00
Sam Lantinga
13a149b1ff Implemented SDL_WINDOW_SKIP_TASKBAR on Windows 2017-06-16 09:10:13 -07:00
Philipp Wiesemann
f97e60a421 linux: Fixed using wrong constant for input text size. 2017-06-15 23:30:50 +02:00
Philipp Wiesemann
8bc79254aa Fixed SDL_GetWindowWMInfo() returning success on three unsupported platforms. 2017-06-15 23:30:29 +02:00
Ryan C. Gordon
7f3b12d6e7 audio: Converter now checks a strict list of channels and formats we support. 2017-06-12 21:35:24 -04:00
Sam Lantinga
e19ba502b2 Fixed bug 3668 - Overflow of SDL_AudioCVT.filters with some downmixes
Simon Hug

There's a chance that an audio conversion from many channels to a few can use more than 9 audio filters. SDL_AudioCVT has 10 SDL_AudioFilter pointers of which one has to be the terminating NULL pointer. The SDL code has no checks for this limit. If it overflows there can be stack or heap corruption or a call to 0xa.

Attached patch adds a function that checks for this limit and throws an error if it is reached. Also adds some documentation.

Test parameters that trigger this issue:
AUDIO_U16MSB with 224 channels at 46359 Hz
                 V
AUDIO_S16MSB with 6 channels at 27463 Hz

The fuzzer program I uploaded in bug 3667 has more of them.
2017-06-12 16:39:15 -07:00
Sam Lantinga
96a9da8084 Fixed bug 3670 - CMake IOS haptic error 2017-06-12 16:35:34 -07:00
Philipp Wiesemann
4755c05d29 linux: Changed internal functions to be static. 2017-06-11 22:30:58 +02:00
Philipp Wiesemann
4f840470cb directfb: Fixed comment. 2017-06-11 22:30:49 +02:00
Philipp Wiesemann
852d858c79 Fixed missing error messages for SDL_GetWindowWMInfo(). 2017-06-11 22:30:39 +02:00
Philipp Wiesemann
646f24dcaa directfb: Fixed crash if creating renderer.
SDL_GetWindowWMInfo() currently expects SDL to be 2.0.6 but SDL is still 2.0.5.
2017-06-11 22:30:24 +02:00
Philipp Wiesemann
c49ef40ede directfb: Fixed configure script not finding shared objects for dynamic loading. 2017-06-11 22:30:06 +02:00