Commit Graph

9655 Commits (22a29321e9af07380fd3759118113c39143af313)

Author SHA1 Message Date
Sam Lantinga e7b01ee745 Added controller mapping for the Thrustmaster Dual Analog 3.2 on Linux 2022-04-18 09:55:52 -07:00
Frank Praznik 2b52946143 video: Don't minimize fullscreen windows on focus loss by default when mode switching is disabled
When mode switching is disabled in a video backend, fullscreen windows are basically just fullscreen desktop windows with different internal scaling.  As no mode switching occurs, there's no need to minimize them on focus loss by default.  This can still be overridden by explicitly setting the internal hint for minimizing on focus loss.

This has the side effect of fixing a bug on GNOME, where, when a fullscreen Wayland window has it's focus lost and restored via alt+tab followed by switching back to windowed mode, the top portion of the window won't end up being obstructed by GNOME's top bar.
2022-04-18 09:39:25 -07:00
Ethan Lee c37090f9a4 wayland: Add support for TOOLTIP/POPUP_MENU 2022-04-18 12:31:02 -04:00
Sam Lantinga 9e264b921b Certain audio drivers, like the RME "Pro" Audio driver, have resampling quality issues when using WASAPI.
We'll use SDL's resampling algorithm so we have consistent quality between platforms and drivers.

Fixes https://github.com/libsdl-org/SDL/issues/5538
2022-04-18 09:20:47 -07:00
Sam Lantinga 254fcc90eb Revert "video: Prefer Wayland over X11"
This reverts commit 8ceba27d62.

SDL Wayland support is stable, but there are a number of issues with third-party software (NVIDIA drivers, libwayland event overflow, libdecor not handling plugin load failures, Steam overlay not working with Wayland, etc.) that make it better to default to X11 at this time.

Games which would like to prefer wayland when available can use the following code before SDL_Init():
	SDL_SetHint(SDL_HINT_VIDEODRIVER, "wayland,x11");

Fixes https://github.com/libsdl-org/SDL/issues/5527
2022-04-18 09:03:14 -07:00
Ryan C. Gordon c1336b21ed hints: Make SDL_VIDEODRIVER and SDL_AUDIODRIVER formal hints.
They were just environment variables before.

Fixes #5528.
2022-04-17 11:31:55 -07:00
Ryan C. Gordon 634b9edc7f
cmake: Fixed indenting and some oldschool `endif(TEXT)` things. 2022-04-15 20:50:55 -04:00
Semphris dc5bc5237c Added CMake option to disable the installer 2022-04-15 20:48:40 -04:00
Ryan C. Gordon 67e0f546c5
x11: Update the display when the WM changes a window's fullscreen state.
Fixes #5390.
2022-04-15 18:25:53 -04:00
Frank Praznik edb473cf46 video: Wayland: Always round scaled pointer coordinates down
Rounding up can cause the pointer coordinates to exceed the window boundaries at the right and bottom edges.
2022-04-15 16:24:20 -04:00
Frank Praznik 13393a1c4b video: Wayland: Clamp fullscreen window dimensions to desktop
A scaled fullscreen window may exceed the bounds of the desktop.  Clamp the window size to the desktop dimensions in fullscreen mode.
2022-04-15 16:24:20 -04:00
pionere 0adb67017b avoid NullPointer in SDL_GetRenderTarget 2022-04-15 15:47:35 -04:00
pionere 01b14e14e6 avoid NullPointer in SDL_GL_MakeCurrent 2022-04-15 08:30:33 -04:00
Ozkan Sezer 55a4e1d336 CI: update os2.yml to use open-watcom/setup-watcom
also remove os2-buildbot.sh -- not needed anymore.
2022-04-14 10:10:02 +03:00
Simon McVittie c36bd78474 WhatsNew.txt: Document new dependency on libwayland-client 1.18.0
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-04-13 10:14:29 -04:00
Ethan Lee 46616af722
WhatsNew.txt: Added SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR 2022-04-12 11:53:40 -04:00
David Gow 9c2f46b0d5 Wayland: Add SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR
This hint allows libdecor to be used even when xdg-decoration is
available. It's mostly useful for debugging libdecor, but could in
theory be used by applications which want to (for example) bundle their
own libdecor plugins.
2022-04-12 11:52:41 -04:00
Mathieu Eyraud 99ae6395b1 Initialise scandir argument
'scandir' does not initialise 'entries' on error
2022-04-12 11:14:07 -04:00
Simon McVittie 68b6fff245 test: Copy utf8.txt to build directory
testiconv wants this.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-04-12 11:01:20 -04:00
Simon McVittie b4256d03e9 testevdev: Adapt to a broader definition of keyboards
At the time I contributed this unit test, SDL had a relatively narrow
definition of what is a keyboard, approximately matching udev
ID_INPUT_KEYBOARD. Now it uses the equivalent of udev ID_INPUT_KEY,
which matches anything with keyboard keys, and not just reasonably
complete alphanumeric keyboards.

