Commit graph

7333 commits

Author SHA1 Message Date
Ryan C. Gordon
faf8781497 Mac: Added a hint to opt-out of new Spaces code. 2014-03-03 21:25:16 -05:00
Ryan C. Gordon
28ab3cb756 Removed unused variable. 2014-03-02 22:55:12 -05:00
Ryan C. Gordon
fab30f987c Mac: Don't lose the menu/dock when switching back to a resizable window Space. 2014-03-02 22:51:31 -05:00
Ryan C. Gordon
7e0a86800d Mac: only programmatically create Spaces if we're FULLSCREEN_DESKTOP.
(coming back from fullscreen in any state is okay).
2014-03-02 22:16:49 -05:00
Ryan C. Gordon
3f41dc1c92 A bunch of fixes for the new Spaces code.
--HG--
extra : rebase_source : 411c90597aaf0f5d30cb5efde652696bbb45497c
2014-03-02 16:36:40 -05:00
Sam Lantinga
1a4a891233 Fixed dictionary initialization 2014-03-02 13:06:51 -08:00
Sam Lantinga
d8a4f1ea9d Updated to build on Mac OS X 10.7 with Xcode 4.6 2014-03-02 12:58:00 -08:00
Ryan C. Gordon
abd5c75f1a Mac: Manage menubar and dock as FULLSCREEN_DESKTOP windows become/resign key. 2014-03-02 15:35:24 -05:00
Bastien Nocera
baf56fe069 Add support for the freedesktop.org Idle Inhibition specification,
as per:
http://people.freedesktop.org/~hadess/idle-inhibition-spec/

This makes screensaver inhibition work with GNOME 3 and other
desktop environments that implement the specification.

https://bugzilla.libsdl.org/show_bug.cgi?id=2169

--HG--
extra : rebase_source : b1967a91febdaa3f0fcb311ee1909a741722e9b2
2014-03-02 14:59:06 -05:00
Sam Lantinga
bb993d3a3b Backed out changeset a6493ee0c9b5 2014-03-02 11:10:00 -08:00
Sam Lantinga
5624855166 Make sure we return version 0 if XInput detection fails 2014-03-02 11:08:05 -08:00
Ryan C. Gordon
afa70ff8df Reworked fullscreen policy on Mac OS X.
- SDL_WINDOW_FULLSCREEN works as always (change resolution, lock to window).
- SDL_WINDOW_FULLSCREEN_DESKTOP now puts the window in its own Space, and
  hides the menu bar, but you can slide between Spaces and Command-Tab between
  apps without the window minimizing, etc.
- SDL_WINDOW_RESIZABLE windows will get the new 10.7+ "toggle fullscreen"
  window decoration and menubar item. As far as the app is concerned, this is
  no different than resizing a window, but it gives the end-user more power.
- The hint for putting fullscreen windows into the Spaces system is gone,
  since Spaces can't enforce the requested resolution. It's a perfect match
  for FULLSCREEN_DESKTOP, though, so this is all automated now.
2014-03-02 12:45:51 -05:00
Ryan C. Gordon
88bdcd6a28 Better attempt to detect available X11 XInput2 features.
Fixes Bugzilla #2306.
2014-03-02 02:00:40 -05:00
Ryan C. Gordon
a5a1ae956b Fixed X11 XInput2 multitouch test to work in configure script.
configure wraps this C code in a main() function, so you can't declare a
function body in there. Besides, I'm not sure why we declared a function
that's part of the multitouch API anyhow.

Now we just reference a type that only exists if the headers have multitouch
support and call it a day.
2014-03-02 01:59:25 -05:00
Ryan C. Gordon
5f11f71362 Windows: Fixed crash if quitting without closing an XInput haptic device.
--HG--
extra : histedit_source : ddde0349ad87c7b525efb7e0b01ee45fef9170af
2014-03-02 00:02:56 -05:00
Ryan C. Gordon
ae216dde6c Added a FIXME. 2014-03-01 22:27:21 -05:00
Ryan C. Gordon
8135173e3f Fixed a typo in a comment. 2014-03-01 22:27:13 -05:00
Ryan C. Gordon
f0cc3c2e56 Dynamically load glGetString(), to avoid direct dependency on OpenGL. 2014-03-01 21:33:48 -05:00
Ryan C. Gordon
81801cb940 Added some FIXMEs. 2014-03-01 20:59:43 -05:00
Ryan C. Gordon
d954bb23ac Mac OS X: Make OpenGL context selection more robust, avoid software fallback.
Fixes Bugzilla #2197.
2014-03-01 20:46:45 -05:00
Ryan C. Gordon
267f8fb155 Force Windows version of SDL_GetPrefPath() to Unicode, create missing dirs.
Fixes Bugzilla #2273.
2014-03-01 20:28:40 -05:00
David Ludwig
65f91d101f WinRT: cleaned up some hard-to-read SDL_DisplayMode management code 2014-03-01 16:37:30 -05:00
David Ludwig
582a189bc4 WinRT: fixed a crash in SDL_Quit
SDL was expected that each SDL_DisplayMode had a driverdata field that was SDL_malloc'ed, and was calling SDL_free on them.  This change moves WinRT's driverdata content into a SDL_malloc'ed field.
2014-03-01 16:08:16 -05:00
Sam Lantinga
b2c4391ab7 Changed SDL_HINT_ACCEL_AS_JOY to SDL_HINT_ACCELEROMETER_AS_JOYSTICK to be more clear. 2014-03-01 12:21:15 -08:00
Sam Lantinga
5378997447 Fixed compiler warning 2014-03-01 11:42:12 -08:00
Sam Lantinga
4835900bcd Fixed compiler warning 2014-03-01 11:40:41 -08:00
Sam Lantinga
986b5a39b2 Fixed test for libuuid.a 2014-03-01 11:39:39 -08:00
Sam Lantinga
8bb2f07439 Updated with the latest 2.0.2 API changes 2014-03-01 11:05:58 -08:00
Sam Lantinga
651b638ea3 Fixed bug 2368 - Security Software is blocking RegisterRawInputDevices()
Yamagi

