Commit Graph

766 Commits

Author SHA1 Message Date
puzzud 140440ee82 [3.x] Prevent double input events on gamepad when running through steam input #79706
Co-authored-by: Eoin O'Neill <eoinoneill1991@gmail.com>
2023-07-20 16:35:44 -04:00
bruvzg 9461923eff
[X11] Use current keyboard layout in OS_X11::keyboard_get_scancode_from_physical. 2023-06-13 09:29:08 +03:00
David Turner d0019e431d [Linux/TTS] Remove unused code
In 4.x, we need to find out what language is being used, so that
we can break words.  In 3.x, we assume that spaces spearate words.

So we do not need to find the language for the current voice.
2023-06-06 11:29:43 -04:00
bruvzg 18ee8da7d6
Add audio/general/text_to_speech project setting to enable/disable TTS. 2023-05-26 20:57:29 +03:00
Rémi Verschelde 8a23fa41a8
Linux: Don't use udev for joypad hotloading when running in a sandbox
udev doesn't work in sandboxes, notably the new Steam container runtime
as found notably on the Steam Deck, and in Flatpak/Snap packages.

Like SDL does, when we detect such a containerized environment, we fall
back to parsing `/dev/input` directly.
See smcv's comments in #76879 for details.

Fixes #76879.

(cherry picked from commit 788cb74cc6)
2023-05-12 11:30:33 +02:00
Rémi Verschelde 1426cd3b3a
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".

Backported from #70885.
2023-01-10 15:26:54 +01:00
nyanpasu64 8f5ccfa21f Fix burning CPU with udev disabled on Flatpak
Fixes #67355.

(cherry picked from commit 0cbd1c85a9)
2022-12-12 14:42:23 +08:00
Riteo d69a9f43ea
Actually set the execinfo flag on non-glibc systems
(cherry picked from commit a3b5353892)
2022-11-30 15:43:02 +01:00
Hugo Locurcio fc4d35432e
Automatically use execinfo for crash handler on *BSD and musl-based Linux
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
(cherry picked from commit 8e04bffbcf)
2022-11-30 15:43:00 +01:00
Abdulrahman Al Zeidi 5ada214c51
Fix static object destructors being called on gpu selection with X11
(cherry picked from commit 5860f81c18)
2022-11-30 15:34:27 +01:00
Rémi Verschelde d5c1baa288 SCons: Refactor handling of `production` flag and per-platform LTO defaults
Fixup to #63288.
See #65583 for the bug report.

Co-authored-by: Cyberrebell <chainsaw75@web.de>
(cherry picked from commit 35a15e6191)
2022-09-20 10:26:17 +02:00
Rémi Verschelde 570e6c1730 SCons: Refactor LTO options with `lto=<none|thin|full>`
Adds support for LTO on macOS and Android.
Disable LTO by default on iOS even if `production=yes` is set.

Also add `linker` option to `server` platform missed in #63283.

Refactor code handling old arguments to make it simpler (breaks compat,
but is explicit enough about it and scripts are easy to fix).
2022-09-05 14:45:12 +02:00
Rémi Verschelde 44af879438 Linux: Fix GNU ld detection for pck_embed linker script
(cherry picked from commit fce3602a1e)
2022-08-29 15:55:45 +02:00
Rémi Verschelde 7dc8ec0c61
Merge pull request #63643 from aaronfranke/3.x-mouse-mode-ch 2022-08-08 14:36:45 +02:00
bruvzg 8147f04db6
[Linux] Disable speech-dispatcher, pulseaudio and udev wrapper builds, when library is not found. 2022-08-06 11:54:20 +03:00
Rémi Verschelde 0bed7ea63f
Merge pull request #61316 from bruvzg/tts_3x
[3.x] Backport text-to-speech support.
2022-08-05 23:45:51 +02:00
Rémi Verschelde 10e8a25ce7 SCons: Fix X11 `use_lld` fallback not being applied 2022-07-31 13:49:12 +02:00
Aaron Franke 0d6e2d1090
Add MOUSE_MODE_CONFINED_HIDDEN to MouseMode enum 2022-07-29 13:46:04 -05:00
Rémi Verschelde 818f1eed31 Code quality: Fix header guards consistency
Adds `header_guards.sh` bash script, used in CI to validate future
changes. Can be run locally to fix invalid header guards.
2022-07-25 14:53:37 +02:00
Rémi Verschelde 364071c2c4
Merge pull request #63283 from akien-mga/3.x-scons-linux-refactor-linker 2022-07-22 11:40:29 +02:00
Hansem Ro a36902f2c1 [3.x, X11] Do case-insensitive search for pen inversion detection 2022-07-21 19:25:39 -07:00
Rémi Verschelde 5bb3063eec SCons: Refactor Linux linker options with `linker=<bfd|gold|lld|mold>`
The new option is `linker` and lets the user specify the argument to
the`-fuse_ld=` linker flag directly. The supported options are:

- `default`: No change, typically uses GNU ld (bfd) unless the user or
  distro picked a different default `/usr/bin/ld`.
- `bfd`: GNU ld from binutils
- `gold`: GNU gold from binutils
- `lld`: lld from LLVM
- `mold`: mold, an extremely fast modern linker, not (yet) intended for
  use in production but great for development speed. Provided by distro
  `mold` package or needs to be compiled from source and installed to
  `/usr` otherwise.

Deprecates the `use_lld=yes` option, and make lld actually usable with
GCC too.

Not all the above are compatible or recommend for LTO, we recommend
using GNU ld with GCC LTO, or lld with LLVM ThinLTO.

