Commit Graph

12926 Commits (4d63c919f9b0c2bb68e714b72ec7eb3445a113d1)

Author SHA1 Message Date
Frank Praznik bad4f4e5ac wayland: Destroy proxy wrappers before and callbacks before event queues
Destroy any proxy wrappers and callbacks before the associated event queues to silence libwayland warnings about destroying the queues while proxies are still attached.
2023-04-18 14:37:16 -04:00
Sylvain bbdde648d8 Android: let main return normally for testautomation 2023-04-14 12:26:12 +02:00
Sylvain 7afe735b5f SDL_test: add more color when success/fail/skip 2023-04-14 12:12:45 +02:00
Sylvain 117169d610 Android AAUDIO: handle multiple devices 2023-04-14 11:31:47 +02:00
Sylvain f38cb0d06f Android: don't add telephony device, as it cannot be opened 2023-04-14 11:31:27 +02:00
Simon McVittie c335e3db82 test/template.test.in: Pass SDL_NONINTERACTIVE_ARGUMENTS to installed-tests
Otherwise they'll try to run with no arguments, and fail, when run by
ginsttest-runner.

Fixes: 81ca9d61 "cmake+test: add more automated tests + use properties"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-04-12 15:04:11 +00:00
Ozkan Sezer dfff017fc6 testaudiocapture.c: added missing return statement to main() 2023-04-12 12:56:10 +03:00
Ozkan Sezer c41a76657e SDL_timer.c: silence a minor warning. 2023-04-12 12:55:40 +03:00
Sylvain 0a33ed7a2b testaudiocapture: let main exit normally 2023-04-12 11:43:20 +02:00
Sylvain c101e719fd testprogram: let main() return normally, don't exit for platform (eg Android) where there is some cleanup afterward. 2023-04-12 11:37:26 +02:00
Sylvain ec053ec4f8 Android: need to save/restore the swap interval / vsync
otherwise, there is a difference of framerate, either with gles2 or SDL_renderer (testspriteminimal, testgles2).
2023-04-12 11:09:59 +02:00
Frank Praznik 8162d6659a wayland: Use the integer buffer scale event when applicable
wl_compositor v6 introduces the preferred buffer scale event, which serves a similar function to the fractional scale protocol, but deals in integer scale factors. Listen to this event when the wl_compositor version is >= 6 and the fractional scale protocol is not present to set the scale factor for surfaces.
2023-04-10 10:16:33 -04:00
Sam Lantinga 05b701f12e Fix win32 windows with WS_EX_COMPOSITED style continuing to receive WM_PAINT messages after ValidateRect
- Composited windows seem to need to actually paint (or appear to paint) through calls to Begin/EndPaint to properly validate
  their update region. If not done they will continue to receive WM_PAINT messages for the same region.
2023-04-07 06:20:28 -07:00
Sam Lantinga 17bdea7a91 Fix pop-up windows changing position for each HideWindow()/ShowWindow() cycle
When X11_UpdateWindowPosition() was called and the position didn't update
we would fire an SDL_EVENT_WINDOW_MOVED event with the global x,y for
the pop-up instead of the relative position for the pop-up.

This change ensures we always have a relative position for pop-ups before sending
the SDL_EVENT_WINDOW_MOVED event.
2023-04-06 15:12:09 -07:00
Sam Lantinga 92821f7a82 Fixed Visual Studio warning 4389: '==': signed/unsigned mismatch 2023-04-06 15:11:56 -07:00
Sam Lantinga acadb6f873 More defensive coding against dangling device pointers 2023-04-06 11:33:27 -07:00
Sam Lantinga 1a20ccb289 Clarified the expected sensor value when a game controller is at rest 2023-04-06 09:55:01 -07:00
Sam Lantinga 558bbbb07a The latest Armor-X Pro firmware update fixes the sign on the Z axis of the sensors 2023-04-06 09:55:01 -07:00
Sylvain 3c703f2061 Android: message to indicate that main() is called for the 1 or n'th time 2023-04-06 10:08:07 +02:00
Cyril Dubet 60dcaff7eb Fix key code names for ISO keyboard layouts 2023-04-05 17:03:05 -07:00
Sam Lantinga 73b2faea4e The macOS minimum deployment target is now 10.11
Xcode 14.3 does not allow targeting 10.9, the minimum recommended version is 10.13 and the minimum possible version is 10.11.
2023-04-05 11:37:27 -07:00
Sam Lantinga e13b74ccf0 Fixed crash if joystick->hwdata != NULL && device->driver == NULL
This should never happen, but we're seeing it in the wild, so make sure that we can never call into a NULL device driver.
2023-04-05 11:24:27 -07:00
Frank Praznik a21ee02095 wayland: Use the output description from wl_output as of v4
xdg-output names and descriptions are deprecated in favor of those provided by the core wl_output protocol as of v4. Bump wl_output support to v4 and ignore the xdg-output description in favor of the wl_output description when appropriate.
2023-04-05 10:24:23 -04:00
Frank Praznik 5c27bc81d8 wayland: Use release for display and seat objects, if available
wl_seat and wl_output gained release methods, which should be preferred over destroy methods if they are available.

Bumps wl_output to version 3.
2023-04-05 10:24:23 -04:00
Frank Praznik 9084b6c666 wayland: Remove some unused variables 2023-04-05 10:24:23 -04:00
Ethan Lee 3ac48053bc wayland: Minor whitespace cleanup
Co-authored-by: Frank Praznik <frank.praznik@gmail.com>
2023-04-05 08:58:12 -04:00
Anonymous Maarten c721155b89 cmake: prepend generated wayland protocol include path 2023-04-05 08:58:12 -04:00
David Edmundson 0c551e7069 wayland: Support axis relative direction
This allows clients to be aware of "natural scrolling" settings in the
compostior and adjust accordingly to optionally keep the same wheel and
trackpad behaviour accross platforms.

