Commit Graph

1064 Commits (cb1569345a6f17da08241e645ab03cb2e1b78d2f)

Author SHA1 Message Date
Thaddeus Crews be11bf1d6b
Merge pull request #110540 from akien-mga/linux-system-libturbojpeg
Linux: Allow unbundling libjpeg-turbo to use system package
2025-09-18 21:02:31 +07:00
Mounir Tohami 1b697aff38 X11 input: prevent non-printable keys from producing empty Strings 2025-09-18 06:56:22 +07:00
Lukas Tenbrink abe3b481ae Make conversions from `LocalVector` to `Vector` explicit. 2025-09-16 21:41:28 +07:00
Thaddeus Crews 4dec6af2c8
Merge pull request #108613 from Repiteo/scons/fix-defines
SCons: Ensure `CPPDEFINES` is properly utilized
2025-09-16 11:44:45 +07:00
Thaddeus Crews 94b5658cd2
Merge pull request #106798 from gelvinp/avoid_xcb_crash
Workaround X11 crash issue
2025-09-16 09:48:55 +07:00
Will Thompson 3d322c3f36 linux/bsd/mac: Use pkill to stop remote instance over SSH
Previously, the PIDs of any running instances of the game on the remote
device were found with `pgrep`, whose output was passed as parameters to
`kill`. The problem with doing this is that passing zero arguments to
`kill` (which happens when no instances of the game are running
remotely) is an error: it shows the command usage, and exits with status
2 indicating a command-line syntax error:

    $ kill
    kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
    $ echo $?
    2

As far as I can tell, all systems that have a `pgrep` command also have
a `pkill` command which accepts (a superset of) the same parameters as
`pgrep` and kills the matched processes instead of listing them on
STDOUT.

In the case where no processes match, `pkill` exits with status 1; but
does so silently.

Invoke `pkill` rather than `pgrep` + `kill`.
2025-09-16 11:25:48 +07:00
Rémi Verschelde 6d8aa8582f
Linux: Allow unbundling libjpeg-turbo to use system package 2025-09-15 23:52:48 +07:00
Lukas Tenbrink 4c0026b053 Update links to the contributing section of the docs to the appropriate new sections. 2025-09-12 01:04:14 +07:00
Pāvels Nadtočajevs 76433b0ede
Fix Wayland build with OpenGL disabled. 2025-09-06 18:37:49 +07:00
ArchercatNEO 188b47a29b Wayland: Implement the xdg-toplevel-icon-v1 protocol
Closes #87747
Requires a compositor which supports xdg-toplevel-icon-v1.
As of this commit only KWin supports this protocol.
2025-08-22 09:45:28 +07:00
Pāvels Nadtočajevs 0edb6bd4a0
[Linux/BSD] Initialize DBus only once. 2025-08-22 09:26:11 +07:00
Pāvels Nadtočajevs 98bef37f55
Use org.a11y.Status/ScreenReaderEnabled on Linux. 2025-08-18 17:36:49 +07:00
Nintorch 0e19ad507e Fix the usage of libudev and dbus with SDL
Previously, libudev was ignored if SOWRAP_ENABLED was defined (it is defined by default) because otherwise it would crash CI builds due to a missing header, and dbus was always linked dynamically. This commit should fix this issue and make libudev usable again
2025-07-31 15:05:06 +07:00
Thaddeus Crews 9471a4ace7
Merge pull request #108659 from jdavasligil/x11-unicode-keysym-fix
Add keypad codes to the keysym unicode map.
2025-07-23 13:27:09 +07:00
Pāvels Nadtočajevs e407f55fbf
Fix editor one-click icons not showing. 2025-07-21 12:18:44 +07:00
jdavasligil 93cd0a136f Add keypad codes to the keysym unicode map #74578 2025-07-18 14:30:28 +07:00
Pāvels Nadtočajevs f20e5152ad
[EditorExportPlatform] Move initialization to a dedicated method. 2025-07-16 08:55:23 +07:00
Thaddeus Crews 61956f2e06
SCons: Ensure `CPPDEFINES` is properly utilized 2025-07-14 13:07:53 +07:00
Dery Almas 98537b2e0c Wayland: Fix error condition in window_get_current_screen
Leftover from when the Wayland backend was single-window only.
2025-07-14 15:56:43 +07:00
A Thousand Ships f11aff3841
Editor: Restructure editor code
Moving various editor files into sub folders to reduce clutter
2025-07-04 18:18:22 +07:00
Haoyu Qiu 9051b546c6 X11: Fix memory leak when using window embedding 2025-06-28 22:50:51 +07:00
Pāvels Nadtočajevs 71dd7b5712
Fix SDL threading on macOS/Linux.
And fixup pkg-config check for SDL on Linux.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2025-06-25 10:36:39 +07:00
Nintorch 0b3496fb4f
Add support for SDL3 joystick input driver
Made possible by EIREXE, xsellier and the SDL team.

