Commit Graph

450 Commits

Author SHA1 Message Date
Ryan C. Gordon
3c955d0540 syswm: prevent buffer overflow if SDL and app have different config headers.
This only affects Wayland and DirectFB, as a Unix system generally has X11
support. Other platforms also have different sizes for the C union in
question, but are likely the only target for that platform, etc.

Apps that might run on Wayland or DirectFB will need to be compiled against
new headers from an official 2.0.6 release, or be prepared to force the x11
target, or not use SDL_GetWindowWMInfo().

Fixes Bugzilla #3428.
2017-06-11 00:50:26 -04:00
Alex Szpakowski
bb100d3bab Expose display refresh rate on iOS/tvOS 10.3+. 2017-06-10 21:29:37 -03:00
Ryan C. Gordon
599d9ba198 emscripten: listen for pointerlockchange events on the #document specifically. 2017-06-05 21:30:25 -04:00
Philipp Wiesemann
4b47fa38c3 Removed duplicate includes. 2017-06-04 23:15:47 +02:00
Philipp Wiesemann
248410dded Fixed SDL_GL_SetSwapInterval() returning success on two unsupported platforms. 2017-06-04 23:15:13 +02:00
Philipp Wiesemann
2113208d98 haiku: Fixed missing title bar for windows with decorations.
B_BORDERED_WINDOW_LOOK has a border but no title bar.
2017-06-03 23:00:50 +02:00
Philipp Wiesemann
63b3e06f75 Corrected names of header file guards. 2017-06-03 23:00:15 +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
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
b3f94acbf9 linux: Simplify D-Bus interface, remove lots of boilerplate. 2017-05-28 07:11:52 -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
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
1e13d93fea directfb: Changed internal function to be static. 2017-05-25 23:01:34 +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
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
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
Sam Lantinga
772407627b Fixed restoring a window that was maximized then minimized, then restored. 2017-05-16 17:48:57 -07:00
Sam Lantinga
ccf0566ca4 SDL - add SDL_WINDOW_VULKAN and make Android_CreateWindow only create an EGLSurface when SDL_WINDOW_VULKAN is not present. This makes it so the ANativeWindow* can be used with vkCreateAndroidSurfaceKHR, otherwise it will fail because having both an EGLSurface and VkSurfaceKHR attached to a window is not allowed according to the Vulkan spec:
"In particular, only one VkSurfaceKHR can exist at a time for a given window. Similarly, a native window cannot be used by both a VkSurfaceKHR and EGLSurface simultaneously"

CR: SamL
2017-05-16 06:30:39 -07:00
Philipp Wiesemann
df4cf79d42 directfb: Fixed compiler warnings about undefined functions. 2017-05-13 23:00:53 +02:00
Philipp Wiesemann
29222db7f6 emscripten: Fixed not removing pointer lock event callback. 2017-05-13 23:00:35 +02:00
Philipp Wiesemann
cc5b4f450a emscripten: Changed internal functions to be static. 2017-05-12 23:01:17 +02:00
Philipp Wiesemann
ce01128adf Fixed warnings about shadowed global variable.
Found by buildbot.
2017-05-12 23:01:04 +02:00
Philipp Wiesemann
87e0d812dd directfb: Removed duplicate comment. 2017-05-12 23:00:40 +02:00
Philipp Wiesemann
61c326e12b directfb: Fixed typo in log message. 2017-05-11 23:00:39 +02:00
Philipp Wiesemann
75c0d1ef6d directfb: Fixed compiler warnings about unused variables. 2017-05-11 23:00:21 +02:00
Sam Lantinga
8b7ae35356 Fixed build error on Linux 2017-05-09 03:19:58 -07:00
Sam Lantinga
9ac3bb7011 Added support for mixing Qt and SDL on iOS
You should call SDL_SetMainReady(), and then customize the QIOSApplicationDelegate like this, in your application code:

/* Additional support for applications mixing Qt and SDL */
@interface QIOSApplicationDelegate : UIResponder <UIApplicationDelegate>
@end

extern "C"
{
void SDL_OnApplicationWillResignActive();
void SDL_OnApplicationDidEnterBackground();
void SDL_OnApplicationWillEnterForeground();
void SDL_OnApplicationDidBecomeActive();
}

@interface QIOSApplicationDelegate (SDL)

