Commit graph

7333 commits

Author SHA1 Message Date
Ryan C. Gordon
2f4bc4e5c3 Turn off Wayland support for Raspberry Pi on the buildbot.
It's picking up the system headers instead of the RPi build files.

Theoretically, we _can_ support Wayland on this platform, though, as there
 _is_ a Raspberry Pi port out there...
2014-04-19 02:26:12 -04:00
Ryan C. Gordon
bb1d40fa1d Fixed some issues reported on new Ubuntu 14.04 buildbots. 2014-04-19 02:17:34 -04:00
Sam Lantinga
cfe7cf1256 Fixed logic error loading DXGI 2014-04-18 12:43:10 -07:00
Sam Lantinga
92e29fd71f SDL_DXGIGetOutputInfo() checks input parameters and returns a boolean value whether or not it succeeded. 2014-04-18 12:43:04 -07:00
Jørgen P. Tjernø
f9029796d5 Mac: Don't prompt to reopen windows after crash.
We don't support state serialization / resume, so disable the prompt
that pops up asking if you want to reopen the windows.

--HG--
extra : rebase_source : 1343066a8e60de7731c864b3d940351747acb58c
2014-04-15 13:53:07 -07:00
Sam Lantinga
d1263a074d Fixed bug 2475 - Incorrect SDL_Log() format specifiers in test/testgesture.c
rettichschnidi

The floats should not be interpreted as integers. Patch against the current head attached.
2014-04-17 22:40:57 -07:00
Sam Lantinga
fbe8cee457 Fixed bug 2489 - SDL2.framework references __Block_copy in /usr/lib/libSystem.B.dylib, but this symbol cannot be found on OSX-10.5
Thomas Schatz

The dynamic library (extracted from SDL2-2.0.3.dmg and put in /Library/Frameworks/) references the __Block_copy symbol in /usr/lib/libSystem.B.dylib, which cannot be found:

dlopen(/Library/Frameworks/SDL2.framework/SDL2, 6): Symbol not found: __Block_copy
  Referenced from: /Library/Frameworks/SDL2.framework/SDL2
  Expected in: /usr/lib/libSystem.B.dylib