This commit includes statically linked SDL3 for Windows, Linux and macOS.
The vendored copy of SDL3 was setup to only build the required subsystems
for gamepad/joystick support, with some patches to be able to make it as
minimal as possible and reduce the impact on binary size and code size.

Co-authored-by: Álex Román Núñez <eirexe123@gmail.com>
Co-authored-by: Xavier Sellier <xsellier@gmail.com>
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2025-06-25 01:28:50 +07:00
Riteo Siuga b60b68055f Wayland: Fix division by zero when scale is less than 1
The `Vector2i` division operator casts doubles down to `int32_t`. It
would thus truncate the fractional scale factor to 0 if less than 1,
resulting in a FPE on x86_64.
2025-06-21 03:09:51 +07:00
Thaddeus Crews 856d7108e0
Merge pull request #106414 from Riteo/unexpected-frame
Wayland: Fix stuck pointer buttons on window leave
2025-06-18 18:13:45 +07:00
Thaddeus Crews fda6faeebf
Merge pull request #107356 from ArchercatNEO/wayland-protocols-scsub
Wayland: Simplify including protocols
2025-06-10 19:22:42 +07:00
Rémi Verschelde cc9761c3f0
Merge pull request #107188 from berarma/moviewriter-add-theora
Add Ogg Theora support to MovieWriter
2025-06-10 16:22:57 +07:00
Bernat Arlandis a16b04fe07 Add Ogg Theora support to MovieWriter
Movie Maker mode can now record files in `.ogv` format, which can be
directly viewed in Godot's VideoStreamPlayer node along with most
video players. This is a lossy format with inter-frame compression,
unlike AVI + MJPEG which only performs intra-frame compression.

Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
Co-authored-by: Leo de Penning <leo.depenning@illuminoo.com>
2025-06-10 15:52:24 +07:00
ArchercatNEO 367cabf692 Wayland: Simplify including protocols 2025-06-10 08:39:20 +07:00
Rémi Verschelde c596d93478
Merge pull request #106175 from akien-mga/linux-build-no-dbus
Linux: Fix build with `dbus=no` or `threads=no`
2025-06-09 00:44:12 +07:00
Pāvels Nadtočajevs 1484771f26
Fix native file dialog crash with invalid filter. 2025-06-06 09:24:42 +07:00
Thaddeus Crews 57bf364f36
Merge pull request #107058 from mihe/script-backtrace-deadlock
Fix various race conditions with capturing of script backtraces
2025-06-03 15:30:16 +07:00
Thaddeus Crews 12b97c250d
Merge pull request #104907 from bruvzg/scr_ids
Cleanup and unify `DisplayServer` screen methods and documentation.
2025-06-02 18:51:45 +07:00
Mikael Hermansson 6929823838 Fix various race conditions with capturing of script backtraces 2025-06-02 19:46:19 +07:00
kobewi b41d6ecf8c Allow to override editor settings per project 2025-06-02 17:51:26 +07:00
Pāvels Nadtočajevs 2d93e004b9
Cleanup and unify `DisplayServer` screen methods and documentation. 2025-06-02 08:03:48 +07:00
Thaddeus Crews de37627404
Merge pull request #102552 from DarioSamo/shader-baker
Add shader baker to project exporter.
2025-05-28 17:09:38 +07:00
Thaddeus Crews 6228c7c762
Merge pull request #105451 from bruvzg/x11_splash
Fix X11 boot splash scaling.
2025-05-28 09:47:42 +07:00
Thaddeus Crews bb47f01481
Merge pull request #106390 from akien-mga/linux-drop-ppc32
Linux: Drop `ppc32` (32-bit PowerPC) architecture support
2025-05-28 09:47:34 +07:00
Dario 5a30a7e7cd Add shader baker to project exporter.
Metal Support contributed by Migeran (https://migeran.com) and Stuart Carnie.

Co-authored-by: Stuart Carnie <stuart.carnie@gmail.com>
Co-authored-by: Gergely Kis <gergely.kis@migeran.com>
2025-05-27 12:45:27 +07:00
Riteo 67c317c58d Wayland: Add missing return in selection logic
Fixup to "Wayland: Check selection devices before using them"

This slipped under the radar... until for some reason optimized builds
started crashing, perhaps due to timing-related shenanigans, no idea.
2025-05-26 20:36:15 +07:00
Patrick Gelvin 6842a5861b Workaround X11 crash issue 2025-05-25 08:07:24 +07:00
Thaddeus Crews 202b1176a4
Merge pull request #106251 from ArchercatNEO/wayland-cursor-shape
[Wayland] Implement the cursor-shape-v1 protocol
2025-05-16 10:29:02 +07:00
Thaddeus Crews 902d2b45bb
Merge pull request #106400 from RandomShaper/win_compat
Improve platform compatibility of Windows and Direct3D 12
2025-05-15 10:22:16 +07:00
ArchercatNEO 3cd7b5b9a8 [Wayland] Implement the cursor-shape-v1 protocol
Related #106229. The cursor-shape protocol allows us to not have to deal with cursor theming and instead depend on the
compositor for it.
This still does not quite solve the issue when the compositor doesn't implement the protocol
(or running under the x11 backend) but for gnome/kde and a few more this should resolve things.
2025-05-15 15:42:48 +07:00
Pedro J. Estébanez 820380817a Exclude RD creation test functions from templates 2025-05-15 10:12:38 +07:00
Riteo a3913b045d Wayland: Fix stuck pointer buttons on window leave
This issue came from the frame-based refactoring done in the multiwin
PR.

It looks like some (all?) compositors group certain events alongside
`wl_pointer::leave`, which I absolutely did not expect. The docs don't
seem to mention it either from what I can tell.

We now fall-back on the old pointed window if and only if the current
window is invalid and the old one isn't. Each state fetch is guarded
with an `ERR_FAIL_NULL` so this should still catch any potentially
corrupted window with missing data but a valid ID.

I also added the usual big comment so that this "quirk" does not get
lost to time.
2025-05-14 23:30:16 +07:00
mara d213e72866 wayland: Unbreak build with libdecor=no
In #101774, some libdecor-specific code was added, but without adding the guards. This broke the build with
`libdecor=no`.

Add `#ifdef` guard as necessary.
2025-05-14 13:36:45 +07:00
Rémi Verschelde 1de9789806
Linux: Drop `ppc32` (32-bit PowerPC) architecture support
This was added together with `ppc64le` in #54490, but seemingly only for the
purpose of getting it to compile on a Linux distro that aims at maximizing
support for all CPU architectures.

I don't think anyone has ever _run_ Godot on a `ppc32` system (do those even
support OpenGL ES 3.0?) and so I don't think we should aim to support it.