Testing using the "testmouse" example, behaviour in the demo is now the
same regardless of the compositor setting for scrolling.
2023-04-05 08:58:12 -04:00
Anonymous Maarten ac72cdcf79 Fix -Wmissing-prototypes warning
./src/video/SDL_video.c:1734:13: warning: no previous prototype for function 'SDL_CreateWindowInternal' [-Wmissing-prototypes]
SDL_Window *SDL_CreateWindowInternal(const char *title, int x, int y, int w, int h, SDL_Window *parent, Uint32 flags)
            ^
./src/video/SDL_video.c:1734:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
SDL_Window *SDL_CreateWindowInternal(const char *title, int x, int y, int w, int h, SDL_Window *parent, Uint32 flags)
^
static
2023-04-05 05:39:48 +02:00
Anonymous Maarten 029e61a07e cmake: split SDL_NEON into SDL_NEON and SDL_NEON_BLITTERS 2023-04-04 15:55:02 -07:00
Sam Lantinga cf2c6fa58d Fixed crash if dbus can't be initialized 2023-04-04 12:34:00 -07:00
Sylvain 407b85c506 Android: audio change audio assert when try to open concurrent device to a real error 2023-04-04 09:43:01 +02:00
Frank Praznik a874f6c993 wayland: Send system timestamps for relative pointer events 2023-04-02 10:51:37 -04:00
Frank Praznik 1869e1247d wayland: Track the serial numbers for implicit grab events and use them when raising windows
Track the serial numbers of key events, mouse button presses, touch down events, tablet tool down events, and tablet button presses, and pass the serial, along with the seat, to the xdg-activation protocol when raising windows to increase the chances of it succeeding.
2023-04-02 10:51:37 -04:00
Frank Praznik 6119ac8bb4 wayland: Don't round trip when setting the initial minimized and maximized states during window creation
Don't perform a round trip when setting the minimized and maximized window states during initial window creation, as it will be done later in the window creation process.
2023-04-02 10:51:37 -04:00
Frank Praznik ab948123c2 wayland: Avoid recursive calls into fullscreen setting functions
When changing the fullscreen state and performing a roundtrip, more than one configure event can be sent before getting the event that changes the fullscreen state. Don't change the higher-level window state and avoid recursive calls back into the video system during these events.
2023-04-02 10:51:37 -04:00
Frank Praznik 1f177cf93e wayland: Refactor constraint handling
According to the xdg-shell spec, xdg-toplevel min/max values are just hints, which compositors are free to ignore, and they often do so in several cases (usually when tiling, maximizing, or entering fullscreen). Even with the hints set, manually constraining the surface dimensions for non-maximized, non-fullscreen surfaces is required for consistent behavior.

In the case of maximized windows, the dimensions as specified in the configure event are non-negotiable and must be respected by the client, as not doing so is a protocol violation.

This also eliminates some redundant calls to set the libdecor resizable state, which can cause unnecessary commits internally.
2023-04-02 10:51:37 -04:00
Sam Lantinga 2aa2fa5449 Added SDL_CreateWindowWithPosition()
It turns out there's a race condition on X11 where the window could be placed by the window manager while being placed by the application, so we need to have the initial position available at window creation.
2023-03-31 17:21:44 -07:00
Anonymous Maarten b6ae281e97 Use #ifdef/#ifndef instead of #if defined/#if \!defined 2023-03-30 21:35:01 +00:00
Sam Lantinga 308bcbbe76 Fixed Visual Studio warning 4244 2023-03-30 14:04:32 -07:00
Sam Lantinga 85ee1498a5 Fixed Visual Studio warning 4245 2023-03-30 14:02:06 -07:00
Sam Lantinga f341c06552 Fixed Visual Studio warning 4310 2023-03-30 14:02:05 -07:00
Sam Lantinga 0bd77a5b93 Fixed Visual Studio warning 4389 2023-03-30 14:02:04 -07:00
Sam Lantinga d135daad5b Fixed Visual Studio warning 4459 2023-03-30 14:02:03 -07:00
Sam Lantinga b078122c53 Fixed Visual Studio warning 4701 2023-03-30 14:02:02 -07:00
Sam Lantinga 28d687aae0 Fixed Visual Studio warning 4702 2023-03-30 10:48:50 -07:00
Sam Lantinga e2f560d4bb Fixed build error
'__inline__' is not at beginning of declaration [-Werror=old-style-declaration]
2023-03-30 10:48:48 -07:00
Frank Praznik 1fd15c9b4e x11: Don't allow the changing of certain scancodes
The X11 driver uses scancodes derived from keysyms to map the scancodes for extended keys to the physical keyboard, however, this can be incorrect when using certain XKB options (e.g. caps:swapescape), which changes the keysyms emitted by certain keys, but does not imply that their scancodes or positions should be altered. Mark selected scancodes as being non-remappable so that their scancodes aren't changed by toggling XKB mapping options.
2023-03-30 11:25:23 -04:00
Sam Lantinga 655a07bdd8 Don't probe for PlayStation controllers when we already know the controller type
Fixes https://github.com/libsdl-org/SDL/issues/7556
2023-03-30 07:36:40 -07:00
Sam Lantinga a67d410501 Fixed analog triggers on the DualSense controller 2023-03-30 07:25:49 -07:00