5540 Commits

Author SHA1 Message Date
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
Sam Lantinga
86acb1a347 Handle interaction between auto capture and the SDL_CaptureMouse() API
Fixes https://github.com/libsdl-org/SDL/issues/5457
2022-04-05 15:05:07 -07:00
Sam Lantinga
0e198a8799 Added a define VERBOSE_MOTION_EVENTS to show mouse and finger motion events 2022-04-05 15:03:18 -07:00
Ryan C. Gordon
a5672b858e
x11: Wait a bit to see if window pos changes when changing fullscreen.
Helps prevent window from moving to 0,0 when leaving fullscreen.

Fixes #4749.
2022-04-05 11:10:41 -04:00
Cameron Gutman
45372b1c27 x11: Don't unload libGL.so to prevent a crash in XCloseDisplay()
libGL.so may register callbacks that can be invoked upon XCloseDisplay().
If XCloseDisplay() is called after libGL.so is unloaded, the callback pointer
will point at freed memory and invoking it will crash.

The texture framebuffer check optimized out in f37e4a9 was causing libGL.so to
never be unloaded as a side-effect. Skipping it exposed this bug by allowing
libGL.so to actually unload.
2022-04-04 21:39:41 -07:00
Sam Lantinga
7b3449b89f Minor cleanup 2022-04-04 20:46:56 -07:00
Cameron Cawley
57118fb7de render: Fix setting the scale mode for non-native textures 2022-04-02 09:51:28 -07:00
Ozkan Sezer
312c899f4f attempt to fix uwp build 2022-04-02 03:32:10 +03:00
Ozkan Sezer
575dadb11d fix build against older SDKs after commit 8ebef12. 2022-04-02 02:20:02 +03:00
Sam Lantinga
8ebef12d31 Use RoInitialize/RoUninitialize for Windows.Gaming.Input
Thanks @walbourn!