- (void)applicationWillResignActive:(UIApplication*)application;
- (void)applicationDidEnterBackground:(UIApplication*)application;
- (void)applicationWillEnterForeground:(UIApplication*)application;
- (void)applicationDidBecomeActive:(UIApplication*)application;

@end

@implementation QIOSApplicationDelegate (SDL)

- (void)applicationWillResignActive:(UIApplication*)application
{
    SDL_OnApplicationWillResignActive();
}

- (void)applicationDidEnterBackground:(UIApplication*)application
{
    SDL_OnApplicationDidEnterBackground();
}

- (void)applicationWillEnterForeground:(UIApplication*)application
{
    SDL_OnApplicationWillEnterForeground();
}

- (void)applicationDidBecomeActive:(UIApplication*)application
{
    SDL_OnApplicationDidBecomeActive();
}

@end // QIOSApplicationDelegate
2017-05-09 10:10:42 -07:00
Philipp Wiesemann
b7b919078f haiku: Changed internal function to be static. 2017-05-07 21:02:31 +02:00
Philipp Wiesemann
3ed2f0ca10 haiku: Fixed unlocking clipboard twice. 2017-05-07 21:02:16 +02:00
Philipp Wiesemann
4466b93141 haiku: Fixed comment. 2017-05-06 21:46:11 +02:00
Philipp Wiesemann
34747107fe mir: Fixed memory leak if system cursor id is unknown. 2017-05-06 21:46:00 +02:00
Philipp Wiesemann
34d9c5213c emscripten: Fixed return type in event callback declaration. 2017-05-06 21:45:43 +02:00
Ryan C. Gordon
ce2998b8b9 cocoa: Don't crash on messagebox keypress without a successful SDL_Init(). 2017-05-02 21:46:28 -04:00
Ryan C. Gordon
619ab7a22d haiku: Various fixes from haikuports.
Based on patch here:

https://github.com/haikuports/haikuports/blob/master/media-libs/libsdl2/patches/libsdl2-2.0.5.patchset
2017-05-01 18:39:05 -04:00
Philipp Wiesemann
444c47a1b8 windows: Changed six internal functions to be static. 2017-04-29 22:50:35 +02:00
Joshua Granick
1286a7d23e windows: Add SDL_WINDOW_ALWAYS_ON_TOP support. 2017-04-20 21:31:44 -04:00
Ryan C. Gordon
93a6191cdc emscripten: keep track of pointer lock losses and maybe regrab pointer later.
If an Emscripten app is in relative mouse mode and the user presses Escape
(or whatever is appropriate), then the pointer lock is broken by the browser.

This keeps track of those losses, and next time the user presses a mouse
button down on the canvas, if the app is still meant to be in relative mouse
mode, we will attempt to regrab the pointer.

This makes it much more seamless for things like first-person shooters, and
the app doesn't need any manual intervention.
2017-04-20 13:00:54 -04:00
Philipp Wiesemann
2bf79c2e0e mir: Fixed typo in error messages. 2017-04-09 23:00:54 +02:00
Drew Bliss
a4dbf56574 Fix divide-by-zero when videodata->ime_candpgsize is zero. We're seeing this happen in Dota in the wild. 2017-04-06 13:27:51 -07:00
Drew Bliss
66555f6115 SDL - attempt to fix https://github.com/ValveSoftware/Dota-2/issues/1199 of mouse not locking in Dota. This fix is proposed by Ryan Gordon (increase timeout in X11_SetWindowGrab from 250ms to 5000ms). I'm going to integrate to source2 and ship it to dota customers. If it works, SamL will upsteam it to SDL. 2017-04-06 13:27:48 -07:00
Sam Lantinga
5789da67cf Fixed bug 1859 - No SDL_VIDEORESIZE event generated when the window manager sets the window size.
Samuel Hopkins

Just confirming that the patch from Andreas (attachment 1715 [details]) works for me under SDL 2.0.3 with xmonad.

Stas Sergeev

Confirming that the patch in this ticket fixes the full-screen switching for dosemu2 on ubuntu-16.04. Note that I am not using xmonad, so this bug appears to be generic.
2017-04-03 13:32:53 -07:00
Philipp Wiesemann
1517ba7285 PSP: Fixed error messages. 2017-04-02 21:33:54 +02:00
Philipp Wiesemann
f96cdca4e7 Mir: Changed two internal functions to be static. 2017-04-02 21:33:42 +02:00