15714 Commits

Author SHA1 Message Date
Sam Lantinga
4954690828 Fixed warning C4244: '=': conversion from 'double' to 'float', possible loss of data 2024-05-30 07:44:00 -07:00
Sam Lantinga
690d73f5c9 Fixed warning C4244: 'initializing': conversion from 'WPARAM' to 'Uint32', possible loss of data 2024-05-30 07:42:35 -07:00
Ozkan Sezer
d41e48e4c6 WIN_AdjustWindowRectWithStyle: silence gcc maybe-uninitialized warnings
/tmp/SDL3/src/video/windows/SDL_windowswindow.c: In function 'WIN_SetWindowPositionInternal':
/tmp/SDL3/src/video/windows/SDL_windowswindow.c:216:17: warning: 'h' may be used uninitialized in this function [-Wmaybe-uninitialized]
     rect.bottom = *height;
     ~~~~~~~~~~~~^~~~~~~~~
/tmp/SDL3/src/video/windows/SDL_windowswindow.c:320:12: note: 'h' was declared here
     int w, h;
            ^
/tmp/SDL3/src/video/windows/SDL_windowswindow.c:215:16: warning: 'w' may be used uninitialized in this function [-Wmaybe-uninitialized]
     rect.right = *width;
     ~~~~~~~~~~~^~~~~~~~
/tmp/SDL3/src/video/windows/SDL_windowswindow.c:320:9: note: 'w' was declared here
     int w, h;
         ^
2024-05-29 16:39:03 -07:00
Sam Lantinga
a801f81132 Revert "Fix flickering of window when using desktop-fullscreen and borderless window on multiple monitors on Linux. Closes #8186."
This reverts commit 2de2e9d031cf7195ccdcf434538ea6b742035ca4.

The fullscreen state is no longer available to check, and the actual bug this was trying to work around was fixed in ad813a65e7
2024-05-29 14:15:59 -07:00
Frank Praznik
63c164f778 x11: Use the floating size for the constraints on non-resizable windows
Otherwise, the window manager can think that the window is larger than it is and try to reposition it.
2024-05-29 14:09:29 -07:00
Ozkan Sezer
384e5486bc SDL_windows.h: set _WIN32_WINNT to 0xA00 dxgi1_6.h is available
to make sure DISPLAYCONFIG_SDR_WHITE_LEVEL is visible to us.
2024-05-30 00:05:55 +03:00
Ozkan Sezer
b1c7b2f44f SDL_wasapi.c: avoid unused warning if IAudioClient3 isn't available 2024-05-29 15:43:33 -04:00
Ozkan Sezer
dde9c10e79 SDL_camera_mediafoundation.c: hardcode MF_DEVSOURCE_ATTRIBUTE_* GUIDs 2024-05-29 15:33:42 -04:00
Ramez Ragaa
6bb91c7c08 Support X11 incremental clipboard transfers.
This adds support for pasting large clipboard contents using the INCR
property mechanism

Fixes #8871
2024-05-29 12:30:34 -07:00
Sam Lantinga
652b34bd15 Added SDL_DumpProperties() for internal debugging 2024-05-29 10:30:31 -07:00
Sam Lantinga
ae59afa7d0 Fixed building with ENABLE_SDL_CALL_LOGGING enabled 2024-05-29 10:30:31 -07:00
Frank Praznik
57504385e0 wayland: Maintain aspect ratio while resizing the window
Note that Wayland places a restriction on windows being resized, where the requested size passed to the configuration event is a maximum, and attempting to exceed it is a protocol violation, so trying to grow the window by dragging the sides only vertically or horizontally is limited, as the provided dimensions can't be exceeded.

In practice, nothing seems to kill clients that do this, but the more immediate problem is that doing so causes GNOME to glitch out.
2024-05-29 12:23:36 -04:00
Sam Lantinga
b1b4638cac Add basic vulkan support to offscreen video driver so it doesn't crash if you happen to get the offscreen driver and try to use vulkan.
Enable offscreen video driver in windows to make it easier to test.
Enable offscreen video driver in macos just to complete the desktop computer trio.
2024-05-28 20:02:55 -07:00
SDL Wiki Bot
04a0a85d92 Sync SDL3 wiki -> header 2024-05-29 02:48:51 +00:00
Sam Lantinga
542a3663de Added SDL_GetDefaultKeyFromScancode() to the public API
This is useful when getting the English name of a key for a non-Latin keyboard layout, for example.
2024-05-28 19:48:24 -07:00
Ryan C. Gordon
aeb223fc23
pipewire: if no devices seen in "preferred" init, try a different backend.
We're seeing people with legit PipeWire installs that don't export any
devices, that are also running a (not emulated) PulseAudio install that
works.

