Commit Graph

104 Commits (master)

Author SHA1 Message Date
DSOE1024 b982794b23 Implement XFCE support in os_linuxbsd.cpp
Added support for XFCE by executing 'exo-open' alongside 'kde-open'.
Refactor error handling in os_linuxbsd.cpp
2025-12-08 21:21:45 +07:00
David Snopek cb7d00efad Correctly mark frame start for profilers (Tracy/Perfetto) on Linux 2025-11-21 14:59:55 +07:00
Lukas Tenbrink c3747884da Add some important profiling hooks. 2025-11-08 00:08:48 +07:00
Thaddeus Crews 5935a32e32
Core: Cleanup headers in `core/config`
- `MainLoop` now forward-declared in `OS`
2025-10-06 09:20:56 +07:00
Thaddeus Crews d1d28c0bcf
Merge pull request #111223 from Ivorforce/remove-iterator-include
Replace `std::size` usage with `std_size` to avoid `<iterator>` include.
2025-10-06 09:06:49 +07:00
chocola-mint ead282ff13 Remove `file_access.h` and `script_backtrace.h` includes from `logger.h`. 2025-10-05 17:49:23 +07:00
Lukas Tenbrink 1db0a60dc0 Replace `std::size` usage with `std_size` to avoid `<iterator>` include. 2025-10-05 00:26:11 +07:00
Aaron Franke 3d1c9fd5de
Move server files into their subfolders 2025-09-30 19:39:39 +07:00
kobewi d61a337a70 Improve usage of String.split() vs get_slice() 2025-09-19 16:31:55 +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
Pedro J. Estébanez 820380817a Exclude RD creation test functions from templates 2025-05-15 10:12:38 +07:00
Thaddeus Crews 01fc9aee6c
Core: Modernize C headers with C++ equivalents 2025-05-02 08:23:01 +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
A Thousand Ships 331a43a9d8
Add `String::remove_char(s)` methods for performance and convenience 2025-03-10 13:19:28 +07:00
Thaddeus Crews c937b6d180
Merge pull request #102419 from Ivorforce/std-size
Use `std::size` instead of `sizeof(a) / sizeof(a[0])` pattern throughout the codebase.
2025-03-07 15:12:25 +07:00
Pāvels Nadtočajevs 6ed12bfc5d [Linux/BSD] Offload RenderingDevice creation test to subprocess. 2025-03-04 13:18:26 +07:00
Lukas Tenbrink e34f1f504c Use `std::size` instead of `sizeof(a) / sizeof(a[0])` pattern throughout the codebase. 2025-02-07 14:57:48 +07:00
Student Main f39614aa5a Ignore case when parse /proc/cpuinfo 2024-12-06 00:19:58 +07:00
Thaddeus Crews bb5f390fb9
Style: Apply `clang-tidy` fixes (superficial)
• `modernize-use-bool-literals`, `modernize-use-nullptr`, and `readability-braces-around-statements`
2024-11-04 12:11:14 +07:00
A Thousand Ships a0dbdcc3ab
Replace `find` with `contains/has` where applicable
* Replaces `find(...) != -1` with `contains` for `String`
* Replaces `find(...) == -1` with `!contains` for `String`
* Replaces `find(...) != -1` with `has` for containers
* Replaces `find(...) == -1` with `!has` for containers
2024-05-08 12:37:42 +07:00
sambler 97e95e1750 Make sysctl calls on FreeBSD
The OS module get_unique_id and get_processor_name rely
on linux files which don't exist on a standard FreeBSD install,
make sysctl calls to get the required data.
2024-04-08 19:18:03 +07:00
LinuxUserGD 6307cebf37
os_linuxbsd.cpp: include `servers/rendering_server.h` 2024-02-19 01:14:30 +07:00
Riteo 2e07dcf1e7 Wayland: suspend window after frame timeout or suspend state
This is a pretty popular approach that took a while for me to wrap my
head around and which only recently got "official" support through an
update (xdg_shell version 6), so I think that this is all-in-all a
better option than the overkill 2000Hz ticking we have now :P

