Commit graph

2888 commits

Author SHA1 Message Date
Frank Praznik
2e5b9a860e
wayland: Explicitly specify EGL platform
Some checks failed
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-06-11 12:56:36 -04:00
Akihiko Odaki
b40b73d954
x11: Explicitly specify EGL platform
Mesa's eglGetDisplay() chooses the native EGL platform from
EGL_PLATFORM, limited autodetection, or the build-time default. If that
selects Wayland while SDL is using the X11 video backend, Mesa can treat
the X11 Display pointer as a wl_display and crash during
eglInitialize().

See: https://gitlab.com/qemu-project/qemu/-/work_items/3540
2026-06-11 12:56:36 -04:00
Frank Praznik
03d3bffbda wayland: Don't apply display orientation on Sailfish
Some checks failed
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
(cherry picked from commit 79de30a345)
2026-06-04 15:27:28 -07:00
Ryan C. Gordon
fd494d3778
x11: SetupWindowData shouldn't add to videodata->windowlist until success.
Fixes #15676.

(cherry picked from commit 5f25ce9282)
2026-05-27 11:49:56 -04:00
Mark Jonas
bb65446578 directfb: Fix CreateRenderer callback signature
Update DirectFB_CreateRenderer() to use the current SDL_RenderDriver
API.

Signed-off-by: Mark Jonas <toertel@gmail.com>
(cherry picked from commit 1df9ae4338)
2026-05-21 11:34:54 -07:00
Majjcom
a576a4af2d Windows: Fix window caption drawing on borderless windows
(cherry picked from commit 4b69833bc5)
2026-05-04 08:34:03 -07:00
Stanislav Aleksandrov
c4d6a01383
video: NULL-check display in SDL_DestroyWindow
(cherry picked from commit 039a60c527)
2026-04-28 08:02:04 -04:00
Cameron Gutman
1c4ea7da64 kmsdrm: Fix order of GBM and EGL teardown
All locked front buffers must be released prior to destroying
the EGL surface to avoid causing a UAF in libnvidia-egl-gbm.so.

(cherry picked from commit 9cc2f248f5)
2026-04-10 19:29:05 -05:00
Sam Lantinga
473efcf53c Added a hint "SDL_SURFACE_MALLOC" to disable aligned surface allocation
This is needed for sdl12-compat, where all surfaces were not aligned.

(cherry picked from commit dd01e096e9)
2026-04-02 10:37:20 -07:00
Ozkan Sezer
549934b59a minor os/2 emx build fix.
(cherry picked from commit a7d4b1996f)
2026-03-17 05:03:10 +03:00
hexnet1234
6e43302694
Fix Wayland_DestroyWindow SEGFAULT
Check if the wind pointer is NULL, to avoid SEGFAULT.
Already implemented in SDL3, but not yet backported.
2026-02-26 10:02:45 -05:00
Ozkan Sezer
ec113c1f82 SDL_cocoawindow.m: fix what seems to be a typo in commit 649c36c5:
NSWindowCollectionBehaviorNone -> NSWindowCollectionBehaviorFullScreenNone

(cherry picked from commit b1d95b9d20)
2026-02-06 06:05:02 +03:00
Ryan C. Gordon
8306d559b9
cocoa: Fix SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES=0.
This hint is documented to not just turn off fullscreen windows going into a
new Fullscreen Space, but also to make the green button on a resizeable
window's title bar do a maximize/zoom instead of make the window fullscreen.