(cherry picked from commit 534f85add1daec0669a1f18edd2cc456f9a296ef)
2022-07-22 01:03:31 +02:00
bruvzg 108dcf3bf0
Improve OS.set_current_screen
Fix moving fullscreen windows on macOS and Windows
Fix window position on Linux/X11
2022-07-19 12:23:52 +03:00
Rémi Verschelde 101cbe5d5b
Merge pull request #62723 from hansemro/eraser-detect-3.x 2022-07-15 00:13:15 +02:00
Jan Haller 861e155543 Fix exit code of --help and --version, and test them in CI
Corrects prior regression which caused ERROR output and exit code of 1.

(cherry picked from commit d38d76d039)
2022-07-08 14:54:16 +02:00
Hansem Ro 193d5c11f3 [3.x, macOS, Windows, X11] Add stylus inverted/eraser support to InputEventMouseMotion event 2022-07-04 16:12:11 -07:00
bruvzg 6489fe890e
Backport text-to-speech support. 2022-07-01 11:04:50 +03:00
Wilson E. Alvarez cf38b6f187
Properly check for fullscreen toggle made through the Window Manager 2022-06-29 21:55:51 -04:00
Rémi Verschelde 2cad0055fa
Merge pull request #60806 from pfertyk/issue-60466-nan-in-windows-size 2022-06-15 14:55:01 +02:00
Paweł Fertyk b3f822eaae Fix `set_window_size` crash when using NaN
Fixes #60466.
2022-06-15 13:43:41 +02:00
bruvzg f5fa1ca944
Add readable export errors. Add RTL image vertical alignment support. 2022-06-08 17:56:28 +03:00
Marcel Admiraal 89c758a4de Read and store joypad events in a separate thread on x11 platform 2022-05-05 16:15:33 +02:00
Rémi Verschelde 3b8818e5c4 Crash handler: Use `print_error` to include backtrace in logs 2022-05-05 12:13:04 +02:00
bruvzg bea7c9be5d [3.x] Improve embedded PCK loading and exporting. 2022-04-28 11:11:48 +03:00
Rémi Verschelde d021cef134 Linux: Use pkg-config for alsa, libudev and GL too
It's not needed on most distros as those are found in standard lib
and include paths, but on NixOS they're all in non-standard prefixes,
so we need to rely on information provided by pkg-config.

Fixes #59913.

Co-authored-by: David Lewis <davidalewis00@gmail.com>
(cherry picked from commit 07ad066420)
2022-04-27 12:34:58 +02:00
Haoyu Qiu 95d861694a Fix several OS_X11 memory leaks 2022-04-26 08:39:55 +08:00
Haoyu Qiu bccd23f4bf Fix memory leak when handling Linux primary clipboard 2022-04-01 21:55:53 +08:00
ConteZero 59fb6c9ef0 Fix X11 is_window_maximized 2022-03-31 23:10:32 +02:00
Rémi Verschelde 6c2bd12031 Revert "Fix detected leaks/heap-use-after-free by AddressSanitizer at startup"
This reverts commit 3f94ea6271.

It broke `detect_prime`'s main purpose which is to detect GPUs and use
the best one available.
2022-03-15 09:34:57 +01:00
ConteZero 2ff0735329 Added primary clipboard for Linux 2022-03-14 15:28:36 +01:00
Rémi Verschelde 3f08b72361
Merge pull request #56036 from Rubonnek/fix-startup-leaks-and-use-after-free 2022-03-13 18:09:55 +01:00
Hugo Locurcio cec7c908ca
Add `get_screen_refresh_rate()` to OS
This method can be used to get the refresh rate of a given screen.
It is supported on Windows, macOS, Linux, Android and iOS (but not
HTML5).
2022-03-10 22:10:48 +01:00
Rémi Verschelde 8975470bc2
Merge pull request #58336 from maiself/fix-directory-delete-linux-3.x 2022-03-10 21:29:55 +01:00
Haoyu Qiu 9d6f4a76d1 Fix X11 memory leak after drag & drop file into the editor 2022-03-04 17:50:28 +08:00
Mai Lavelle 2c00b90613 Fix deleting of directories on Linux
Trailing slash of directories was mishandled, and incorrect derived paths
were formed. Stripping the slash fixes this.
2022-02-20 08:43:44 -05:00
Hugo Locurcio 7f9e974a8b
Add an `OS.get_processor_name()` method
This method can be used to get the CPU model name.
It can be used in conjunction with
`VisualServer.get_video_adapter_name()` and
`VisualServer.get_video_adapter_vendor()` for annotating benchmarks
and automatic graphics quality configuration.
2022-02-16 18:39:02 +01:00
Rémi Verschelde 7a16bb2ee4
Fix typos with codespell
Using codespell 2.2-dev from current git.

Added `misc/scripts/codespell.sh` to make it easier to run it once in a
while and update the skip and ignore lists.

(cherry picked from commit 1bdb82c64e)
2022-02-11 09:50:59 +01:00
Rémi Verschelde f50c7f7415
Core: Move generated `VERSION_HASH` to a `.cpp` file
This lets us have its definition in `core/version.h` and avoid
rebuilding a handful of files every time the commit hash changes.

(cherry picked from commit 90162851a7)
2022-02-10 13:06:56 +01:00
Haoyu Qiu f8afd16c89
Fix memory leak when move to trash fails on Linux
(cherry picked from commit 8be49838b3)
2022-01-25 18:55:52 +01:00
Rémi Verschelde ed869729ae
Merge pull request #56755 from madmiraal/fix-45592-3.x 2022-01-24 10:06:24 +01:00