Commit Graph

5672 Commits

Author SHA1 Message Date
Gabriel Jacobo
debca5dd7d Bug 1786 - memory leak in WIN_GetDisplayModes by Marcel Bakker 2013-04-24 11:49:52 -03:00
Andreas Schiffler
fefdf1b2d1 Fix double free in video test suite 2013-04-23 20:45:49 -07:00
Jørgen P. Tjernø
d35ddf266b Mac: Fix cursor not updating when re-focusing the window.
This fixes a bug where [NSCursor set] doesn't take when called in
certain event handlers (like windowDidBecomeKey:).

http://bugzilla.libsdl.org/show_bug.cgi?id=1795
2013-04-23 18:47:44 -07:00
Jørgen P. Tjernø
c62b60671d Mac: Fix unmatched hide/show cursor calls.
This tracks the previous hide/unhide state of the cursor, so we don't
re-hide a hidden cursor.
2013-04-23 18:47:41 -07:00
Jørgen P. Tjernø
733eb53c6f Mac: Make mouse movement smooth at edge of window when grabbed.
There's a limit of one update every 250ms when warping the mouse, and we
can work around that by disassociating the cursor & the mouse before
issuing our warp, then re-associating them.
2013-04-23 18:47:38 -07:00
Jørgen P. Tjernø
f23a05cdee Make sure to send MOUSEMOTION on window enter.
This should hopefully fix bug #1612. We now send mousemotion events when
the cursor enters the window as well as when it leaves.

Thanks to Alex Szpakowski for the fix.

