Commit Graph

3593 Commits

Author SHA1 Message Date
Alex Szpakowski
5fe5bc046c 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
963a6f620d 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
040949ec05 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
6f0e552249 Fix mouse wheel events on macOS 10.12 (thanks Eric Wasylishen!)
Fixes bug #3432
2016-09-24 13:28:40 -03:00
Brandon Schaefer
47913c7dc8 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
a0f9f78240 Mir: Add fixme (waiting for a public api to be added) 2016-09-21 16:28:23 -07:00
Brandon Schaefer
5490baa307 [Mir] Move to the new MirDisplayConfig API 2016-09-21 15:57:15 -07:00
Sam Lantinga
35c3349008 Fixed warning with Xcode 7.3.0 2016-09-16 22:27:58 -07:00
Alex Szpakowski
643a6b2ac2 tvOS: Add drop-file support 2016-09-15 21:49:29 -03:00
Alex Szpakowski
a714cf6d15 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
f7cdca5b0d 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
5e63affced 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
937207056b Add mapping for media keys 2016-09-13 00:04:00 -07:00
Alon Zakai
31fd8a9e0e use Module.createContext for 2D rendering in emscripten 2016-09-13 00:03:59 -07:00
Alon Zakai
f873443b21 add some detail to fullscreen workaround comment; version 6
Conflicts:
	version.txt
2016-09-13 00:03:58 -07:00
Charlie Birks
afdd5e100b only unset fullscreen flags if fullscreen failed 2016-09-13 00:03:56 -07:00
Charlie Birks
d9a88b96e8 use screen resolution instead of canvas size 2016-09-13 00:03:55 -07:00
Boris Gjenero
9d00142f75 Fix full screen mode in Firefox, which was broken by 9d4beb2 2016-09-13 00:03:54 -07:00
Boris Gjenero
ef19ecbc56 Support SDL_SetWindowTitle() via Module['setWindowTitle']() 2016-09-13 00:03:53 -07:00
Jukka Jylänki
ba527c7f6a Remove unused variable warning from Emscripten build in Emscripten_HandleFullscreenChange(). 2016-09-13 00:03:51 -07:00
Boris Gjenero
3744534cff Unpress all keys on blur to avoid stuck keys 2016-09-13 00:03:49 -07:00
Boris Gjenero
8f49012235 Listen for blur and focus events on window instead of canvas
Blur and focus events were not arriving for the canvas in
Firefox 35 and Chrome 40.
2016-09-13 00:03:48 -07:00
Boris Gjenero
9308054353 Mouse events use CSS coordinates, so don't scale by pixel_ratio 2016-09-13 00:03:46 -07:00
Boris Gjenero
b4510f7c47 Accumulate subpixel mouse motion so motion is not lost.
Previously when the canvas was scaled up and the pointer was locked,
motion corresponding to less than one pixel was lost. Therefore,
slow mouse motion resulted in no motion. This fixes that.
2016-09-13 00:03:45 -07:00
TelpeNight
42ddc908b4 Fix of mouse events in browser without pointer locks 2016-09-13 00:03:44 -07:00
Alon Zakai
4f4c2f37a5 optimize Emscripten_UpdateWindowFramebuffer
- avoid creating contexts and images all the time
 - use set and then fix alpha directly
2016-09-13 00:03:43 -07:00
Charlie Birks
eb7c4d30bc send mouse move on enter/leave 2016-09-13 00:03:39 -07:00
Charlie Birks
0fedce3a2b listen for mouse up on document (fixes mouseup outside canvas) 2016-09-13 00:03:37 -07:00
Charlie Birks
14f0448296 use SDL_SetMouseFocus 2016-09-13 00:03:36 -07:00
Sam Lantinga
739d3be315 simplify fullscreen handling using new fullscreen_strategy api, patch contributed by Charlie Birks 2016-09-13 00:03:28 -07:00
Charlie Birks
e5511d4d55 use css size for touch normalisation 2016-09-12 23:58:08 -07:00
Sam Lantinga
e730ada35f Reverted previous commit which breaks game controller input processing. 2016-09-09 15:12:09 -07:00
Sam Lantinga
9b546b9b7c Suggestion from Apple: use kCFRunLoopCommonModes which does more complete event processing 2016-09-08 20:38:23 -07:00
Ryan C. Gordon
1aa7cd0d3b emscripten: special case to make SDL_ShowSimpleMessageBox() work.
Browsers don't have the functionality to fully support the generic
SDL_ShowMessageBox(), but this handles the likely most-common case.

