Commit Graph

14428 Commits

Author SHA1 Message Date
Ryan C. Gordon
49b5cfa6c5 x11: check if window size/position has changed during SDL_ShowWindow.
Fixes #4216.
2023-06-07 15:42:22 -04:00
Sam Lantinga
dc06116c71 Steam sets the device version of the Steam Virtual Gamepad to 0, for the best compatibility with old games 2023-06-06 12:33:48 -07:00
Sam Lantinga
d032492aab Fixed detecting Bluetooth Steam Controllers on Windows 2023-06-05 21:28:12 -07:00
Sam Lantinga
17c397f7ec Save the error code before doing any other operation
SDL_ClearError() resets the Win32 error code to 0
2023-06-05 21:18:49 -07:00
Sam Lantinga
6e7769cde1 Fixed detecting Bluetooth Steam Controllers 2023-06-05 19:52:00 -07:00
Sam Lantinga
6150b5b3cb Don't bother re-encoding Latin1 characters in the ASCII range 2023-06-04 05:37:06 -07:00
Sam Lantinga
491ae20d96 Only convert the result of XLookupString() if it's not already UTF-8
Fixes https://github.com/libsdl-org/SDL/issues/7766
2023-06-04 02:50:03 -07:00
Sam Lantinga
c369b90019 Fixed SDL_iconv_string() truncation when handling SDL_ICONV_E2BIG 2023-06-04 01:01:06 -07:00
Sam Lantinga
d40695115f Cleaned up Alt-Enter/Ctrl-Enter fullscreen toggle logic
Alt-Enter will go from the current state to fullscreen desktop, or if already there, will leave fullscreen mode.
Ctrl-Enter will go from the current state to exclusive fullscreen mode, or if already there, will leave fullscreen mode.
2023-06-03 23:24:21 -07:00
Rusty Moyher
052a9d3284 macOS: Removed the fullscreen blanking window
- Removed the blanking window used in SDL_WINDOW_FULLSCREEN. This allows CMD + Tab to work.
- Changed the fullscreen NSWindow level so this works properly.

Fixes issue #7776
2023-06-03 23:05:09 -07:00
Sam Lantinga
fa41ece65f Allow other applications to open controllers on macOS 2023-06-03 11:53:36 -07:00
Sam Lantinga
6815e75caf Steam uses a different VID/PID for the Steam Virtual Gamepad on Windows 2023-06-03 11:39:03 -07:00
Sam Lantinga
5f00147e61 Revert "Fixed detection of the Steam Virtual Gamepad on macOS"
This reverts commit 5fcd70578b.

Steam has been updated to send a version of 1 to avoid conflicts with controllers that report a version of 0.
2023-06-03 11:35:27 -07:00
Ozkan Sezer
0c862d9a55 added compiler support comment about #pragma push_macro/pop_macro. 2023-06-03 17:23:40 +03:00
Sam Lantinga
5fcd70578b Fixed detection of the Steam Virtual Gamepad on macOS 2023-06-02 18:37:45 -07:00
Sam Lantinga
9837653b9d Allow the application to send commands to Nintendo Switch controllers 2023-06-02 15:52:56 -07:00
Sam Lantinga
7c55845c80 Fixed build if SDL_JOYSTICK_RAWINPUT_MATCHING isn't enabled 2023-06-02 11:20:31 -07:00
Sam Lantinga
767507fcf6 Don't use raw input while Remote Desktop is active
Raw input will not send game controller events while Remote Desktop is active, so dynamically switch between XInput and raw input when Remote Desktop state changes.

Fixes https://github.com/libsdl-org/SDL/issues/7759
2023-06-02 11:16:07 -07:00
Sam Lantinga
a5a1844681 Fixed build error 2023-06-02 10:20:29 -07:00
Sam Lantinga
e8b5b4881c Fixed WGI immediately being correlated with raw input devices with no input
The at rest match state is 0x0000008800000000, not 0
2023-06-02 09:38:18 -07:00
Sam Lantinga
2e27812d39 Fixed event sequence when Remote Desktop connects and disconnects
1. Send display disconnected events for all displays no longer connected
2. Send display connected events for all displays that have been connected
3. Send window display events for any windows that have changed displays
2023-06-02 08:51:47 -07:00
Alibek Omarov
6aaf032320 wayland: reset orientation bitmask before reading values from hint on QtWayland
Signed-off-by: Alibek Omarov <a1ba.omarov@gmail.com>
(cherry picked from commit 68e3e99087)
2023-06-02 08:06:30 -07:00
Alibek Omarov
56520372ca hints: clarify support for comma-separated values for QtWayland orientation that's available since 2.0.22
Signed-off-by: Alibek Omarov <a1ba.omarov@gmail.com>
(cherry picked from commit c395240425)
2023-06-02 07:42:06 -07:00
Ozkan Sezer
8c476ca1b0 hidapi/libusb: need libusb >= 1.0.16 because of libusb_get_port_numbers 2023-06-02 07:26:38 -07:00
Ozkan Sezer
e27c10a5b1 hidapi/libusb: don't try to dlsym libusb_wrap_sys_device
not used in SDL.
2023-06-02 07:26:38 -07:00
Ozkan Sezer
3ecdbf27cc hidapi: silence redefinition warnings 2023-06-02 07:25:02 -07:00
Sam Lantinga
f082c68b2f Updated with upstream suggestions in https://github.com/libusb/hidapi/pull/582 2023-06-01 10:48:15 -07:00
Sam Lantinga
0ad089de21 Backed out local changes to build with libusb on Windows 2023-06-01 08:30:10 -07:00
Sam Lantinga
b36679b90e Updated with upstream suggestions in https://github.com/libusb/hidapi/pull/582 2023-06-01 08:27:56 -07:00
Sam Lantinga
20182eed7c Updated with upstream suggestions in https://github.com/libusb/hidapi/pull/572 2023-06-01 07:47:28 -07:00
Sam Lantinga
0cff44dbd4 Updated with upstream suggestions in https://github.com/libusb/hidapi/pull/577 2023-06-01 07:28:44 -07:00
Sam Lantinga
4f58445f03 Ignore both the mouse and keyboard endpoints of Steam Controllers when enumerating game controllers 2023-05-31 14:28:50 -07:00
Nikita Krapivin
c886e80675 gdk: Virtual keyboard and text input backend 2023-05-31 13:11:39 -07:00
Sam Lantinga
b6a88b0339 Don't try to interpret Xbox controllers as raw HID devices on Windows
These generate fake reports which don't include separate trigger axes, and the HIDAPI joystick driver doesn't understand this report format.
2023-05-31 10:49:46 -07:00
Frank Praznik
adad6514d4 wayland: Add aspect-correct output for scaled modes
Add aspect-correct output of scaled video modes and a hint to control this behavior (aspect, stretch, or none).