Fixes http://bugzilla.libsdl.org/show_bug.cgi?id=1612
2013-04-23 18:47:32 -07:00
Gabriel Jacobo
de33c6164e Fixes PSP_DestroyTexture release of data (don't release the SDL_Texture pointer) 2013-04-23 16:54:52 -03:00
Gabriel Jacobo
d1ec7f2e3c Moved warning about SDL_AndroidGetActivity to SDL_system.h 2013-04-23 16:44:54 -03:00
Andreas Schiffler
679ad5712e Disable one test that crashes audio suite when run together with other tests 2013-04-23 08:19:21 -07:00
Andreas Schiffler
24bc0eca2d Add tests to audio suite 2013-04-23 08:07:52 -07:00
Jørgen P. Tjernø
abb960c20a Add multimon & mouse tracking info to SDL_test_common. 2013-04-22 18:15:10 -07:00
Jørgen P. Tjernø
a228e5242a SDL_GL_DeleteContext would leave an invalid current_glctx.
Calling SDL_GL_DeleteContext wouldn't update current_glctx, so you could
end up with use-after-free and other goodies when you deleted a context.
2013-04-22 18:15:08 -07:00
Jørgen P. Tjernø
cc1860f252 Forgot to add this file to Mac crash fix. 2013-04-22 18:15:00 -07:00
Jørgen P. Tjernø
119316f54a Send mouse leave updates for Windows and X11.
We now generate a final SDL_MOUSEMOTION before the cursor leaves the
window, followed by a SDL_WINDOWEVENT_LEAVE.
2013-04-22 18:14:55 -07:00
Jørgen P. Tjernø
f448a8ba7c Make Cocoa_ShowMessageBox work in background threads. 2013-04-22 18:14:32 -07:00
Jørgen P. Tjernø
80ce87f3a1 Fix Mac crash when creating fullscreen window introduced in 9d43403e9fc5.
makeKeyAndOrderFront: was sending three KVO transitions for isVisible,
for false -> true, true -> false, and then false -> true. This was
causing an infinite recursion.

We now suspend monitoring of the KVO before makeKeyAndOrderFront, then
resume afterwards and send any changes in isVisible's state.
2013-04-22 18:14:26 -07:00
VALVE\alfred@alfredlinux.valvesoftware.com
f8eb6524ec - make sure to send a joy removed event even if the joystick wasn't opened under OSX 2013-04-22 15:24:35 -07:00
Jørgen P. Tjernø
32c9eef670 Mac no longer loses OpenGL context when window is hidden.
This fixes an issue that would arise when you minimize / order out an
OpenGL window on Mac, where the window would lose it's window device.
Without a window device, you cannot render to the window.

It does so by making two changes:
  - Windows are no longer "oneShot" (which caused their window device to
    get destroyed when they're minified or ordered out)
  - Windows are no longer "deferred" (which caused the OS to defer
    window device creation until the window is shown, which meant that
    we couldn't properly makeCurrent to it)

Thanks to http://www.mikeash.com/pyblog/nsopenglcontext-and-one-shot.html
2013-04-22 12:07:16 -07:00
Jørgen P. Tjernø
0a2d80b427 Properly reflect hidden/shown windows on OSX.
This fixes a bug where windows would always be considered to be in the
shown/hidden state they were originally created in.
2013-04-22 12:07:13 -07:00
Gabriel Jacobo
188bcf698a Fixes #1815, don't release the LocalRef returned by SDL_AndroidGetActivity 2013-04-22 11:18:45 -03:00
David Ludwig
95a3bba282 future-proofing for Microsoft's C++/CX extensions, whereby "generic" is a reserved keyword 2013-04-20 23:05:08 -04:00
Jørgen P. Tjernø
84b7ed93dc Fix overflow in recent gamecontroller trigger change. 2013-04-19 16:02:16 -07:00
Jørgen P. Tjernø
2a4188c11f Make gamecontroller triggers have values in 0 - 32767.
This changes the old behavior of having values in the -32768 - 32767
range, like regular joystick axis. Now "button as axis" triggers (like
on Logitech controllers) and regular axis triggers (like on Xbox
controllers) have the same resting value, 0.
2013-04-19 10:51:21 -07:00
Gabriel Jacobo
4881297e05 Fix for bug #1776 by Jonathan Dearborn 2013-04-19 14:40:39 -03:00
Gabriel Jacobo
6ff972260a Fixes bug #1709, pthread tests fixes for CMake (Thanks Scott Percival!) 2013-04-19 13:25:39 -03:00
Ryan C. Gordon
8cc072db1b Fixed using the event queue lock before the mutex was created.
This has the benefit of ending the otherwise-bogus complaints that
 SDL_GetError() reports "Passed a NULL mutex" if you call it instead of
 checking if SDL_CreateWindow() actually succeeded.  :)
2013-04-19 11:58:38 -04:00
Ryan C. Gordon
7cdcd5bebb Cleaned up the const_cast mess a little. 2013-04-16 01:38:08 -04:00
Ryan C. Gordon
295c17e99b Don't use glDisable(GL_TEXTURE_2D) in GLES2 renderer.
Fixes Bugzilla #1799.
2013-04-17 11:45:50 -04:00
Andreas Schiffler
4e8c854aab Fix bug 1789: SDL_IntersectRect intersection with empty rect does not set result to empty; add test coverage to Rect suite 2013-04-17 08:09:11 -07:00
Andreas Schiffler
fc589bd617 Fix bug 1764: incorrect variable assignment in RenderDrawLinesWithRects 2013-04-17 07:35:30 -07:00
Sam Lantinga
ab2a7e61cf Fixed bug 1805 - Memory Leak issue in src/video/x11/edid-parse.c file
Nitz

In Function,

MonitorInfo *
decode_edid (const uchar *edid)

In this function "info" is going out of scope and leaks the storage it points to, if the first if condition get true:
if (!decode_header (edid))
        return NULL;

So while returning from this if statement there should be free for "info" pointer.
2013-04-17 01:38:59 -07:00
Sam Lantinga
6b599f9c89 Fixed bug 1804 - Memory leak issue in src/video/x11/SDL_x11mouse.c
Nitz

In SDL_x11mouse.c file there is function named
static Cursor
X11_CreatePixmapCursor(SDL_Surface * surface, int hot_x, int hot_y)
{
  // Some code

  data_bits = SDL_calloc(1, surface->h * width_bytes);
  mask_bits = SDL_calloc(1, surface->h * width_bytes);
  if (!data_bits || !mask_bits) {
     SDL_OutOfMemory();
     return None;
  }

 // Some code

}

Here is the problem in if statement,
suppose if !data_bits is false and !mask_bits is true then,
data_bits will go out of scope and leaks the memory it points to.

Solution is that data_bits and mask_bits should be checked separately, not by using OR operator.
2013-04-17 01:35:10 -07:00
Sam Lantinga
4f8c0f33f9 Fixed bug 1802 - NULL pointer dereference in SDL_AllocRW() if out of memory.
Philipp Wiesemann

There is a NULL pointer dereference in SDL_AllocRW() if the system is out of memory. The "type" field is always written. This may be fixed with an early return.

Or an else{} or not writing the field and using slower SDL_calloc().

This fault was recently introduced (http://hg.libsdl.org/SDL/rev/681820ca0e78).
2013-04-17 01:32:06 -07:00
Sam Lantinga
ec2f595166 BMP files don't contain alpha information in the palette, the fourth element is reserved and must be zero. 2013-04-16 09:33:33 -07:00
Ryan C. Gordon
98dc9306b5 Removed C++-style single-line comments from a public header (thanks, Martin!).
Fixes Bugzilla #1803.
2013-04-16 01:05:32 -04:00
Ryan C. Gordon
cb5cba6397 Maybe actually fix compiler warning this time. 2013-04-16 00:09:48 -04:00
Ryan C. Gordon
df8125df4b Fixed a compiler warning on Visual Studio. 2013-04-15 22:49:23 -04:00
Ryan C. Gordon
006f31e2ec Make the new SDL_RWops::hidden::unknown::data2 field a void*, not an int. 2013-04-14 18:05:14 -04:00
Ryan C. Gordon
1e6e7727c6 Added a data2 field to the SDL_RWops::hidden::unknown.
This shouldn't change the ABI, since this struct had space left in the union.
2013-04-13 20:43:32 -04:00
Andreas Schiffler
94f59c7e7c Add test coverage for SDL_SetWindowData and SDL_GetWindowData to Video suite 2013-04-13 09:45:39 -07:00
Ryan C. Gordon
a5ca62ea98 Fixed a typo (thanks, Ethan!). 2013-04-10 22:18:10 -04:00
Jørgen P. Tjernø
8405633512 Numlock & pause fix from Alfred.
Fix numlock and pause keys not being pressable on win32, they both report under
the same scancode, so use the VK to tell them apart
2013-04-10 14:11:26 -07:00
Ryan C. Gordon
f77b979436 More const_cast fixes for C++ apps using the public headers (thanks, Martin!). 2013-04-08 18:37:50 -04:00
Ryan C. Gordon
1a2d04cab5 Fixed another infinite recursion accident in stdlib. 2013-04-05 16:34:59 -04:00
Ryan C. Gordon
76435d933b Corrected some stdinc inline functions (thanks, Martin!).
qsort() returns void, so remove the "return" keyword, plus some C++
 const_casting magic.

 Fixes Bugzilla #1785.
2013-04-04 11:35:22 -04:00
Jørgen P. Tjernø
6337624232 Improve testgamecontroller output & robustness. 2013-04-03 16:48:23 -07:00
Jørgen P. Tjernø
7f8886048e Add 3 Logitech gamecontroller mappings for Mac OS X. 2013-04-03 16:48:20 -07:00
Ryan C. Gordon
7635069643 Fixed compiler warnings in Mac Xcode builds. 2013-04-03 11:58:04 -04:00
Ryan C. Gordon
f3c21ea99e Another attempt at fixing compiler warnings for SDLTest_SurfaceImage_t. 2013-04-03 11:49:25 -04:00
Ryan C. Gordon
5b551af664 Compiler warning fixes for Windows message box code. 2013-04-03 11:48:03 -04:00