Basically, we wait for a frame event and, if either too much time passes
or we get the new `suspended` state, we consider the window as "hidden"
and stop drawing, ticking by the low usage rate.

This should work great for KDE and Mutter, which support the new state,
but not yet for sway, which is still stuck at a very old xdg_shell
version and thus falls back to the timeout approach.

Be aware that if we rely on timing out the engine will have to stall for
the whole timeout, which _could_ be problematic but doensn't seem like
it. Further testing is needed.

Special thanks go to the guys over at #wayland on OFTC, who very
patiently explained me this approach way too many times.
2024-02-15 23:48:56 +07:00
Muller-Castro a8bc9f3e78 Add const lvalue ref to core/* container parameters 2024-02-14 11:20:36 +07:00
Riteo 7e0f7d3abd Add Wayland support
Not everything is yet implemented, either for Godot or personal
limitations (I don't have all hardware in the world). A brief list of
the most important issues follows:

- Single-window only: the `DisplayServer` API doesn't expose enough
information for properly creating XDG shell windows.

- Very dumb rendering loop: this is very complicated, just know that
the low consumption mode is forced to 2000 Hz and some clever hacks are
in place to overcome a specific Wayland limitation. This will be
improved to the extent possible both downstream and upstream.

- Features to implement yet: IME, touch input, native file dialog,
drawing tablet (commented out due to a refactor), screen recording.

- Mouse passthrough can't be implement through a poly API, we need a
rect-based one.

- The cursor doesn't yet support fractional scaling.

- Auto scale is rounded up when using fractional scaling as we don't
have a per-window scale query API (basically we need
`DisplayServer::window_get_scale`).

- Building with `x11=no wayland=yes opengl=yes openxr=yes` fails.

This also adds a new project property and editor setting for selecting the
default DisplayServer to start, to allow this backend to start first in
exported projects (X11 is still the default for now). The editor setting
always overrides the project setting.

Special thanks to Drew Devault, toger5, Sebastian Krzyszkowiak, Leandro
Benedet Garcia, Subhransu, Yury Zhuravlev and Mara Huldra.
2024-01-30 16:44:47 +07:00
Wilson E. Alvarez a3cb1b096f
Add const references detected by clang-tidy 2023-12-16 13:36:44 +07:00
bruvzg 6cc314e0fa
[Linux/Freedesktop] Implement native file selection dialog support. 2023-08-17 10:56:16 +07:00
Rémi Verschelde a6e75f3971
Fix Linux `move_to_trash` wrongly reporting files as not found
We can't rely on the error code from `gio` or `kioclient5`, in my
rudimentary testing they return `1` for both missing files and other
situations like not having a Trash can on the mounted volume.

Fixes #79108.
2023-07-11 09:55:27 +07:00
Rémi Verschelde 01e84b1da1
Merge pull request #67158 from amoriqbal/fix_error_message
Fix the conditions for firing 'No such file or directory' error on Linux `move_to_trash`
2023-06-19 10:26:50 +07:00
Danil Alexeev 2d2b2cadfa
Fix `bsd` feature tag includes only "other BSDs" 2023-06-15 16:25:18 +07:00
Rémi Verschelde 9e4315bb50
Style: Harmonize header includes in platform ports
This applies our existing style guide, and adds a new rule to that style
guide for modular components such as platform ports and modules:

Includes from the platform port or module should be included with relative
paths (relative to the root folder of the modular component, e.g.
`platform/linuxbsd/`), in their own section before Godot's "core" includes.

The `api` and `export` subfolders also need to be handled as self-contained
(and thus use relative paths for their "local" includes) as they are all
compiled for each editor platform, without necessarily having the api/export
matching platform folder in the include path.
E.g. the Linux editor build will compile `platform/android/{api,export}/*.cpp`
and those need to use relative includes for it to work.
2023-06-08 15:19:19 +07:00
MJacred 2c5e2196bd Replace get_rendering_device() call to prevent crashes on OpenGL.
And make OpenGL video adapter info align with Vulkan.
2023-06-06 23:29:36 +07:00
MJacred 9e5bf3d589 Copy system info to clipboard + Update bug_report.yml
plus minor static-related fixes
* linuxbsd: get_systemd_os_release_info_value() -> static breaks usage if used multiple times
* windows/linuxbsd: get_video_adapter_driver_info() writes info into static
* linuxbsd: get_distribution_name() + get_version() -> write bsd fallback into static variable
* windows/uwp/android: remove unnecessary use of static
2023-05-27 18:21:23 +07:00
Rémi Verschelde 258fabdbb3
Merge pull request #76836 from Faless/tls/system_certs
[TLS] Add support for platform-specific CA bundles.
2023-05-12 11:17:31 +07:00
Fabio Alessandrelli 6fd9982358 [TLS] Add support for platform-specific CA bundles.
Adds a new OS::get_system_ca_certs method which can be implemented by
platforms to retrieve the list of trusted CA certificates using OS
specific APIs.

The function should return the certificates in PEM format, and is
currently implemented for Windows/macOS/LinuxBSD(*)/Android.

mbedTLS will fall back to bundled certificates when the OS returns no
certificates.

(*) LinuxBSD does not have a standardized certificates store location.
    The current implementation will test for common locations and may
    return an empty string on some distributions (falling back to the
    bundled certificates).
2023-05-12 09:58:23 +07:00
David Snopek 87fcee2d7f Fix 'linux' and specific BSD feature tags 2023-05-11 16:58:52 +07:00
Juan Linietsky 273a6eeb66 Redo how the remote filesystem works
Instead of reading files over the network, the new version uses a local file cache and only updates files when it changes.

The original remote filesystem was created 14 years ago, when ethernet was faster than hard drives or even flash. Also, mobile devices have a very small amount of storage.
Nowadays, this is no longer the case so the approach is changed to using a persistent cache in the target device.

Co-authored-by: m4gr3d
2023-05-08 11:57:54 +07:00
bruvzg bed46f723c
[Linux/BSD] Add dynamically loaded library version checks. 2023-03-20 08:10:56 +07:00
bruvzg 8d501a2dc3
[TextServer] Add invalid font scaling check, restrict Linux/BSD system fonts lookup to TrueType/CFF only. 2023-03-10 09:36:17 +07:00
bruvzg dd068794c3
[Linux] Make SO wrapper usage optional. 2023-02-16 16:38:47 +07:00
Hugo Locurcio e7779dc62d
Use a "warning" icon in `OS.alert()` on Linux/*BSD
This is the same icon as used on Windows.
2023-02-02 15:17:15 +07:00
Rémi Verschelde d95794ec8a
One Copyright Update to rule them all
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.

It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).

We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).

Also fixed "cf." Frenchism - it's meant as "refer to / see".
2023-01-05 13:25:55 +07:00
bruvzg 89db7f8e7c
[Linux/BSD] Fix build without fontconfig. 2022-12-05 07:56:44 +07:00
bruvzg ecec415988
Use system fonts as fallback and improve system font handling.
Add support for font weight and stretch selection when using system fonts.
Add function to get system fallback font from a font name, style, text, and language code.
Implement system font support for Android.
Use system fonts as a last resort fallback.
2022-12-04 18:44:20 +07:00
bruvzg 40832cc670
[fontconfig] Reject font substitutes if non-alias name was used. 2022-11-15 11:17:44 +07:00
dzil123 d22ab7c85b Cache OS_LinuxBSD::get_system_dir(SYSTEM_DIR_DESKTOP) 2022-11-12 22:38:32 +07:00
Rémi Verschelde 889868cbbc
Merge pull request #68182 from Riteo/x11-folder
linuxbsd: move all X11 stuff in its own directory
2022-11-03 00:32:30 +07:00
Riteo 593c571d6a linuxbsd: move all X11 stuff in its own directory
This allows implementing `DisplayServer`s like Wayland without making a
mess in the source tree.
2022-11-02 20:48:46 +07:00
bruvzg 060d62e0dc
Load and use system emoji font in the editor. 2022-11-01 11:04:58 +07:00
zCubed3 e7091d07cd
Fix OS.get_video_adapter_driver_info crash 2022-10-27 15:45:21 +07:00