summaryrefslogtreecommitdiffstats
path: root/platform/linuxbsd/os_linuxbsd.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix copyright headers referring to GodotSpartan3222024-10-271-2/+2
|
* Rebrand preambles to RedotSpartan3222024-10-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | (cherry picked from commit e8542b06acca3c1bdeee4b528411771f0819f084) Credits: Co-authored-by: Skogi <skogi.b@gmail.com> Co-authored-by: Spartan322 <Megacake1234@gmail.com> Co-authored-by: swashberry <swashdev@pm.me> Co-authored-by: Christoffer Sundbom <christoffer_karlsson@live.se> Co-authored-by: Dubhghlas McLaughlin <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: McDubh <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: Dubhghlas McLaughlin <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: radenthefolf <radenthefolf@gmail.com> Co-authored-by: John Knight <80524176+Tekisasu-JohnK@users.noreply.github.com> Co-authored-by: Adam Vondersaar <adam.vondersaar@uphold.com> Co-authored-by: decryptedchaos <nixgod@gmail.com> Co-authored-by: zaftnotameni <122100803+zaftnotameni@users.noreply.github.com> Co-authored-by: Aaron Benjamin <lifeartstudios@gmail.com> Co-authored-by: wesam <108880473+wesamdev@users.noreply.github.com> Co-authored-by: Mister Puma <MisterPuma80@gmail.com> Co-authored-by: Aaron Benjamin <lifeartstudios@gmail.com> Co-authored-by: SingleError <isaaconeoneone@gmail.com> Co-authored-by: Bioblaze Payne <BioblazePayne@gmail.com>
* Replace `find` with `contains/has` where applicableA Thousand Ships2024-05-081-2/+2
| | | | | | | * 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
* Make sysctl calls on FreeBSDsambler2024-04-081-1/+25
| | | | | | 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.
* os_linuxbsd.cpp: include `servers/rendering_server.h`LinuxUserGD2024-02-191-0/+1
|
* Wayland: suspend window after frame timeout or suspend stateRiteo2024-02-151-8/+0
| | | | | | | | | | | | | | | | | | | | | | 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.
* Add const lvalue ref to core/* container parametersMuller-Castro2024-02-141-1/+1
|
* Add Wayland supportRiteo2024-01-301-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Add const references detected by clang-tidyWilson E. Alvarez2023-12-161-1/+1
|
* [Linux/Freedesktop] Implement native file selection dialog support.bruvzg2023-08-171-0/+21
|
* Fix Linux `move_to_trash` wrongly reporting files as not foundRémi Verschelde2023-07-111-23/+11
| | | | | | | | 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.
* Merge pull request #67158 from amoriqbal/fix_error_messageRémi Verschelde2023-06-191-13/+22
|\ | | | | | | Fix the conditions for firing 'No such file or directory' error on Linux `move_to_trash`
| * Changed the conditions for firing 'No such file or directory' errorAmor Iqbal2022-10-101-13/+22
| |
* | Fix `bsd` feature tag includes only "other BSDs"Danil Alexeev2023-06-151-1/+9
| |
* | Style: Harmonize header includes in platform portsRémi Verschelde2023-06-081-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Replace get_rendering_device() call to prevent crashes on OpenGL.MJacred2023-06-061-3/+3
| | | | | | | | And make OpenGL video adapter info align with Vulkan.
* | Copy system info to clipboard + Update bug_report.ymlMJacred2023-05-271-21/+26
| | | | | | | | | | | | | | | | 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
* | Merge pull request #76836 from Faless/tls/system_certsRémi Verschelde2023-05-121-0/+35
|\ \ | | | | | | | | | [TLS] Add support for platform-specific CA bundles.
| * | [TLS] Add support for platform-specific CA bundles.Fabio Alessandrelli2023-05-121-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* | | Fix 'linux' and specific BSD feature tagsDavid Snopek2023-05-111-0/+5
|/ /
* | Redo how the remote filesystem worksJuan Linietsky2023-05-081-0/+4
| | | | | | | | | | | | | | | | | | 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
* | [Linux/BSD] Add dynamically loaded library version checks.bruvzg2023-03-201-0/+10
| |
* | [TextServer] Add invalid font scaling check, restrict Linux/BSD system fonts ↵bruvzg2023-03-101-64/+73
| | | | | | | | lookup to TrueType/CFF only.
* | [Linux] Make SO wrapper usage optional.bruvzg2023-02-161-0/+4
| |
* | Use a "warning" icon in `OS.alert()` on Linux/*BSDHugo Locurcio2023-02-021-2/+4
| | | | | | | | This is the same icon as used on Windows.
* | One Copyright Update to rule them allRémi Verschelde2023-01-051-29/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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".
* | [Linux/BSD] Fix build without fontconfig.bruvzg2022-12-051-0/+2
| |
* | Use system fonts as fallback and improve system font handling.bruvzg2022-12-041-26/+124
| | | | | | | | | | | | | | 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.
* | [fontconfig] Reject font substitutes if non-alias name was used.bruvzg2022-11-151-0/+15
| |
* | Cache OS_LinuxBSD::get_system_dir(SYSTEM_DIR_DESKTOP)dzil1232022-11-121-7/+6
| |
* | Merge pull request #68182 from Riteo/x11-folderRémi Verschelde2022-11-031-1/+1
|\ \ | | | | | | | | | linuxbsd: move all X11 stuff in its own directory
| * | linuxbsd: move all X11 stuff in its own directoryRiteo2022-11-021-1/+1
| | | | | | | | | | | | | | | This allows implementing `DisplayServer`s like Wayland without making a mess in the source tree.
* | | Load and use system emoji font in the editor.bruvzg2022-11-011-1/+10
|/ /
* | Fix OS.get_video_adapter_driver_info crashzCubed32022-10-271-0/+4
| |
* | Merge pull request #66102 from MJacred/feature/getvideoadapterdriverinfoRémi Verschelde2022-10-111-0/+199
|\ \ | |/ |/| | | Fetch video adapter driver name and version from OS
| * Fetch video adapter driver name and version from OS on Linux/*BSD and WindowsMJacred2022-10-111-0/+199
| |
* | Unix: Remove now unnecessary I/O defines, cleanupRémi Verschelde2022-10-031-3/+1
|/ | | | | | | | | | | | | | | | - `LIBC_FILEIO_ENABLED` wasn't defined anywhere, even in _other platforms_. - `NO_NETWORK` is also never defined. It probably isn't enough anyway to disable network APIs in the current codebase. - `UNIX_SOCKET_UNAVAILABLE` is never defined in this code but used by some other platforms, clarify that. - `NO_STATVFS` can be removed as Android supports it since API level 19, which is our current min SDK level. It's also only used for `DirAccessUnix::get_space_left()` which is anyway overridden by `DirAccessJAndroid::get_space_left()` so it shouldn't make a difference. * Fixed documentation for `DirAccess.get_space_left()`. - `NO_FCNTL` is likely also a remnant of early Android days, in current NDK r23 it seems to be available. Also cleaned up unused `fcntl.h` includes. - `NO_ALLOCA` is never defined, and we use alloca in many places now.
* Add get_distribution_name() and get_version() to OSMJacred2022-09-161-0/+37
| | | | | | supports: LinuxBSD, Windows, macOS, iOS, Android, UWP Co-authored-by: bruvzg
* Fixes #65377: get_datetime_* functions can return wrong valuesJames2022-09-101-4/+3
|
* Rename String `plus_file` to `path_join`Aaron Franke2022-08-291-7/+7
|
* Remove unused force_quit variable from many OS abstractionsPedro J. Estébanez2022-08-271-4/+1
|
* Fix memory leak when accessing/listing system fonts.bruvzg2022-08-091-0/+3
|
* Load fontconfig libraries dynamically.bruvzg2022-07-271-1/+17
|
* Fix Linux build without fontconfig.bruvzg2022-07-271-3/+3
|
* Implement support for loading system fonts on Linux, macOS / iOS and Windows.bruvzg2022-07-261-0/+89
|
* Improve embedded PCK loading and exporting.bruvzg2022-04-201-0/+85
| | | | | | | | | | Windows export process: Limit size of executable with embedded PCK to 4 GB. Use "rcedit" before embedding PCK. Capture and process "rcedit" errors. Windows, Linux: Add support for PCK loading from executable "pck" section.
* Narrow FileAccess scope to prevent deadlocks.bruvzg2022-04-121-3/+5
|
* Make FileAccess and DirAccess classes reference counted.bruvzg2022-04-111-10/+8
|
* Convert uses of `DirAccess *` to `DirAccessRef` to prevent memleaksRémi Verschelde2022-03-111-2/+1
| | | | | | | | `DirAccess *` needs to be deleted manually, and this is often forgotten especially when doing early returns with `ERR_FAIL_COND`. `DirAccessRef` is deleted automatically when it goes out of scope. Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
* Merge pull request #58335 from maiself/fix-directory-delete-linuxRémi Verschelde2022-03-101-19/+20
|\