This solution might still get tweaked some more, but it seems to be working
so far.
2024-05-28 22:17:40 -04:00
Frank Praznik
fafc9f642a
win32: Don't set the display HDR values to uninitialized data
The HDR properties are zeroed and set in WIN_GetHDRProperties, and using the struct without calling this function results in sending uninitialized data.
2024-05-28 15:51:02 -04:00
Ozkan Sezer
2b374e6c0f check dxgi1_6.h before enabling sdr/hdr code in SDL_windowsmodes.c
thanks @madebr
2024-05-28 22:11:56 +03:00
Ozkan Sezer
00a7b14ee7 cmake: check mfapi.h before enabling SDL_CAMERA_DRIVER_MEDIAFOUNDATION 2024-05-28 22:11:50 +03:00
Sam Lantinga
d141827895 Fixed positioning a window with undefined position on a specific display 2024-05-28 12:06:48 -07:00
SDL Wiki Bot
98fdef75bb Sync SDL3 wiki -> header 2024-05-28 18:54:02 +00:00
Sam Lantinga
c74886ab00 Added SDL_SetWindowAspectRatio() and SDL_GetWindowAspectRatio()
Fixes https://github.com/libsdl-org/SDL/issues/1573
2024-05-28 11:52:31 -07:00
Ozkan Sezer
aacafd6233 time/windows/SDL_systime.c: remove minwinbase.h & timezoneapi.h includes
core/windows/SDL_windows.h is included in there, which inludes windows.h
which in turn includes winbase.h, which in turn includes the two already
2024-05-28 11:27:37 +03:00
Ozkan Sezer
864df05b19 SDL_windowsevents.c: define RI_MOUSE_HWHEEL if missing. 2024-05-28 11:11:50 +03:00
Ozkan Sezer
ba1fdf24c9 fix type redefinition error after commit dfe4445214
In file included from /tmp/SDL3/src/events/SDL_events_c.h:28,
                 from /tmp/SDL3/src/SDL.c:46:
/tmp/SDL3/src/events/../video/SDL_sysvideo.h:31: error: redefinition of typedef 'SDL_VideoDevice'
/tmp/SDL3/src/video/SDL_video_c.h:27: note: previous declaration of 'SDL_VideoDevice' was here
2024-05-28 11:00:02 +03:00
erysdren
2f1384e5d1 SDL_systime.c: missing include for PSP toolchain 2024-05-27 14:36:46 -07:00
Sam Lantinga
36015ad5e5 Fixed compiling SDL_platform_defines.h on macOS with older compilers (thanks @sezero!)
Fixes #9632
2024-05-27 14:34:21 -07:00
Ryan C. Gordon
e508d82f74
include: Tweaked some vsync-related documentation.
Reference PR #9903.
2024-05-27 16:57:32 -04:00
SDL Wiki Bot
6524f9c9b8 Sync SDL3 wiki -> header 2024-05-27 20:12:47 +00:00
Sam Lantinga
dfe4445214 Added SDL_SetWindowSurfaceVSync() and SDL_GetWindowSurfaceVSync()
Fixes https://github.com/libsdl-org/SDL/issues/9347
2024-05-27 13:12:17 -07:00
SDL Wiki Bot
7c75801571 Sync SDL3 wiki -> header 2024-05-27 20:04:46 +00:00
Ryan C. Gordon
3364aff757
main: Make the main callback return value symbols smaller (thanks, @Lzard!).
Reference #9901.
2024-05-27 16:03:45 -04:00
Frank Praznik
ef5d56de51 wayland: Implement animated system cursors when not using the cursor shape protocol
If a system cursor has more than one frame, create a frame callback to run the animation and attach new buffers as necessary to animate the cursor.
2024-05-27 14:38:52 -04:00
SDL Wiki Bot
a086144dad Sync SDL3 wiki -> header 2024-05-27 16:59:55 +00:00
Ryan C. Gordon
0fe9900429
main: Main callback docs recommend returning the symbols instead of -1, 0, 1.
Reference #9901.
2024-05-27 12:58:22 -04:00
L zard
06aa02453a Tests: Use the main callback code macros 2024-05-27 09:22:07 -07:00
Sam Lantinga
7d81e9d46c Note that you can redraw in response to SDL_EVENT_WINDOW_EXPOSED from an event watch callback 2024-05-27 08:06:13 -07:00
SDL Wiki Bot
54fcacae31 Sync SDL3 wiki -> header 2024-05-27 14:58:03 +00:00
Sam Lantinga
14667cc0a3 Document that the timer callback can potentially be called before the timer returns. 2024-05-27 07:57:33 -07:00
Sam Lantinga
aaa9bf9422 Added more error checking for SDL timer functions 2024-05-27 07:57:33 -07:00
Sam Lantinga
99599d9236 Added SDL_AddTimerNS() 2024-05-27 07:57:33 -07:00
Sam Lantinga
b6360516e4 Added the timerID to the SDL timer callback
Fixes https://github.com/libsdl-org/SDL/issues/2593
2024-05-27 07:57:33 -07:00
Sam Lantinga
a5b0041b4a Fixed SDL_strncmp() logic in portal dialog code
Also removed redundant calls to SDL_strlen()

Fixes https://github.com/libsdl-org/SDL/issues/9899
2024-05-27 07:46:58 -07:00
Sam Lantinga
df25e4022d Removed short aliases for 16-bit pixel formats
These were potentially misleading in the same way the RGB888/BGR888 aliases were

Fixes https://github.com/libsdl-org/SDL/issues/4994
2024-05-27 07:24:46 -07:00
SDL Wiki Bot
5fa9432b7d Sync SDL3 wiki -> header 2024-05-27 02:54:30 +00:00
Ryan C. Gordon
066f49da1a
main: Add some macros for main callback return codes.
Fixes #9883.
2024-05-26 22:53:06 -04:00
SDL Wiki Bot
c168ccc3c3 Sync SDL3 wiki -> header 2024-05-27 02:00:01 +00:00
Anonymous Maarten
ddb826d1a0 VC+d3d12: spread test for __has_include and d3d12.h test over multiple lines 2024-05-27 03:02:10 +02:00
Anonymous Maarten
279fb3acc3 release: build mingw binaries on Ubuntu 24.04
Ubuntu 22.04 ships with mingw that does not support direct3d12.

[ci skip]
2024-05-27 02:30:51 +02:00
Anonymous Maarten
4fa5006247 VC+d3d12: use __has_include to detect presence of d3d12 ehaders 2024-05-27 00:44:53 +02:00