A customer of mine had the strange problem, that SDL_SetRelativeMouseMode() was failing for him on Windows 7. Luckily he was willing to provide some debug informations. We could track this problem down to RegisterRawInputDevices() failing due to security software running on his system (Norton Internet Security to be precise, but there are reports of similar problems with other products. For example [1]). Working around this issue with SDL_WarpMouseInWindow() is easy, and while I don't think that SDL2 can provide an internal workaround it would be really nice and helpfull if this could be documentated somewhere.

1: http://forums.codeguru.com/showthread.php?498374-How-to-run-a-very-long-SQL-statement
2014-03-01 09:59:06 -08:00
Sam Lantinga
b7435a3ad3 Fixed bug 2423 - timeBeginPeriod & timeEndPeriod mismatch
Coriiander

In src\timer\windows\SDL_systimer.c there is an error with regards to timeBeginPeriod and timeEndPeriod. These functions typically get called when no high resolution timer is available, and GetTickCount is not used.

According to MSDN (link: dd757624(v=vs.85).aspx), for every call to timeBeginPeriod a subsequent call to timeEndPeriod is required. While SDL is currently doing this, it fails to call timeEndPeriod when cleaning up/shutting down SDL. Please note that these functions affect things on a system level. Failing to call timeEndPeriod, disables applications for using WINMM-timers after usage&shutdown of SDL, as effectively they the mechanism is now broken.

Solution:
Ensure this code gets called when shutting down the timer subsystem:

#ifndef USE_GETTICKCOUNT
if (!hires_timer_available)
{
    timeSetPeriod(0);
}
#endif
2014-03-01 09:50:52 -08:00
Sam Lantinga
cff6eb5155 Null termnate the pUserMappings variable to prevent memory corruption. 2014-02-28 16:24:41 -08:00
Sam Lantinga
3dfda84048 Added a hint to enable the screensaver by default 2014-02-28 14:23:41 -08:00
Ryan C. Gordon
c5162134d2 Disable the screensaver by default.
Fixes Bugzilla #2218.

--HG--
extra : rebase_source : 839adf21025b06637f25ff2d2756c05a00d0d87a
extra : histedit_source : da99e2c6f35926cfc13b83e5557ffec57e2b1b78
2014-02-27 22:06:41 -05:00
Gabriel Jacobo
2e034c2a74 Improve window recreation logic in OpenGL* renderers 2014-02-27 20:21:46 -03:00
Jørgen P. Tjernø
28741acca1 Mac: Forgot return value in last commit. 2014-02-26 16:27:03 -08:00
Jørgen P. Tjernø
bd9b49b64c Mac: Don't disassociate cursor if window is moving / doesn't have focus.
Bug: https://bugzilla.libsdl.org/show_bug.cgi?id=2396
2014-02-26 16:10:52 -08:00
Jørgen P. Tjernø
b8fae2ab0b Mac: Redo cursor warp handling.
This fixes bugs related to getting unnaturally large xrel/yrel for
SDL_MOUSEMOTION after warps and enabling / disabling relative mode.

Bug: https://bugzilla.libsdl.org/show_bug.cgi?id=1836
2014-02-26 11:35:02 -08:00
Jørgen P. Tjernø
dae431ed0e Mac: Improve moving relative mode windows.
This makes it possible to move windows by their title bar, even if they're in
relative mode, if you click the title bar when the window does not have focus.

Bug: https://bugzilla.libsdl.org/show_bug.cgi?id=2396

