Commit Graph

276 Commits

Author SHA1 Message Date
Sam Lantinga
d2c8c5094c Fixed build for X11 2016-10-01 14:54:05 -07:00
Sam Lantinga
fa0f417631 Fixed build warnings and errors 2016-10-01 14:48:18 -07:00
Sam Lantinga
fae5d0eab3 Fixed bug 3107 OSX - Process events in SDLApplication to fix integration with CEF.
John Wordsworth

While attempting to integrate CEF (Browser) into an SDL application, we noticed that there were problems on OS X where approximately 50% of the input events were essentially being lost - even when we were using off-screen rendering in CEF and passing through input events manually.

It appears that this problem has been around for a while (see: http://www.magpcss.org/ceforum/viewtopic.php?f=6&t=11141).

Please consider the following patch that fixes this issue. Instead of processing events directly after calling [NSApp nextEventMatchingMask:...] we now pass these events down to NSApp, for processing by an overloaded sendEvent: method. Chromium also forwards events to NSApp in the same way, which means we don't miss events, even if they were originally dequeued by CEF.
2016-10-01 14:34:52 -07:00
Sam Lantinga
359f59aef5 Fixed bug 3130 - Spacebar not responding
Alex Baines

Make sure group is valid before passing it to XkbKeysymToKeycode.
2016-10-01 14:22:10 -07:00
Magnus Bjerke Vik
555e6c9686 Fix SDL not resizing window when Android screen resolution changes 2016-10-01 14:18:29 -07:00
Sam Lantinga
0250eb3c4f Fixed bug 3134 - CalculateXRandRRefreshRate() returns incorrect refresh rate due to floating point truncation.
Michael

In SDL_x11modes.c the CalculateXRandRRefreshRate() function performs integer math on values that may return fractional results. This causes a value that would be calculated as 59.99972... to be returned as 59. In Linux the xrandr command returns 60Hz for this particular display mode yet SDL returns 59Hz.

I suggest this function be updated to correctly round the result of the calculation instead of truncating the result.
2016-10-01 14:16:04 -07:00
Alex Baines
7543092add Call setlocale + XSetModifiers before XOpenIM, Work around ibus+xim duplicate events. 2015-09-30 04:16:09 +01:00
Sam Lantinga
da6197c5a8 Fixed 3149 - Mouse Pointer Raspberry Pi corrupt when moving over screen edges
Patrick Gutlich

The mouse cursor gets corrupted when the mouse moves over the screen edges (right and bottom) a weird type of scaling seems to occur and you end up with a blank square.
2016-10-01 13:59:59 -07:00
Sam Lantinga
473051f6bb Fixed bug 3159 - SDL_blit_slow with BLENDING does not work
Fritzor

Source Suface is ABGR and Destination Surface is ABGR. We use software blending. In the Switch-Case statement for SDL_COPY_BLEND (Line 126) the alpha-channel is not calculated like in every SDL_blit_auto - function. So if the destination Surface has alpha - channel of zero the resulting surface has zero as well.
Add:  ?dstA = srcA + ((255 - srcA) * dstA) / 255;? to code and everything is okay.
2016-10-01 13:40:01 -07:00
Sam Lantinga
f4b26cd8e0 Removed carriage returns from previous patch 2016-10-01 13:16:31 -07:00
Sam Lantinga
7b0ccd32e5 Fixed bug 3405 - Wrong default icon size on windows systems
Evgeny Vrublevsky

Original code in the video/windows/SDL_windowsevents.c registers obsolete WNDCLASS (not WNDCLASSEX). As the result only one icon size is used as the small and normal icons. Also original code doesn't specify required size of an icon. As the result when 256x256 icon is available, the program uses it as a default icon, and it looks ugly.

We have to use WNDCLASSEX and load icons with proper sizes which we can get using GetSystemMetrics.

Better idea. We could use the first icon from resources, like the Explorer does. Patch is included. It also correctly loads large and small icons, so it will look nice everywhere.
2016-10-01 13:14:51 -07:00
Sam Lantinga
765d8bea01 Fixed bug 3305 - Fixed TextInput status when the keyboard was dismissed with the dismiss key on the iPad
Diego

The keyboard on iPads has a dismiss button that hides the keyboard. When the keyboard was hidden using that button, instead of the return key, SDL was still reporting IsTextInputActive as true. This patch adds an extra SDL_StopTextInput when iOS reports the keyboard will hide.
2016-10-01 12:46:36 -07:00
Ethan Lee
c3e48e71b4 Force WM_PAINT events on window resize 2016-04-12 10:45:56 -04:00
Sam Lantinga
0b576962ca Reset dead keys when the SDL window loses focus, so dead keys pressed in SDL applications don't affect text input into other applications. 2016-10-01 12:17:42 -07:00
Sam Lantinga
1e6e595484 Fixed bug 3332 - Win32: reset deadkeys in StartTextInput/StopTextInput
Eric Wasylishen

The bug here is that a dead keys pressed before calling SDL_StartTextInput() carries over into future text input, so the next key pressed will have the deadkey applied to it.

This in undesirable, imho, and doesn't occur on OS X (haven't check Linux or elsewhere). It's causing a problem for Quakespasm on German keyboard layouts, where we use the ^ deadkey to toggle the console (which enables/disables text input), and ^ characters are showing up in the TEXTINPUT events.
2016-10-01 11:54:02 -07:00
Sam Lantinga
9fff05f8d6 Fixed bug 3352 - Adding alpha mask support to SDL_SaveBMP_RW
Simon Hug