Debian dropped support for its PowerPC (`ppc32`) arch in Debian 9, released
in 2017.
2025-05-14 10:22:12 +07:00
Pāvels Nadtočajevs a12503b88c
[X11] Fix GL init memory leak when transparency is enabled. 2025-05-13 13:20:02 +07:00
Rémi Verschelde 8b93b67e14
Merge pull request #106315 from Riteo/popping-up-everywhere
Wayland: Fix error spam when closing popup
2025-05-13 01:05:49 +07:00
Riteo c3b04e6e1e Wayland: fix error spam when closing popup
Previously we did not check whether the value actually changed or not
and thus would get constant errors for no reason.
2025-05-12 05:11:24 +07:00
Pāvels Nadtočajevs 5441a82cfb
Do not call `accessibility_set_window_rect` on Wayland, fix main windows accessibility context creation. 2025-05-11 12:51:46 +07:00
Rémi Verschelde e9e8ddc5be
Linux: Fix build with `dbus=no` or `threads=no` 2025-05-09 15:26:13 +07:00
Rémi Verschelde a6398d71a3
Improve script backtrace print in crash handlers
Also fix the editor crash handler message for bug reports not properly
using the `.editor` override.
2025-05-07 09:52:50 +07:00
Thaddeus Crews 4cb030d6bf
Merge pull request #106089 from mihe/rogue-newlines
Fix empty lines being added for errors with no script backtrace
2025-05-06 08:38:04 +07:00
Mikael Hermansson 31b90246e7 Fix empty lines being added for errors with no script backtrace 2025-05-05 13:27:21 +07:00
Riteo Siuga d4dabd15aa Wayland: Ensure pointed window's existence in mouse_get_position
Should fix a crash with certain compositors.
2025-05-03 20:24:44 +07:00
Thaddeus Crews 01fc9aee6c
Core: Modernize C headers with C++ equivalents 2025-05-02 08:23:01 +07:00
tthhr e7a3729175 fix:Compile error in wayland display server when compiling linuxbsd platform after disabling dbus 2025-04-30 14:22:52 +07:00
Adam Scott 1fbc0c5631
[Buildsystem] Add `EnumVariable(ignorecase=2)` 2025-04-29 13:35:40 +07:00
Thaddeus Crews 3947cbe3b2
Merge pull request #104386 from Repiteo/core/cpp-math
Core: Replace C math headers with C++ equivalents
2025-04-27 19:21:22 +07:00
Thaddeus Crews 2bf7184ed9
Merge pull request #103865 from Repiteo/scons/__has_include
SCons: Remove `check_c_headers`
2025-04-25 11:36:06 +07:00
Thaddeus Crews 041c69db2f
Merge pull request #101454 from Riteo/fifo_ftw
Wayland: Handle `fifo_v1` and clean up suspension logic
2025-04-25 11:36:04 +07:00
Thaddeus Crews 007717faf9
SCons: Remove `check_c_headers`
• Can instead check for headers directly with `__has_include`, a C++17 feature
2025-04-25 11:30:39 +07:00
Pāvels Nadtočajevs e61edcadb8
Print script backtrace in the crash handler. 2025-04-25 09:15:20 +07:00
Riteo Siuga 48882f3ca4 Wayland: Handle fifo_v1 and clean up suspension logic
Before, the WSI was unfortunately quite broken and we had work around it
by manually pacing frames. Needless to say it was not an ideal solution.