--HG--
extra : amend_source : 01cfe87acac88dd75b2f074d3833129605c46ed2
2014-02-25 17:27:41 -08:00
Jørgen P. Tjernø
ca29983393 Mac: Fix error message for haptic subsystem.
We were calling SDL_Error instead of SDL_SetError when the haptic subsystem
wasn't initialized.
2014-02-25 17:25:49 -08:00
Jørgen P. Tjernø
7316ed4a8f Mac: Immediately update current OpenGL context's shape.
Previously we were postponing our -[NSOpenGLContext update] call to the next
SDL_GL_SwapWindow, even if the context was current on the current thread. This
changes it so that we will do the update immediately if it's the current
context.

If you're rendering on another thread, you need to call SDL_GL_SwapWindow once
after a resize event to ensure your drawable will produce non-garbage data.

Bug: https://bugzilla.libsdl.org/show_bug.cgi?id=2339

--HG--
extra : rebase_source : 3316bbdbaf00cbbec9bcdcc5ef3dd11b814b1dc9
extra : amend_source : 15988f6bf499cd6d4ffa914988805ab298ee7661
2014-02-25 15:28:12 -08:00
Gabriel Jacobo
83efc7045c Fixes #2308, recreate window if GL requirements for the renderer are not met
If the window has been created with values for SDL_GL_CONTEXT_PROFILE_MASK,
SDL_GL_CONTEXT_MAJOR_VERSION and SDL_GL_CONTEXT_MINOR_VERSION not matching those
required by the renderer, attempt to recreate the window.
This is needed on platforms where both GL and GLES 1/2 surfaces are supported
by the video backend, requiring that the window be recreated when switching
between context types.
2014-02-25 17:42:34 -03:00
David Ludwig
40b6f9290b WinRT: simulate keyboard events on Windows Phone 8 back-button presses
Pressing the hardware back button on a Windows Phone 8 device will now cause SDL to emit a pair of key-down and key-up events, with the SDL scancode, SDL_SCANCODE_AC_BACK.

By default, if WinRT's native back-button-press events are not explicitly marked as 'handled', then Windows Phone will terminate the app.  More details on Microsoft's reasoning behind this can be found on MSDN, at http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj247550(v=vs.105).aspx

To mark back-button-press events as 'handled', set SDL_HINT_WINRT_HANDLE_BACK_BUTTON to 1.  Setting it to anything else will cause these events to not be marked as 'handled'.

Due to limitations in Windows Phone's APIs, SDL will emit a virtual key-up event immediately after the back button's key-down event is registered.  Unfortunately, Windows Phone 8 only allows one to register for back-button-press events, and not back-button-release events.
2014-01-26 08:06:36 -05:00
David Ludwig
4c397e686a WinRT: added a means to display a privacy policy link via the Settings charm
This change is only relevant for Windows 8, 8.1, and RT apps, and only for those that are network-enabled.  Such apps must feature a link to a privacy policy, which must be displayed via the Windows Settings charm.  This is needed to pass Windows Store app-certification.

Using SDL_SetHint, along with SDL_HINT_WINRT_PRIVACY_POLICY_URL and optionally SDL_HINT_WINRT_PRIVACY_POLICY_LABEL, will cause SDL/WinRT to create a link inside the Windows Settings charm, as invoked from within an SDL-based app.

Network-enabled Windows Phone apps do not need to set this hint, and should provide some sort of in-app means to display their privacy policy.  Microsoft does not appear to provide an OS-integrated means for displaying such on Windows Phone.
2014-01-01 16:05:37 -05:00
David Ludwig
02d00dd07d WinRT: d3d11 blend mode bug fixes
The destination target's alpha wasn't getting set correctly in many cases.  Among other problems, this prevented some alpha-blended textures from displaying correctly in Windows Phone 8's multitasking screen.

The d3d11 renderer now uses the same blending settings found in the d3d9 renderer.
2013-12-30 11:59:04 -05:00
David Ludwig
5264f889eb WinRT: minor error cleanup regarding OpenGL init 2013-12-26 14:21:47 -05:00
David Ludwig
4472396559 WinRT: took out some dead comments from SDL_winrtopengles.cpp 2013-12-26 14:13:20 -05:00
David Ludwig
64014dc3d8 WinRT: fixed crash on ARM and x64 during OpenGL window init 2013-12-26 13:59:01 -05:00
David Ludwig
ad7caf3267 WinRT: minor header file usage cleanup in the d3d11 renderer 2013-12-26 11:04:35 -05:00
David Ludwig
fd6014b877 WinRT: simplified the d3d11 vertex shader a bit
The projection and view matrices are now computed ahead of time, as they both get computed in the same spot, and typically not often.  If this does, however, become a performance problem later on, this change can always be reverted.
2013-12-26 11:03:43 -05:00
David Ludwig
a408c61485 WinRT: implemented SDL_RenderSetClipRect for the d3d11 renderer 2013-12-26 10:18:33 -05:00