Fixes https://github.com/libsdl-org/SDL/issues/5270
2022-04-01 14:59:45 -07:00
Sylvain
78834b50d6
Add SDL_list.c/h 2022-04-01 08:01:44 +02:00
Sylvain
ad6bc521bd
Move SDL_List functions to SDL_list.c to avoid more merge with eventual PR 2022-04-01 07:59:16 +02:00
Sam Lantinga
0d7edcb703 Fixed loading 32-bit BMP files 2022-03-31 16:15:51 -07:00
Ryan C. Gordon
ea7d5307ac
emscripten: Proxy SDL_GetUsableDisplayBounds to the main thread. 2022-03-31 14:12:34 -04:00
Reinhold Gschweicher
fe79eb2fbb emscriptenframebuffer: fix formatting 2022-03-31 14:11:41 -04:00
Reinhold Gschweicher
268cc2a49c emscriptenmouse: remove useless return statement 2022-03-31 14:11:41 -04:00
NeroBurner
3136a53070 fix formatting and cast warnings
Co-authored-by: Charlie Birks <charlie@daftgames.net>
2022-03-31 14:11:41 -04:00
Reinhold Gschweicher
404158595c emscriptenmouse: remove old extra _INT 2022-03-31 14:11:41 -04:00
Reinhold Gschweicher
4dca8f7fb4 SDL2 thread proxying fixes
This PR uses new APIs added in [emscripten-core/emscripten#9336](https://github.com/emscripten-core/emscripten/pull/9336)
to improve compatibility with USE_PTHREADS=1.

Original PR: https://github.com/emscripten-ports/SDL2/pull/127
By: @jakogut
Reviewed by: Daft-Freak
2022-03-31 14:11:41 -04:00
Ryan C. Gordon
1c7bf478ae
x11: Ignore BadValue for extremely small XRRSetScreenSize resolutions.
Reference Issue #4840.
2022-03-31 10:09:47 -04:00
Ivan Epifanov
95c0fec518 Vita: PVROGL: fix indentation and ifdef guards 2022-03-31 06:02:50 -07:00
Jaylon Gowie
b5700ab31e Cleanup Spaces 2022-03-31 00:02:56 -04:00
Jaylon Gowie
8c542a3591 Desktop OpenGL 1.X/2.X PSVita Support 2022-03-31 00:02:56 -04:00
Cameron Gutman
2c04df8d65 joystick: Fix rumble issues on PS5 HIDAPI controllers
We were returning the report size from HIDAPI_DriverPS5_RumbleJoystick() rather
than 0 upon success, causing SDL_JoystickRumble() (and callers) to think that
rumbling failed.

This didn't cause major problems until 1868c5b, when it started preventing
rumble state from being persisted in the joystick core, even though it was
successfully sent to the hardware.

This led to all sorts of strangeness, including broken rumble duration and
attempts to stop rumble being discarded.
2022-03-30 18:33:38 -05:00
Ryan C. Gordon
7e15ad2fc4
x11: Catch X11 errors in X11_SetWindowPosition and X11_SetWindowSize.
The functions can go south if other operations are in progress, like
X11_SetWindowBordered, which might be doing something traumatic behind the
scenes of the window manager.

We can't make these tasks totally synchronous, which would fix the problem,
because not only can the window manager block however long it wants, it might
also decide to deny our requests without any notification, so we'd be waiting
forever for a window change that isn't coming.  :(

Fixes #5274.
2022-03-30 14:23:51 -04:00
Ivan Epifanov
cbdb67b4f6 Vita: add SDL_GetPreferredLocales support 2022-03-29 15:02:21 -07:00
Ivan Epifanov
178ac19615 Vita: add audio capture support 2022-03-29 14:12:37 -07:00
Frank Praznik
4d1905c9b6 video: wayland: Use viewports for non-fullscreen windows with fractional scaling
Use viewports for non-fullscreen windows when the desktop uses fractional scaling and the window is flagged as DPI-aware to provide a backbuffer mapped as close to 1:1 output as possible.  In the cases of odd window sizes the backbuffer may be a pixel off of scaling perfectly into the window size due to its scaled size being rounded off, but a minute amount of scaling during output is likely preferable to the large amounts of overdraw needed with integer scaled buffers.
2022-03-29 15:00:07 -04:00
Frank Praznik
fa4c51989d video: wayland: Expose more resolutions for mode emulation
Expose as many emulated display modes as possible.  They will currently display stretched to the display's native desktop aspect, but if an application requires a hardcoded resolution, it will work at minimum.

Aside from the change in the emulated display mode list, the Wayland event handling code had to be updated to support separate scaling for the x and y axes, as square pixels are no longer guaranteed.
2022-03-28 22:19:34 -04:00
Ethan Lee
d875416ac4 wayland: Minor fix for old compilers 2022-03-28 15:32:30 -04:00
Frank Praznik
4d76c9cb46 video: wayland: Use wp-viewporter for fullscreen with non-native resolutions
Wayland doesn't support mode switching, however Wayland compositors can support the wp_viewporter protocol, which allows for the mapping of arbitrarily sized buffer regions to output surfaces.  Use this functionality, when available, for fullscreen output when using non-native display modes and/or when dealing with scaled desktops, which can incur significant overdraw without this extension.

This also allows for the exposure of arbitrarily sized, emulated display modes, which can be useful for legacy compatability.
2022-03-28 13:18:26 -04:00
Connor Clark
aec86ba8bb emscriptenaudio: proxy calls to main thread 2022-03-28 12:04:04 -04:00
Ivan Epifanov
96be9cddcc Vita: add hint to select which touchpad generates mouse events 2022-03-28 08:36:32 -07:00
Mathieu Eyraud
1db47d468a Fix potential memory leak in QueueCmdFillRects 2022-03-28 08:34:32 -07:00
Ivan Epifanov
95ed83137f Vita: Use preallocated memory pool for textures 2022-03-27 10:07:49 -07:00
Ryan C. Gordon
7bc498d325
direct3d: Implement missing blend operations.
This is only for Direct3D 9; Direct3D 11 already had this implemented.

Fixes #5375.
2022-03-27 09:14:07 -04:00
Ethan Lee
713a675401 wayland: Relax the check for mismatching output scales 2022-03-26 22:26:15 -04:00
Ethan Lee
5655be1558 wayland: Avoid overwriting xdg_output position with wl_output position 2022-03-26 19:57:39 -04:00
Ethan Lee
40417b188a wayland: Work around a GNOME xdg_output scaling issue 2022-03-26 19:55:04 -04:00
Ethan Lee
7a1c45bd1c wayland: Optimize keyboard_handle_modifiers.
1. Mod index values are (mostly) constant, so can be done with xkb_state_new
2. Mods can change without the group changing, avoid remap events if possible

Lastly, as a bonus, I added braces to the locale check, because I was nearby.
2022-03-25 12:54:05 -04:00
Ivan Epifanov
69d0b6e3c6 Vita: Fix NULL-pointer dereference 2022-03-25 09:29:20 -04:00
Sylvain
bf38fd4679
YUV: fix invalid read on last line when converting from SDL_PIXELFORMAT_YUY2 (see bug #4841) 2022-03-25 11:52:50 +01:00
Ethan Lee
2891f0821b wayland: Use xkb_keymap_mod to set mod state 2022-03-25 02:49:49 -04:00
Ethan Lee
6d9ca92626 wayland: Enforce text capitalization manually, for remapped keymods 2022-03-25 01:36:39 -04:00
Ethan Lee
a75c6150e0 wayland: Add an xkb_keysym_t->SDL_Keycode mapping for backspace 2022-03-25 01:33:40 -04:00
Ethan Lee
ab74b6a3c3 wayland: Remove some now-redundant casts 2022-03-24 15:34:29 -04:00
Ethan Lee
ee52ad08cd wayland: Minor fixes for old compilers 2022-03-24 15:32:25 -04:00