Now, the WSI can make use of the new fifo_v1 protocol to work properly.
If it's available, we'll trust the WSI by disabling manual frame pacing.

While we're at it, let's clean up the suspension code a bit by removing
some duplicated stuff and handling the suspension state through a switch
case.
2025-04-20 18:05:35 +07:00
Riteo 2e41412ee4 Wayland: Emulate frame event for old wl_seat versions
Multiwindow support simplified input handling by processing all data
only during a `wl_seat::frame` event, which got introduced in wl_seat
version 5. If the compositor reports an older version, we manually call
the frame event handler.
2025-04-20 17:11:08 +07:00
Thaddeus Crews ad40939b6f
Core: Replace C math headers with C++ equivalents
- Minor restructuring to ensure `math_funcs.h` is the central point for math functions
2025-04-16 15:49:02 +07:00
Pāvels Nadtočajevs 5ddaaa93e6
Fix X11 boot splash scaling. 2025-04-16 10:45:43 +07:00
Thaddeus Crews 0d267e7b1e
Core: Add dedicated `BitField` template 2025-04-11 11:53:26 +07:00
Thaddeus Crews cad0cd94ef
Merge pull request #105225 from bruvzg/ds_gdsoft
Change `DisplayServerMacOS` from `GDCLASS` to `GDSOFTCLASS`. Add `GDSOFTCLASS` to other display servers.
2025-04-10 16:53:42 +07:00
Thaddeus Crews cade15a163
Merge pull request #92475 from AThousandShips/string_replace_char
Add `String::replace_char(s)` methods for performance and convenience
2025-04-10 10:18:16 +07:00
Thaddeus Crews 722ddf6e6f
Merge pull request #103802 from Rindbee/set-unsupported-to-true-on-error-in-FreeDesktopScreenSaver
Set `unsupported` to true on error in `FreeDesktopScreenSaver`
2025-04-10 10:18:14 +07:00
A Thousand Ships 889410dcda
Add `String::replace_char(s)` methods for performance and convenience 2025-04-10 13:08:45 +07:00
Pāvels Nadtočajevs 0497522933
Change `DisplayServerMacOS` from `GDCLASS` to `GDSOFTCLASS`. Add `GDSOFTCLASS` to other display servers. 2025-04-10 09:18:58 +07:00
Thaddeus Crews 7a6c3b309f
Merge pull request #105130 from bruvzg/uri_fix_plus
Add uri_file_decode to handle + in file names.
2025-04-09 18:11:56 +07:00
Thaddeus Crews a8598cd8e2
Merge pull request #71542 from bruvzg/export_project_settings
[Export] Use project settings overrides with the target preset features instead of current platform features.
2025-04-09 08:51:47 +07:00
Thaddeus Crews 4362b11557
Merge pull request #103405 from van800/shakhov/macosx
Fix `.sln` project generation logic for Rider to support all OS and all C++ toolchains
2025-04-09 08:51:45 +07:00
bruvzg c6739f64df
[Export] Use project settings overrides with the target preset features instead of current platform features. 2025-04-08 21:22:37 +07:00
Thaddeus Crews 295c0f5bd2
Merge pull request #105129 from Riteo/soft-serve
Wayland: Fix error spam for closed windows
2025-04-08 12:32:48 +07:00
Thaddeus Crews e6a61b1ecc
Merge pull request #76829 from bruvzg/ac_kit_direct
Implement screen reader support using AccessKit library.
2025-04-08 12:32:47 +07:00
Pāvels Nadtočajevs 4310cb82b8
AccessKit integration for macOS, Linux, and Windows. 2025-04-08 20:25:47 +07:00
Ivan Shakhov 6ff86e49cf Fix .sln project generation logic for Rider to support all OS and all C++ toolchains
Co-authored-by: Andreia Gaita <shana@spoiledcat.net>
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2025-04-08 15:40:05 +07:00
Pāvels Nadtočajevs 9abe2e5294
Add `uri_file_decode` to handle `+` in file names. 2025-04-07 23:49:17 +07:00
Riteo 36d96f7f37 Wayland: Fix error spam for closed windows
I ported the new softclass macro too blindly. Apparently the various
window messages did not cast properly, skipping some important "deleted
window" checks.
2025-04-07 20:22:08 +07:00
Pāvels Nadtočajevs f37fb49739
Add separate `minimize_disabled` and `maximize_disabled` window flags. 2025-04-07 18:58:11 +07:00
Riteo 84d3adcf2f Wayland: Implement native sub-windows
The backend is now mature enough to not explode with multiple windows
but the `DisplayServer` API still cannot meet some guarantees required
by the various Wayland protocols we use. To meet those guarantees this
patch adds three new elements to the DisplayServer API, with relative
handling logic for `Window` and `Popup` nodes:

 - `WINDOW_EVENT_FORCE_CLOSE`, which tells a window to *forcefully*
