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
--HG--
extra : histedit_source : 3f150addd3b1b7bc6397aba60ccf05f9065ffb8c
This tracks the previous hide/unhide state of the cursor, so we don't
re-hide a hidden cursor.
--HG--
extra : histedit_source : d41e30a604fb9ff0da8fcfdd9ca926618e35c750
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.
--HG--
extra : histedit_source : 91ddf6078107ea9faf1c769a459e99bce6e61180
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
--HG--
extra : histedit_source : e89e8952efcc07da98a306757edeaeded31517a9
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.
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
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.
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. :)
--HG--
extra : rebase_source : 49ed52691094eab9dd4012bb97f32fbcc678551e
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.
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.
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).
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
--HG--
extra : histedit_source : ea129a468bd8ca3164b1aaea0fa143cf2e130b7b