Without this, you'd return immediately with a proper error result and no UI,
but probably no one checks that for SDL_ShowSimpleMessageBox. And if they
did: what would they do to handle this anyhow?

We'd need to lobby for an HTML spec of some sort that allows customizable
message boxes--that block!--to properly support SDL message boxes on
Emscripten, but this is probably Good Enough for now.
2016-09-06 13:13:03 -04:00
Sam Lantinga
ac9647e0b2 wayland: Add support for relative mouse mode, by Jonas Ådahl <jadahl@gmail.com>
Generate the C protocol files from the protocol XML files installed by
wayland-protocols, and use them to implement support for relative pointer
motions and pointer locking.

Note that at the time, the protocol is unstable and may change in the future.
Any future breaking changes will, however, fail gracefully and result in no
regressions compared to before this patch.
2016-09-01 01:26:56 -07:00
Jonas Ådahl
d1f5d6d436 wayland: Build own version of core protocol
Since we are loading shared objects dynamically, build our own version of the
core protocol symbols, so that we in the future can include protocol
extensions.
2016-06-23 18:39:05 +08:00
Bastien Nocera
fa6d007f86 Wayland: Set "class" for each window we create
This will be used by Wayland compositors to match the application ID and
.desktop file to the SDL window(s).

Applications can set the SDL_VIDEO_WAYLAND_WMCLASS environemnt variable
early in the process to override using the binary name as a fallback.

Note that we also support the SDL_VIDEO_X11_WMCLASS in the Wayland
backend so that if a program correctly associated the desktop file with
the window under X11, only a newer SDL would be needed for it to work
under Wayland.

https://bugzilla.libsdl.org/show_bug.cgi?id=3376
2016-09-01 01:22:58 -07:00
David Ludwig
2de39f53fb WinRT: added an extra NULL pointer check for SDL_*ScreenSaver() backend code 2016-08-31 12:52:55 -04:00
Brandon Schaefer
e267302c16 Mir: Add mouse grab support (requires mir 0.24) 2016-08-30 12:58:00 -07:00
Philipp Wiesemann
d371267b8b Android: Fixed missing mouse motion events while button down (thanks, Sylvain!).
Happened for real mouse if SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH was active.

Fixes Bugzilla #3313.
2016-08-30 21:14:52 +02:00
David Ludwig
3ea11f6b0e WinRT: added SDL_*ScreenSaver() support; fixed crash when restoring app from screensaver 2016-08-29 20:27:21 -04:00
Ryan C. Gordon
acab2d8231 cocoa: Fixed incorrect autorelease, noted by static analysis. 2016-08-28 19:06:31 -04:00
Ryan C. Gordon
c0cb659ac4 Merge audio capture work back into the mainline. 2016-08-28 13:36:13 -04:00
David Ludwig
94792eaa5b WinRT: fixed bug where Win10 GameBar, when shown + hidden, might not restore a cursor's hidden state
The repro steps were this:
1. run an sdl2 winrt/uwp app, on Win10, v10.0.10586.0 or higher
2. hide the cursor, via a call to SDL_ShowCursor(0)
3. make the Win10 game bar appear, by pressing the Windows + G hotkey
4. observe that the mouse cursor appears, in order to interact with the
   game bar (this is expected behavior)
5. make the Win10 game bar disappear, either by pressing the Windows + G hotkey
   again, or clicking somewhere in the app

EXPECTED RESULT: cursor disappears, as game bar disappears

ACTUAL RESULT: cursor didn't always disappear
2016-08-20 13:46:45 -04:00
Ryan C. Gordon
7a1c094254 emscripten: send fake mouse events for touches, like other targets do.
(This really should be handled at the higher level and not in the individual
targets, but this fixes the immediate bug.)
2016-08-12 19:59:00 -04:00
Ryan C. Gordon
9d85883e61 audio: Renamed some internal driver symbols in various targets. 2016-08-11 22:22:09 -04:00
Philipp Wiesemann
0f602c1985 PSP: Fixed memory leak if video init failed. 2016-08-03 22:32:20 +02:00
Philipp Wiesemann
46eb4f59f2 WinRT: Removed not needed SDL_zerop() after SDL_calloc().
SDL_calloc() already sets memory to zero.
2016-08-03 22:32:02 +02:00
Philipp Wiesemann
3fda6e468d Pandora: Fixed memory leak in video implementation. 2016-07-20 21:00:52 +02:00
Philipp Wiesemann
8b903ea2af Pandora: Fixed compile warnings in video implementation (thanks, Bombo!).
Fixes Bugzilla #2734.
2016-07-20 21:00:36 +02:00