close itself and ensure a proper cleanup of its references, as Wayland
enforces this behavior;

 - `WINDOW_FLAG_POPUP_WM_HINT`, which explicitly declares a window as a
"popup", as Wayland enforces this distinction and heuristics are not
reliable enough;

 - `FEATURE_SELF_FITTING_WINDOWS`, which signals that the compositor can
fit windows to the screen automatically and that nodes should not do
that themselves.

Given the size of this feature, this patch also includes various
`WaylandThread` reworks and fixes including:

 - Improvements to frame wait logic, with fixes to various stalls and a
configurable (through a `#define`) timeout amount;

 - A proper implementation of `window_can_draw`;

 - Complete overhaul of pointer and tablet handling. Now everything is
always accumulated and handled only on each respective `frame` event.
This makes their logic simpler and more robust.

 - Better handling of pointer leaving and pointer enter/exit event
sending;

 - Keyboard focus tracking;

 - More solid window references using IDs instead of raw pointers as
windows can be deleted at any time;

 - More aggressive messaging to window nodes to enforce rects imposed by
the compositor.
2025-04-04 20:23:25 +07:00
Pāvels Nadtočajevs 52009b52d2
Detect KDE/LXQt and swap OK/Cancel buttons to Windows style. 2025-04-03 12:47:11 +07:00
Thaddeus Crews 1f56d96cf2
Merge pull request #104893 from Repiteo/scons/external-includes-alt
SCons: Add `CPPEXTPATH` for external includes
2025-04-02 07:48:03 +07:00
Thaddeus Crews f25fc34439
SCons: Add `CPPEXTPATH` for external includes 2025-04-02 07:29:08 +07:00
Yufeng Ying 4f4031a675 Replace size() == 0 with is_empty(). 2025-04-02 19:18:43 +07:00
Pāvels Nadtočajevs 4638ade13f
Enable TTS on demand, instead of fully disabling it when project setting is not set. 2025-04-01 15:24:46 +07:00
Thaddeus Crews abd565eb19
Merge pull request #104844 from Ivorforce/gdsoftclass
Add and require `GDSOFTCLASS` for `Object` subclasses that want to cast but do not use `GDCLASS`.
2025-03-31 19:02:03 +07:00
Lukas Tenbrink fa0a3c9c6e Add and require `GDSOFTCLASS` for `Object` subclasses that want to cast but do not use `GDCLASS`. 2025-03-31 20:49:50 +07:00
Kiro 23129a66ed Replace append_utfx with direct String::utfx 2025-03-30 19:56:38 +07:00
Lukas Tenbrink ffa6ef220b Use `append_` instead of `parse_` for `String` methods. 2025-03-27 17:51:02 +07:00
Thaddeus Crews d35e22ff22
Merge pull request #104415 from zlago/patch-1
Export: Change unportable `echo` in the Linux/macOS debug launcher script
2025-03-24 10:00:57 +07:00
Thaddeus Crews f09ee0171a
Style: Begin integrating simple `.clangd` fixes 2025-03-22 13:24:35 +07:00
zlago 7e0ede1a16 change unportable `echo` in the linux/macos debug launcher script
`-n` and `-e` are not guaranteed to be supported by posix `echo`
2025-03-21 17:31:37 +07:00