The Wayland spec states that fullscreen surfaces that do not cover the entire output shall be centered with the borders masked by the compositor, so no additional work is required aside from calculating the proper window dimensions.

The default is still 'stretch' mode, as some window managers as of this time (KDE and older versions of GNOME still found in LTS distros) don't behave according to the spec and present an unmasked window that is not centered, so it's not yet safe to change the default.
2023-05-31 13:41:49 -04:00
Sam Lantinga
4644ac99fa Remove unneeded property type check 2023-05-31 08:27:54 -07:00
Wohlstand
cddcc4f406 Don't ignore "build-scripts" 2023-05-30 19:56:17 -07:00
Wohlstand
8e0b47331f Also ignore "build-*/" sub-directories
Locally, I do make multiple build directories for various purposes, like "build-debug", "build-release", "build-novideo", etc. Also, Qt Creator (if configure it) may automatically create build directories that always starts with a "build-*" prefix.
2023-05-30 19:56:17 -07:00
Ozkan Sezer
e9e4a9175f testautomation_guid.c: fix integer warning in 32 bit builds. 2023-05-31 04:50:02 +03:00
Sam Lantinga
0b28cbe385 Allow building on really old Linux kernels (thanks @sezero!) 2023-05-30 16:36:40 -07:00
Ozkan Sezer
9b147eb80b SDL_x11window.c: apply missing SDL2-to-SDL3 portage to fix build. 2023-05-31 01:55:50 +03:00
Ozkan Sezer
c521e1286b SDL_dbus.h: define DBUS_TIMEOUT_USE_DEFAULT if not already defined. 2023-05-31 01:55:40 +03:00
Ozkan Sezer
20dfb7df2c hidapi/linux/hid.c: define BUS_SPI if not already defined. 2023-05-31 01:55:40 +03:00
Ryan C. Gordon
19c10b41fd x11: Attempt to wait for SDL_MaximizeWindow to complete before returning.
Fixes #7070.

(cherry picked from commit 379a6f4dab)
2023-05-30 17:10:04 -04:00
Sam Lantinga
1fdcb610ff Fixed build 2023-05-30 05:52:07 -07:00
Sam Lantinga
4c36726a31 macOS child window fixes
- Fix places working with window coordinates that need to call SDL_RelativeToGlobalForWindow or SDL_GlobalToRelativeForWindow

- Remove NSScreen param from ConvertNSRect(). Reflecting the Y coordinate is done relative to the main screen height (which ConvertNSRect
  was already doing) so the explicit screen isn't needed.

- Refactor NSScreen lookups for point/rect and fix getting the screen for Cocoa_SetWindowPosition() to get the screen for the new position and
  not the window's current screen (which may not exist if the window is off-screen).

- Fix re-associating the popup and parent window when the child window is shown. Hiding a child window removes it from the window hierarchy
  and so must be added when the window is shown again.

- Allow popup windows that are not tooltips to gain key focus.
2023-05-29 16:44:17 -07:00
Ryan C. Gordon
ecccf6f9ca windows: Don't allow non-resizable windows to be maximized.
Fixes #6346.

(cherry picked from commit d275851dfb)
2023-05-29 14:49:57 -04:00
David Gow
52b73d4115 pipewire: Set 'application.id' if SDL_HINT_APP_ID set
If SDL_HINT_APP_ID is set, pass it as the application.id to pipewire.
This gives any pipewire-based tools a hint to find an associated
.desktop file for icons, etc.
2023-05-29 11:03:34 -04:00
Sam Lantinga
f74549ef2e Fixed build warning
(cherry picked from commit 5007b96363)
2023-05-28 19:24:17 -07:00
Sam Lantinga
1da5b2e488 Disable SDL_JOYSTICK_RAWINPUT_XINPUT
Apparently when using the Xbox One Wireless Adapter, using XInput at the same time as raw input will cause the controller to turn off immediately after connecting. This appears to be a bug in the Windows 11 driver stack, but since WGI provides all the extended functionality we need, this can be turned off for now.

Fixes https://github.com/libsdl-org/SDL/issues/3468

(cherry picked from commit b2e88ecfeb)
2023-05-28 18:44:02 -07:00