The current SDL_SaveBMP_RW function that saves surfaces to a BMP uses an old bitmap header which doesn't officially support alpha channels. Applications just ignore the byte where the alpha is stored. This can easily be extended by using a newer header version and setting the alpha mask.

The attached patch has these changes:

- Extending the description of the function in the SDL_surface.h header with the supported formats.
- Refining when surfaces get stored to a 32-bit BMP. (Must have bit depth of 8 or higher and must have an alpha mask or colorkey.)
- Fixing a small bug that saves 24-bit BGR surfaces with a colorkey in a 24-bit BMP.
- Adding code that switches to the bitmap header version 4 if the surface has an alpha mask or colorkey. (I chose version 4 because Microsoft didn't lose its documentation behind a file cabinet like they did with version 3.)
- Adding a hint that can disable the use of the version 4 header. This is for people that need the legacy header or like the old behavior better. (I'm not sure about the hint name, though. May need changing if there are any rules to that.)
2016-10-01 11:29:13 -07:00
Sam Lantinga
fd1d692bef Fixed bug 3368 - SDL_Blit_Slow doesn't ignore alpha values in colorkey comparison
Simon Hug

When the SDL_Blit_Slow function compares the pixel to the color key it does so without removing the alpha component from the pixel value and the key. This is different from the optimized 32-bit blitters which create a rgb mask and apply it to both to filter the alpha out. SDL_Blit_Slow will only skip the pixels with the exact alpha value of the key instead of all pixels with the same color.

The attached test case blits a surface with a color key and prints the pixel values to the console. The third row is expected to be skipped.
2016-10-01 10:46:10 -07:00
Ryan C. Gordon
e64c5186e2 windows: Removed hardcoded "1" for mouse clickthrough hint. 2016-09-29 23:42:18 -04:00
Ryan C. Gordon
f10db4071d haiku: Patched to compile. 2016-09-29 23:15:56 -04:00
Ryan C. Gordon
f2fcd324c5 windows: fix borderless windows at desktop resolution (thanks, Evgeny!).
Fixes Bugzilla #3404.
2016-09-29 23:12:58 -04:00
Ryan C. Gordon
b2510d9cbc x11: fixed incorrect SDL_GetWindowPosition() after resize (thanks, Jason!).
Fixes Bugzilla #3272.
2016-09-29 23:01:43 -04:00
Ryan C. Gordon
4f4c4b629f Added SDL_SetWindowResizable(). (thanks, Ethan!) 2016-09-29 22:52:41 -04:00
Sam Lantinga
67bdbcca44 Implemented SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH on X11 2016-09-29 16:05:29 -07:00
Sam Lantinga
d285af2a96 Added Windows support for SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH 2016-09-29 14:48:33 -07:00
Sam Lantinga
a13da2faa7 Generalized the hint for whether the application gets a mouse event when clicking on the window to activate it, and is now named SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH.
The behavior is defined to not receive the click event, and this hint allows you to override that.
2016-09-29 13:34:49 -07:00
Sam Lantinga
8ddb4328b5 When clicking on a window to give it focus, don't pass the mouse click to the application. 2016-09-29 03:59:04 -07:00
Alex Szpakowski
f31c7086d8 Enable SDL_LoadObject on iOS 8+ and tvOS. 2016-09-25 15:02:06 -03:00
Alex Szpakowski
77bacfd72d tvOS launch images are now properly supported. 2016-09-25 11:46:25 -03:00
Alex Szpakowski
40ecac8e60 Don't try to load a launch storyboard on tvOS (it doesn't use them). 2016-09-25 00:21:12 -03:00
Alex Szpakowski
666d3fecc8 iOS/tvOS: Try to load the launch screen as a storyboard. Xcode 8 compiles it as a storyboard instead of a nib. 2016-09-24 23:33:49 -03:00
Alex Szpakowski
9165ba7ebd iOS/tvOS: Always send SDL_WINDOWEVENT_FOCUS_GAINED when a window is created on the main screen (fixes bug #3395). 2016-09-24 20:12:57 -03:00
Alex Szpakowski
450fa8cdf9 Use OS-provided click counts on macOS and iOS for mouse press and release events. 2016-09-24 18:46:34 -03:00
Alex Szpakowski
bac5394127 Fix mouse wheel events on macOS 10.12 (thanks Eric Wasylishen!)
Fixes bug #3432
2016-09-24 13:28:40 -03:00
Brandon Schaefer
89c538a4e3 Mir: Add gamma support set/get. Still need one more function to complete the set 2016-09-21 18:23:59 -07:00
Brandon Schaefer
a729c4f97a Mir: Add fixme (waiting for a public api to be added) 2016-09-21 16:28:23 -07:00
Brandon Schaefer
705ecf78f5 [Mir] Move to the new MirDisplayConfig API 2016-09-21 15:57:15 -07:00
Sam Lantinga
29214826ec Fixed warning with Xcode 7.3.0 2016-09-16 22:27:58 -07:00
Alex Szpakowski
4bcce330d1 tvOS: Add drop-file support 2016-09-15 21:49:29 -03:00
Alex Szpakowski
f050576665 Initial Apple TV / tvOS support.
The Apple TV remote is currently exposed as a joystick with its touch surface treated as two axes. Key presses are also generated when its buttons and touch surface are used.

A new hint has been added to help deal with deciding whether to background the app when the remote's menu button is pressed: SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS.
2016-09-13 22:18:06 -03:00
Alex Szpakowski
86708c3cd8 Enable more compiler warnings in the Xcode projects (based on Xcode 8's suggestion), made some integer downcasts explicit. 2016-09-13 19:51:10 -03:00
Sam Lantinga
00791f3a87 Only prevent the default browser event handling when the specific event types aren't disabled by the user, patch contributed by Jonas Platte 2016-09-13 00:09:21 -07:00
Charlie Birks
993dd83510 Add mapping for media keys 2016-09-13 00:04:00 -07:00
Alon Zakai
1b6565fcb7 use Module.createContext for 2D rendering in emscripten 2016-09-13 00:03:59 -07:00
Alon Zakai
bec5573476 add some detail to fullscreen workaround comment; version 6
Conflicts:
	version.txt
2016-09-13 00:03:58 -07:00
Charlie Birks
405d64b207 only unset fullscreen flags if fullscreen failed 2016-09-13 00:03:56 -07:00
Charlie Birks
c68cac89df use screen resolution instead of canvas size 2016-09-13 00:03:55 -07:00
Boris Gjenero
791b946a42 Fix full screen mode in Firefox, which was broken by 9d4beb2 2016-09-13 00:03:54 -07:00
Boris Gjenero
b71208d452 Support SDL_SetWindowTitle() via Module['setWindowTitle']() 2016-09-13 00:03:53 -07:00
Jukka Jyl?nki
7cf44f1b4a Remove unused variable warning from Emscripten build in Emscripten_HandleFullscreenChange(). 2016-09-13 00:03:51 -07:00
Boris Gjenero
b54eb82c67 Unpress all keys on blur to avoid stuck keys 2016-09-13 00:03:49 -07:00