From what I could gather __Block_copy seems to be related to the blocks extension to the C programming language introduced by Apple since OSX-10.6 (see: http://thirdcog.eu/pwcblocks/). If this is indeed the case, I don't think the SDL2-2.0.3.dmg on the website is at all compatible with OSX-10.5 countrary to what is announced.
2014-04-17 22:23:32 -07:00
Dimitris Zenios
0e0eccbb61 Enable building of Android libraries using a standalone NDK 2014-04-06 00:30:48 +03:00
Sam Lantinga
399e1ddba7 Fixed bug 2496 - mouse left button double click event issue
cplu

When I double click on a window, the "clicks" field (newly added since 2.0.2) in SDL_MouseButtonEvent is 1 instead of 2.
However, when I "tripple" click, "clicks" field is then 2.
I'v look into the source code in SDL_windowsevents.c and found that when a double click event comes, WIN_WindowProc will get a WM_LBUTTONDBLCLK msg. The message sequence of a double click is:WM_LBUTTONDOWN->WM_LBUTTONUP->WM_LBUTTONDBLCLK->WM_LBUTTONUP.
2014-04-17 21:00:25 -07:00
Thomas Perl
bfd5629d47 Wayland: Resize windows with 0x0 requested size to screen size
This makes it in line with other platforms, where SDL_CreateWindow() with
width=0, height=0 and SDL_WINDOW_FULLSCREEN opens a fullscreen window.
2014-04-05 17:19:34 +02:00
Sam Lantinga
f1181dfd91 Fixed bug 2485 - [PATCH] Wayland: cursor disappears permanently after window loses mouse focus
Bryan Cain

Using any SDL application with the Wayland backend under Weston, if the application sets a cursor with SDL_SetCursor, the cursor will work until the mouse pointer leaves the window.  When the pointer re-enters the window, there will be no cursor displayed at all.

I did some digging, and the reason for this is that SDL attaches the buffer to the cursor surface only once (during cursor creation) and assumes that it will stay attached.  This is not how Wayland works, though - once the compositor is done rendering the buffer, it will release it, so it is no longer attached to the surface.  When the cursor re-enters the window a second time, SDL sets the cursor to the same surface with no buffer attached, so no cursor is displayed.

This is fixed by the attached patch, which makes SDL attach the buffer to the surface when the cursor is set, not when it is created.
2014-04-17 20:51:28 -07:00
Sam Lantinga
6c41ecc55e Fixed bug 2482 - Wayland_CreateSystemCursor trying to load nonexistent "wait" cursor
Bryan Cain

Wayland_CreateSystemCursor tries to load a cursor named "wait" for two of the system cursor categories.  This causes a segmentation fault when one of these cursors is used, because "wait" is not an actual cursor name in X11/Wayland cursor themes.

I can't attach my patch since I'm on a mobile right now, but I can confirm that simply replacing "wait" with "watch" for both of its uses in Wayland_CreateSystemCursor (in SDL_waylandmouse.c) fixes the bug.
2014-04-17 20:21:10 -07:00
Sam Lantinga
52a55bfbac Fixed bug 2477 - [PATCH] Joysticks do not work on RHEL6/CentOS6 systems
Ashley Whetter

RHEL6 and CentOS6 systems still use an old version of udev (147). It wasn't until udev 148 (Yep. 1 version off!) that the input class system changed from "ID_CLASS" to "ID_INPUT_{JOYSTICK,KEYBOARD,MOUSE,etc}" (http://lwn.net/Articles/364728/). Because SDL2 looks for the ID_INPUT_X field this means that it never detects any input devices on RHEL6 systems.

I've attached a patch which fixes the problem. If no input devices are detected with "ID_INPUT_X" then SDL will fallback to looking for the old style "ID_CLASS" udev field instead.
Because of the "big change" between udev versions I doubt it'll ever get upgraded on RHEL6, but because RHEL7 is on the way I don't know if this patch is worth merging. Hopefully it'll help anyone out that's having this problem though.
2014-04-17 20:18:50 -07:00
Sam Lantinga
3c0f97fd64 Fixed window losing the SDL_WINDOW_FOREIGN flag if something tries to recreate it. 2014-04-17 20:15:44 -07:00
Sam Lantinga
0d240d219e Fixed bug 2086 - valgrind memory not released
Sylvain

Someone provided a patch for this, recently on the mailing list :
-----

Hi,

it is possible to skip the bug in libX11 by using the defaults for
XNResourceName and XNResourceClass in `XCreateIC' (the table for the
"Input Context Values" [1] in libX11-doc shows that a default is
provided if it is not set).

diff -ur SDL2-2.0.3~/src/video/x11/SDL_x11window.c SDL2-2.0.3/src/video/x11/SDL_x11window.c
--- SDL2-2.0.3~/src/video/x11/SDL_x11window.c   2014-04-04 17:09:40.764307181 +0200
+++ SDL2-2.0.3/src/video/x11/SDL_x11window.c    2014-04-04 17:10:23.887765046 +0200
@@ -239,8 +239,7 @@
         data->ic =
             X11_XCreateIC(videodata->im, XNClientWindow, w, XNFocusWindow, w,
                        XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
-                       XNResourceName, videodata->classname, XNResourceClass,
-                       videodata->classname, NULL);
+                       NULL);
     }
 #endif
     data->created = created;


Tito Latini

[1] http://www.x.org/releases/X11R7.7-RC1/doc/libX11/libX11/libX11.html#Input_Context_Values
2014-04-17 20:06:02 -07:00
Sam Lantinga
02e2f45a96 Fixed bug 2502 - Memory leak inside SDL_x11events.c -> X11_DispatchEvent(_THIS)
bojko_1000

Code @566:
            if (data->xwindow) {
                Atom _net_frame_extents = X11_XInternAtom(display, "_NET_FRAME_EXTENTS", 0);
                Atom type = None;
                int format;
                unsigned long nitems = 0, bytes_after;
                unsigned char *property;
                X11_XGetWindowProperty(display, data->xwindow,
                    _net_frame_extents, 0, 16, 0,
                    XA_CARDINAL, &type, &format,
                    &nitems, &bytes_after, &property);

                if (type != None && nitems == 4)
                {
                    border_left = ((long*)property)[0];
                    border_right = ((long*)property)[1];
                    border_top = ((long*)property)[2];
                    border_bottom = ((long*)property)[3];
                }
            }

Code after _the fix_:
            if (data->xwindow) {
                Atom _net_frame_extents = X11_XInternAtom(display, "_NET_FRAME_EXTENTS", 0);
                Atom type = None;
                int format;
                unsigned long nitems = 0, bytes_after;
                unsigned char *property;
                X11_XGetWindowProperty(display, data->xwindow,
                    _net_frame_extents, 0, 16, 0,
                    XA_CARDINAL, &type, &format,
                    &nitems, &bytes_after, &property);

                if (type != None && nitems == 4)
                {
                    border_left = ((long*)property)[0];
                    border_right = ((long*)property)[1];
                    border_top = ((long*)property)[2];
                    border_bottom = ((long*)property)[3];
                }
                X11_XFree(property);
            }

I have found that leak with valgrind.
2014-04-17 20:02:11 -07:00
Sam Lantinga
6ed15e04e5 Fixed bug 2503 - Loop indexing and event union errors in SDL_gesture.c
Lasse Öörni

While enabling $1 gesture support in the Urho3D engine which uses SDL2 I detected some errors in the gesture code in SDL_gesture.c:

- In the function SDL_SaveAllDollarTemplates() the following line should use index variable j instead of i:

    rtrn += SaveTemplate(&touch->dollarTemplate[i], dst);

- In the function SDL_SaveDollarTemplate() the following code should use index variable j instead of i:

    if (touch->dollarTemplate[i].hash == gestureId) {
        return SaveTemplate(&touch->dollarTemplate[i], dst);

- In the function SDL_SendGestureDollar() the x & y coordinates are being written to the mgesture structure, which results in garbage due to dgesture and mgesture being different data structures inside the union. The coordinates should be written to dgesture.x & dgesture.y respectively
2014-04-17 19:52:15 -07:00
Sam Lantinga
7f986f36f2 Updated configure with Brandon Schaefer's changes 2014-04-17 17:24:27 -07:00
Brandon Schaefer
c8df715775 Add DIRECTFB_CFLAGS to SDL_CFLAGS so its cflags will get added to the sdl2.pc 2014-04-17 14:02:21 -07:00
Brandon Schaefer
5355c554b2 Add MIR_CFLAGS to SDL_CFLAGS so these cflags are added to the sdl2.pc file. 2014-04-17 13:58:39 -07:00
David Ludwig
96c1989ddb WinRT: keyboard VirtualKey translation improvements from Sylvain Becker
Changes included:
- adding support for a few, additional, VirtualKey constants
- removing accesses to 'windows_scancode_table', as the table's contents
don't line up with WinRT virtual keys.  Using Windows older VK_* constants
may, however, be a good alternative in a future update.
2014-04-17 12:43:51 -04:00
Gabriel Jacobo
73340e35e6 Comment out eglWaitGL from Android_GLES_SwapWindow
Let's hope for the best! If anyone has a device affected by this removal,
please file a bug!
2014-04-17 12:44:08 -03:00
Ryan C. Gordon
184e944eee Minor change to a README to test Mercurial server.
--HG--
extra : rebase_source : 0d64ff8c5d705f5615a6aa525336905b98de271f
2014-04-12 17:40:55 -04:00
David Ludwig
d13884bf35 Added a README file regarding WinRT support
To note, this file is currently formatted with CRLF line endings, rather than
LF, to allow the file to be viewed with Notepad.
2014-04-09 21:29:19 -04:00
Sam Lantinga
4d9b83a876 Fail if we couldn't create the specified renderer 2014-04-05 16:25:30 -07:00
Philipp Wiesemann
e68f76da43 Removed empty statements. 2014-04-05 23:50:09 +02:00
Philipp Wiesemann
bbfa480b80 Fixed names of four hint environment variables. 2014-04-05 23:32:41 +02:00
Philipp Wiesemann
5e41b5887c Fixed unused local variable warning. 2014-04-05 23:24:33 +02:00
Philipp Wiesemann
274ec047ed Fixed typos in header comments. 2014-04-05 23:22:21 +02:00
Philipp Wiesemann
8158274826 Removed unused variable from test program. 2014-04-04 23:56:15 +02:00
Philipp Wiesemann
75fb3c2c6c Fixed doxygen comment in header. 2014-04-04 23:52:23 +02:00
David Ludwig
78755d7572 WinRT: "SDL" to "SDL2", both for .dll output files, and for MSVC project names.
All WinRT builds of SDL will now output, "SDL2.dll".  Previously, the Windows
8.x/RT builds would output, "SDL.dll", and Windows Phone 8 builds would output,
"SDL_WinPhone.dll".  The change to "SDL2.dll" puts WinRT dll naming in-line with
that seen on Win32.

SDL/WinRT's MSVC project files will now appear as either "SDL2-WinRT" or
"SDL2-WinPhone", when displaying in MSVC.

This set of changes should not break any older WinRT or Windows Phone 8 app
builds that rely on MSVC's Project-to-Project reference system to build SDL2 for
the correct platform(s), and to install SDL2 dll files into the apps' output
packages.  App builds that reference SDL dll files directly should, however,
now reference "SDL2.dll".

--HG--
extra : rebase_source : cab688db2d74f9a60f7937fa1ab53475cbd59229
2014-03-30 11:50:59 -04:00
Sam Lantinga
d6d4c108fd Fixed the joystick side of XInput haptic detection on Windows 8 2014-03-31 10:38:26 -07:00
Sam Lantinga
492dbb3124 Fixed XInput haptic support on Windows 8
It turns out the XBox 360 controller driver never reports force feedback capability, so we'll try to set 0 state and see if that succeeds.
2014-03-29 12:29:38 -07:00
Sam Lantinga
07f74cbbcc Fixed assertion loading button.bmp in testgamecontroller 2014-03-29 12:27:27 -07:00
Sam Lantinga
b2f1b89fbd Added testrumble to the Visual Studio 2013 solution 2014-03-29 12:27:02 -07:00
Ryan C. Gordon
ee2b15aebc Raspberry Pi builds should upload as .tar.xz instead of .tar.bz2.
Makes the archive about 40-50% smaller!

--HG--
extra : rebase_source : adac7393b54fb8c05cb868858c968da87f3d7199
2014-03-28 09:59:32 -04:00
Ryan C. Gordon
c36617ceb6 Changed a C++ single-line comment to /* */ style. 2014-03-26 16:19:52 -04:00
Pierre-Loup A. Griffais
6f15c8a12c Remove the RaiseWindow call from OnWindowRestored for now.
It seems like a net improvement in all the scenarios Sam and I could
think of, and looking at hg history it was added for fullscreen
window management specifically. Much of that code has changed since
then, but maybe it needs to stay there for that and simply be moved
to a fullscreen condition check.

It would solve this issue:

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

As well as cases where on SteamOS, we hide/show specific Steam
overlay windows while expecting them to stay in the background, since
changing the window stacking order really angers the NVIDIA driver.

CR: Sam.
2014-03-26 12:54:51 -07:00
Brandon Schaefer
a08cc19712 Ignore unused mir event functions, need headers in Ubuntu 14.04 to use them. 2014-03-25 15:24:43 -07:00
Brandon Schaefer
61f0c01d38 Remove two unused variables, causing compiler warnings. 2014-03-25 15:18:18 -07:00
Brandon Schaefer
fdf9b30018 Re-enable Mir/Wayland support now that 2.0.3 has been released. 2014-03-25 14:33:34 -07:00
David Ludwig
0755238527 WinRT: Call IDXGIDevice3::Trim before app-suspend, as required on Windows 8.1
Thanks to Sylvain Becker for pointing this out!
2014-03-24 22:51:03 -04:00
David Ludwig
710797c3dd WinRT: Line ending fixes (CRLF to LF) 2014-03-24 22:12:38 -04:00
Gabriel Jacobo
e79e6a8637 Fixes #2456, controllermap's undo does not work correctly (by Bogdan Marinov) 2014-03-24 11:42:09 -03:00
Gabriel Jacobo
5d949ece7b Emit SDL_RENDER_DEVICE_RESET on Android when the GLES context is recreated 2014-03-24 11:04:42 -03:00
Ryan C. Gordon
b515741ed4 Added an assert to help static analyzer. 2014-03-24 07:12:26 -04:00
Sam Lantinga
c0e9a9afaf Added an event SDL_RENDER_DEVICE_RESET, which is triggered on Direct3D 11 when the device has been lost and all textures need to be recreated. 2014-03-23 23:09:22 -07:00
Sam Lantinga
4d02b5b07d Fixed warning on Mac OS X 2014-03-23 23:08:26 -07:00
Sam Lantinga
ce92ee5307 Fixing Alt-Enter handling, submitted by Nader Golbaz
I encountered a little issue: DXGI monitors application's message queue and this behavior interferes with SDL if the application already handles Alt-Enter sequence. I think it is necessary to disable this behavior.
bb174540%28v=vs.85%29.aspx
2014-03-23 22:53:50 -07:00