Previously, this only did the former and not the latter (or perhaps it worked
and the defaults changed in a newer macOS, we aren't sure).

Fixes #7470.

(cherry picked from commit 50f3adec77)
(cherry picked from commit 649c36c576)
2026-02-05 18:55:21 -05:00
Wolf3s
143528c82a Fix the video size matching the renderer.
(cherry picked from commit f383330cfa)
2026-01-19 10:13:13 -08:00
Sam Lantinga
522ff67cc8 Updated copyright for 2026 2026-01-01 09:56:59 -08:00
Peppersawce
f21394381b Make BUrl not 'ambiguous'
(cherry picked from commit bacfd3c252)
2025-12-10 08:32:55 -08:00
PulkoMandy
843345a18c Use a BHandler attached to the application instead of a BLooper
When there is already a BApplication, SDL cannot start its own. In a
previous version, it instead started a separate looper. This results in
some extra complexity as there is now yet another thread to manage (in
addition to the main thread, the application thread, and the window
threads).

Instead, create a BHandler and attach it to the existing BApplication,
which allows it to receive messages in the already existing application
thread.

(cherry picked from commit 47312cf0f3)
2025-12-10 08:32:55 -08:00
Cameron Gutman
667e4e9020 egl: Fix X11 EGL window creation on Nvidia
This is a port of 808a3f5 to SDL2.

Fixes #13094

(cherry picked from commit 3146374e4a)
2025-12-05 23:20:45 -06:00
Joshua Root
18c96e27d2
Guard use of @available in SDL_cocoaevents.m
Older compilers don't understand this syntax.

(cherry picked from commit eb974470ec)
2025-12-03 10:04:26 -05:00
yuanhecai
1acc405bd4 loongarch: add SDL_FillRect4LSX opt
(cherry picked from commit 14eebdab3c)
2025-11-06 07:29:07 -08:00
yuanhecai
a07b00ccb0 loongarch: add BlitRGBtoRGBPixelAlphaLSX opt
(cherry picked from commit 686c18026b)
2025-11-06 07:29:07 -08:00
Ozkan Sezer
c0d0b31d1c SDL_kmsdrmvideo.c: fix build in C90 mode
(cherry picked from commit 00d4f1c2c4)
2025-10-26 04:35:40 +03:00
Sam Lantinga
80cbc908a1 Perform full rectangle intersection for empty rects
If we don't do that, we leave the x and y values uninitialized.

Fixes https://github.com/libsdl-org/sdl12-compat/issues/365

(cherry picked from commit ffd0ca4391)
(cherry picked from commit 1c19bee000)
2025-10-25 13:52:34 -07:00
Frank Praznik
735d8a2dc8
wayland: Special-case relative warp mode to deliver accelerated relative motion
The Wayland backend lacks pointer warp functionality, so special-case the relative warp mode hint to deliver accelerated relative motion deltas, which is ultimately what the client wants by enabling this hint.

(cherry picked from commit 235e4870af)
2025-10-09 11:29:12 -04:00
Sam Lantinga
ecc71c02ea Only use a transparent cursor on Windows when connected via RDP
VMware relies on the cursor being set to NULL to optimize relative mouse motion for games.

We should also revisit whether current RDP works better with a NULL cursor or a transparent cursor.

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

(cherry picked from commit dac6af4ba6)
(cherry picked from commit 55b599d693)
2025-09-14 17:32:38 -07:00
Frank Praznik
2a10b8c4e7 wayland: Add a sigtimedwait() implementation for OpenBSD
sigtimedwait() is an optional part of POSIX.1-2001, and OpenBSD doesn't implement it. Add a replacement implementation based on https://comp.unix.programmer.narkive.com/rEDH0sPT/sigtimedwait-implementation

(backported from commit 1049426a76)
(cherry picked from commit d31d98d436)
2025-08-30 15:47:00 +03:00
Dan Andrus
f8119d4760 Check NSWindow::isVisible before sending SDL_WINDOWEVENT_RESTORED during Cocoa_WindowListener::windowDidResize
(cherry picked from commit e610529e84)
2025-07-28 11:59:06 -07:00
Ryan C. Gordon
7f371c7808 cocoa: Patched to compile.
(cherry picked from commit b537380065)
2025-07-11 09:56:20 -07:00
Ryan C. Gordon
d98087a0c3 cocoa: Don't use trick of briefly focusing the Dock on newer macOS releases.
On newer systems, the trick isn't necessary, and if you do it, if the user is
moving the mouse when launching the app, it'll show a hidden Dock.

Fixes #10340.

(manually backported from SDL3 from commit 279dabfc96)

(cherry picked from commit b2c3e6fade)
2025-07-11 09:56:20 -07:00
Sam Lantinga
4177e06c09 Fixed rare crash trying to interrupt SDL_WaitEvent()
Fixes https://github.com/libsdl-org/SDL/issues/12797

(cherry picked from commit 992e4c59bd)
(cherry picked from commit 33eb167da8)
2025-05-19 14:24:41 -07:00
Sam Clegg
dc69988fdf [emscripten] Remove reference to Module['createContext']
Backported from https://github.com/libsdl-org/SDL/pull/12970

(cherry picked from commit c0f78dee5e)
2025-05-06 14:46:53 -07:00
Deve
934d6954e2 Fixed crash when trying to disconnect secondary display on iOS 2025-01-29 14:45:49 -08:00
Ozkan Sezer
ab8bd0ef86 fix emscripten builds 2025-01-16 18:50:00 +03:00
Sam Lantinga
9f25821ffd Fixed detection of function keys on Emscripten
Fixes https://github.com/libsdl-org/SDL/issues/11973

(cherry picked from commit 67382e9c83)
2025-01-16 07:32:38 -08:00
CasualPokePlayer
780ec8fac0 Set EGL surface for foreign X11 windows
Also slightly changes up the cleanup code for SetupWindowData, to avoid copy pasting.

See #10611
2025-01-16 10:20:25 -05:00
Frank Praznik
0efeb82a28
wayland: Only apply the toplevel bounds to resizable windows 2025-01-06 17:20:10 -05:00
Frank Praznik
e5a3fcd071 wayland: Apply toplevel bounds to windows
Apply the supplied xdg-toplevel bounds to resizable windows during initial mapping. Libdecor functionality will have to be added separately, as the functionality needs to be added to the library first.
2025-01-06 17:13:16 -05:00
Daniel Tang
db2997548c
Let SDL_IM_MODULE=fcitx override Wayland as a workaround to fix key repetition detection (#11859) 2025-01-05 14:34:30 -08:00
Joshua Root
d58f026827 windowWillStartLiveResize: legacy OS compatibility fix 2025-01-02 14:16:33 -08:00
Joshua Root
ed0eb7714a showAlert: legacy OS compatibility fix 2025-01-02 14:16:33 -08:00
Sam Lantinga
adb51845af Fixed N3DS_TOUCH_ID, 0 is an invalid touch ID 2025-01-01 09:06:23 -08:00
Sam Lantinga
5a25183b39 Revert "Backed out Vita touch ID change for SDL2"
This reverts commit a326ebce61.

It turns out that 0 is an invalid touch ID for SDL2, per the documentation for SDL_GetTouchDevice()
2025-01-01 09:03:24 -08:00
Sam Lantinga
a326ebce61 Backed out Vita touch ID change for SDL2
0 is still a valid touch ID in SDL2 and shouldn't be changed at this point
2025-01-01 08:24:31 -08:00
Sam Lantinga
2b5b8fdbd5 Updated copyright for 2025 2025-01-01 07:47:53 -08:00
Sam Lantinga
884c8b684a Allow rendering during the modal resize loop on macOS
Fixes https://github.com/libsdl-org/SDL/issues/11508

(cherry picked from commit 9a43c08146)
2024-12-23 11:55:49 -08:00
Sam Lantinga
974098464f Enable high refresh rates on iOS
Fixes https://github.com/libsdl-org/SDL/issues/7518

(cherry picked from commit 835b6e0c1a)
2024-12-18 14:43:33 -08:00
Frank Praznik
91bb1bb6fd
wayland: Check the returned display value for null
In reality, this condition will never occur, since the index is checked before calling the display retrieval function, but aggressive LTO with jump threading can generate a warning if this isn't explicitly checked.
2024-12-03 11:53:14 -05:00
Sam Lantinga
e539135104 Fixed potential buffer overflow
(cherry picked from commit 6aab5a089d)
2024-12-03 08:34:34 -08:00
Ivan Epifanov
6428cee892 Vita: implement mousewheel and buttons 4/5 2024-11-27 08:23:40 -08:00
Peter Seiderer
b64540dd66 DirectFB: fix DirectFB_SetTextureScaleMode() declaration
Fixes:

  src/video/directfb/SDL_DirectFB_render.c: In function ‘DirectFB_CreateRenderer’:
  src/video/directfb/SDL_DirectFB_render.c:1153:35: error: assignment to ‘void (*)(SDL_Renderer *, SDL_Texture *, SDL_ScaleMode)’ from incompatible pointer type ‘void (*)(void)’ [-Wincompatible-pointer-types]
   1153 |     renderer->SetTextureScaleMode = DirectFB_SetTextureScaleMode;
        |                                   ^

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
Notes:
  - declaration was just recently changed by commit 'Fix warning for Android
    NDK compiler: "function declaration without a prototype is deprecated in
    all versions of C [-Wstrict-prototypes]"', see
    ccade50587
2024-11-27 08:21:10 -08:00