Commit Graph

255 Commits

Author SHA1 Message Date
Ryan C. Gordon
3889d47887 Removed unused variable. 2014-03-02 22:55:12 -05:00
Ryan C. Gordon
0e5cc8dff4 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
86be83215a 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
460f97ff96 A bunch of fixes for the new Spaces code. 2014-03-02 16:36:40 -05:00
Sam Lantinga
da324233e2 Fixed dictionary initialization 2014-03-02 13:06:51 -08:00
Sam Lantinga
0f9bb0cda6 Updated to build on Mac OS X 10.7 with Xcode 4.6 2014-03-02 12:58:00 -08:00
Ryan C. Gordon
5eccbac4b9 Mac: Manage menubar and dock as FULLSCREEN_DESKTOP windows become/resign key. 2014-03-02 15:35:24 -05:00
Bastien Nocera
4ca76b3e59 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
2014-03-02 14:59:06 -05:00
Sam Lantinga
c2c08f68e4 Backed out changeset 9357a2ca3473 2014-03-02 11:10:00 -08:00
Sam Lantinga
2cf453dd3e Make sure we return version 0 if XInput detection fails 2014-03-02 11:08:05 -08:00
Ryan C. Gordon
51faf449bb 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
afc74d9843 Better attempt to detect available X11 XInput2 features.
Fixes Bugzilla #2306.
2014-03-02 02:00:40 -05:00
Ryan C. Gordon
fc0daeba75 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
1005c93402 Windows: Fixed crash if quitting without closing an XInput haptic device. 2014-03-02 00:02:56 -05:00
Ryan C. Gordon
754067db7e Added a FIXME. 2014-03-01 22:27:21 -05:00
Ryan C. Gordon
7fa4eece25 Fixed a typo in a comment. 2014-03-01 22:27:13 -05:00
Ryan C. Gordon
bafa4c7ae8 Dynamically load glGetString(), to avoid direct dependency on OpenGL. 2014-03-01 21:33:48 -05:00
Ryan C. Gordon
73936208b0 Added some FIXMEs. 2014-03-01 20:59:43 -05:00
Ryan C. Gordon
99583397e6 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
3e541f306d Force Windows version of SDL_GetPrefPath() to Unicode, create missing dirs.
Fixes Bugzilla #2273.
2014-03-01 20:28:40 -05:00
Sam Lantinga
63106e4729 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
54ba385b4e Fixed compiler warning 2014-03-01 11:42:12 -08:00
Sam Lantinga
86655b64ef Fixed compiler warning 2014-03-01 11:40:41 -08:00
Sam Lantinga
d49962359a Fixed test for libuuid.a 2014-03-01 11:39:39 -08:00
Sam Lantinga
2a67548a3f Updated with the latest 2.0.2 API changes 2014-03-01 11:05:58 -08:00
Sam Lantinga
c916f388d4 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
e663b4eb76 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: http://msdn.microsoft.com/en-us/library/windows/desktop/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
ab9345a896 Null termnate the pUserMappings variable to prevent memory corruption. 2014-02-28 16:24:41 -08:00
Sam Lantinga
e56bbe3f71 Added a hint to enable the screensaver by default 2014-02-28 14:23:41 -08:00
Ryan C. Gordon
ac32352f09 Disable the screensaver by default.
Fixes Bugzilla #2218.
2014-02-27 22:06:41 -05:00
Gabriel Jacobo
f61602b434 Improve window recreation logic in OpenGL* renderers 2014-02-27 20:21:46 -03:00
J?rgen P. Tjern?
0d5957dfee Mac: Forgot return value in last commit. 2014-02-26 16:27:03 -08:00
J?rgen P. Tjern?
dd94c5fa54 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?
4850d25988 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?
52a63e823f 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
2014-02-25 17:27:41 -08:00
J?rgen P. Tjern?
98d8737961 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?
95f7e242e6 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
2014-02-25 15:28:12 -08:00
Gabriel Jacobo
4c192bc802 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
CarniBlood
472068dd97 fixed gles/gles2 renderer creation fail on Android when default major/minor version doesn't match 2013-12-19 06:01:18 +09:00
Sam Lantinga
8db4c5a9d3 Fixed crash if the input data pitch is larger than the locked texture pitch 2014-02-25 10:04:49 -08:00
Sam Lantinga
b420ad0e01 Don't warp the mouse while we're doing a modal interaction 2014-02-24 23:09:35 -08:00
Sam Lantinga
2a6213ad02 Make sure we don't clip the cursor while clicking on the window title bar 2014-02-24 22:49:30 -08:00
Sam Lantinga
973d890b83 Fixed relative mouse mode with multiple windows.
The window cursor clipping will be taken care of when SDL_UpdateWindowGrab() is called.
2014-02-24 22:37:58 -08:00
Sam Lantinga
54debf84e4 Added a bunch of missing windows messages 2014-02-24 22:36:24 -08:00
J?rgen P. Tjern?
d6b1218b46 Mac: Fix inconsistent repeat of SDL_TEXTINPUT events on 10.7+
Due to the new "tap and hold" IME in Mountain Lion and above, we were getting
inconsistent repeat of SDL_TEXTINPUT events. Disabling that functionality (since
you can't see the popover anyway) solves this.

Bug: https://bugzilla.libsdl.org/show_bug.cgi?id=2387
2014-02-24 16:42:08 -08:00
Gabriel Jacobo
6ee12d6ccc Fixes #2296 - SDL_GL_UnbindTexture segfaults (thanks Daniel B?nzli) 2014-02-24 18:57:22 -03:00
Ryan C. Gordon
b814f23a21 CMake: Fixed build on Mac OS X. 2014-02-24 11:24:48 -05:00
Gabriel Jacobo
1084421cca Zero out haptic linked list items on creation
(thanks to Turo Lamminen for the report!)
2014-02-24 10:25:02 -03:00
Gabriel Jacobo
2ed47d8369 Fixes #2417, memory leak in SDL_gamecontroller.c (thanks Leonardo!) 2014-02-24 10:00:10 -03:00
Ryan C. Gordon
96f09df730 Free the correct variable. 2014-02-23 01:24:46 -05:00