Fixes: 040bd7a9 "Fix udev not detecting ID_INPUT_KEY devices when udev is not running"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-04-12 10:59:53 -04:00
Simon McVittie c2946902fa testevdev: Recognise touchpads as such
At the time I contributed this unit test, SDL didn't understand Linux
touchpads, but now it does.

Fixes: 373216ae "Added support for touchpads in the Linux evdev code"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-04-12 10:59:53 -04:00
pionere f708cebe10 fix os2 timer in fallback mode 2022-04-12 17:01:20 +03:00
Ivan Epifanov b75996138a Vita: fix VIDEO_VITA_PVR flag 2022-04-11 17:16:22 -04:00
Ethan Lee b1831715a2
UWP: Require Windows 10 16299 or newer.
This is required to build with WGI support. Thanks for @FrozenChameleon for the fix!

Fixes #5504
2022-04-11 12:09:40 -04:00
Ryan C. Gordon 727eef7064
audio: SDL_ConvertStereoToMono_SSE3 missed an unaligned load. 2022-04-09 10:13:37 -04:00
Sam Lantinga 505d6a4a05 Update version to 2.0.22 for release 2022-04-08 18:18:56 -07:00
Sam Lantinga a256e6ba7f Updated the patch notes with API changes for 2.0.22 2022-04-08 18:10:56 -07:00
Sam Lantinga 6d7d142b70 Fixed typo 2022-04-08 18:10:38 -07:00
Frank Praznik c2093fab99 video: wayland: Set the surface damage region when using fullscreen viewports
When using emulated display modes, the output size is often larger than the drawable buffer.  As the surface damage region is automatically calculated from the smaller drawable buffer size, the damage region needs to be manually set to cover the entire viewport region or visual repaint artifacts can result.
2022-04-08 14:11:44 -04:00
Ethan Lee ba0ba9ef16 direct3d11: Set the swapchain target immediately after creating it.
Fixes #4782
2022-04-07 23:47:20 -07:00
Ethan Lee cb81630816 render: Update the size/scale/viewport on moves, in addition to resizes.
For OpenGL this means resetting the viewport state shadowing flag too.

Fixes #1504
2022-04-07 23:38:33 -07:00
Sam Lantinga 5613a56032 Make sure the UIKit message box is being handled on the main thread
Potentially fixes https://github.com/libsdl-org/SDL/issues/4865
2022-04-07 11:33:54 -07:00
Ozkan Sezer 2823534fef minor adjustment to os/2 watcom makefile 2022-04-07 20:11:50 +03:00
Sam Lantinga 49b9e3470b Only update modifier state for keys that are pressed in another application
Fixes https://github.com/libsdl-org/SDL/issues/4432
2022-04-07 08:24:03 -07:00
Ryan C. Gordon 85977354fb
x11: Treat WM setting the window "fullscreen" like FULLSCREEN_DESKTOP.
Fixes #5390.
2022-04-07 09:15:27 -04:00
Connor Clark 6dbca7c911 Compile with recursive mutexes for emscripten
Emscripten actually does support recursive mutexes, so no need to use SDL's fake recursive code.

Background: #5428, #5479
2022-04-06 18:51:35 -07:00
Ozkan Sezer 64c7896f09 Makefile.in: added missing CXX variable. 2022-04-06 20:56:10 +03:00
Ethan Lee d1f7f9e35d wayland: Pin the fake window position at (0, 0).
I kind of thought it'd be nice to have it in the center, but this is an issue
for applications that still assume global mouse and window positions are
accessible. For example, this fixes cursor offset issues in UE5.
2022-04-06 11:18:46 -04:00
Ethan Lee 279aeb59be
wayland: Add a bug link for the detach FIXME 2022-04-06 01:32:57 -04:00
Ethan Lee 3ada694e62
wayland: Try to detach at the beginning of ShowWindow, just in case.
It's possible that an external component (probably a GL/VK context) committed, so we need to cover our bases and detach in both HideWindow and ShowWindow.

Fixes a crash in UE5 editor's pop-ups.
2022-04-06 01:18:03 -04:00
Ethan Lee dcfb7fff00
wayland: Evaluate WINDOWPOS_CENTERED_DISPLAY for move events
Partially fixes the mouse cursor in UE5 editor. Imperfect because UE5 uses window position and global mouse state to get position, but of course we don't have global mouse and this is just to get the right display index so this still fails overall. We really need to make global mouse support a feature query...
2022-04-06 00:55:32 -04:00
Sam Lantinga 7ea1b69dd4 Sort controllers by the js* index on Linux
Also fixed the initial scan to directly scan devices instead of using
udev so they can be sorted, as intended.

Fixes https://github.com/libsdl-org/SDL/issues/4688
2022-04-05 21:02:52 -07:00
Ryan C. Gordon 0249df9d96
x11: Try to keep SDL_WINDOW_FULLSCREEN* in sync with window manager.
So if Gnome/KDE/etc have a keyboard shortcut or titlebar decoration to
make any window go fullscreen (with the _NET_WM_FULLSCREEN flag on the
_NET_WM_STATE property), we update the SDL window flag.

Fixes #5390.
2022-04-05 23:18:10 -04:00
Sam Lantinga eb660e862c Cache the fact that a device didn't look like a joystick
Fixes https://github.com/libsdl-org/SDL/issues/5211
2022-04-05 19:47:42 -07:00
Weng Xuetian 138d96c8a6
Send key release event to input method. (#5281)
Co-authored-by: Ethan Lee <flibitijibibo@gmail.com>
2022-04-05 22:30:25 -04:00
Ryan C. Gordon 8bae343f25
x11: when waiting on fullscreen changes, not window position _and_ size.
This makes sure the window doesn't have outdated values if you try to access
them (or call something that does, like SDL_SetWindowMinimumSize).

Fixes #5233.
2022-04-05 22:21:57 -04:00
Sam Lantinga 268c2fa882 Don't resize fullscreen windows when hiding or minimizing them (thanks @madewokherd!)
This has the benefit of window previews (mousing over the icon) having the correct size and contents.

Fixes https://github.com/libsdl-org/SDL/issues/5320
2022-04-05 18:42:17 -07:00
Esme Povirk def27267b5 Ignore focus change messages that contradict GetForegroundWindow.
On Wine, when a window is programmatically minimized in response
to losing focus, we receive a WM_ACTIVATE for the deactivation,
but GetForegroundWindow still indicates that our window is focused.
This causes an incorrect SDL_WINDOWEVENT_FOCUS_GAINED.

This is probably a Wine bug, but it may take a while to fix and
then for the fix to make its way to users.
2022-04-05 18:00:39 -07:00
Weng Xuetian ff5b67e5e0 IBus should use ev keycode instead of X keycode
See: 5a455b1ead/client/gtk2/ibusimcontext.c (L468)
2022-04-05 20:04:40 -04:00
Sam Lantinga 27fc582b59 Minor cleanup 2022-04-05 15:11:49 -07:00