Commit Graph

4891 Commits

Author SHA1 Message Date
Adam Scott 21e1148cc5 Fix godot_js_wrapper_create_cb regression
(cherry picked from commit 8447cbc16d)
2023-10-24 17:25:07 +02:00
SysError99 55ae5b0a78 Fix JavaScript callback memory leak issue
Typo fix

(cherry picked from commit 6a90164a03)
2023-10-24 17:25:07 +02:00
Mario Liebisch 5bb54d3184 Updated compiler version detection
This fixes multiple issues/inconsistencies around  `get_compiler_version()`:
* With no shell allocated, launching the compiler could fail even
  with proper paths being set.
* The return value was described as "an array of version numbers as ints",
  but the function actually returned a `Dictionary` (or `None`).
* Not all calls were properly handling a `None` return value in case of errors.
  On Windows this broke compiling for me since #81869 with default settings.
* Some calls defined inconsistent defaults/fallbacks (`0` or `-1`).

(cherry picked from commit 426e18fd37)
2023-10-24 17:08:57 +02:00
Fredia Huya-Kouadio e0221d1c09 Fix Android input routing logic when using a hardware keyboard
When a hardware keyboard is connected, all key events come through so we can route them directly to the engine.
This is not the case for soft keyboards, for which the current logic was designed as it requires extra processing.

(cherry picked from commit 87102e358d)
2023-10-24 16:52:58 +02:00
Brecht Kuppens 4944a07044 Windows: Always double-quote path when launching explorer.exe to browse
Code now always double quotes the filename to use as command line
argument when calling explorer.exe. In particular, commas in a filename
would be interpreted by explorer.exe as separators for commands.

Similarly a trim_suffix for "file://" is assumed to be a mistake, this
could potentially be a PREfix that we want to strip, but never a suffix.
Since it didn't seem needed in the end, we removed it.

(cherry picked from commit 5608b1d411)
2023-10-24 16:05:00 +02:00
Hugo Locurcio 67e1849bd4 Add missing tutorials to documentation classes
(cherry picked from commit 469c462b76)
2023-10-19 21:59:32 +02:00
PorkrollPosadist f5130502be Use EWMH for DisplayServerX11::_window_minimize_check() implementation
(cherry picked from commit 5666656d42)
2023-10-19 21:49:00 +02:00
bruvzg 02c6d985b8 Fix native popups auto-closing when interacting with non-client area.
(cherry picked from commit e26a6c36c8)
2023-10-19 21:45:11 +02:00
bruvzg eca105f075 [Windows] Do not force redraw window background on mouse pass-through region change.
(cherry picked from commit b240b5be84)
2023-10-19 21:21:02 +02:00
Rémi Verschelde aae20e5b10
Fix various typos with codespell
Also includes typo fixes from #79993, #80068, #80276, and #80303.

Co-authored-by: betalars <contact@betalars.de>
Co-authored-by: spaceyjase <429978+spaceyjase@users.noreply.github.com>
Co-authored-by: Swarkin <102416174+Swarkin@users.noreply.github.com>
Co-authored-by: Raul Santos <raulsntos@gmail.com>

(cherry picked from commit faaf27f284)
2023-10-03 20:45:35 +02:00
Rémi Verschelde 6b37ad40d7
Web: Disable raycast module by default (no occlusion culling)
This means no CPU occlusion culling (and not compiling Embree), unless
you compile custom export templates with `module_raycast_enabled=yes`.

This reduces the memory footprint significantly, and binary size.

Fixes #70621.

Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
(cherry picked from commit 8c40edf8c0)
2023-10-03 20:45:35 +02:00
Rémi Verschelde df0ebc6dfc
SCons: Fix Python 3.12 SyntaxError with regex escape sequences
(cherry picked from commit b362976504)
2023-10-03 20:45:35 +02:00
bruvzg 9308d20d1b
[iOS] Fix build with Xcode 15.
(cherry picked from commit e1c7104e46)
2023-10-03 20:45:32 +02:00
Tyler fed41ae520 Fix Windows console wrapper and icon being swapped
Fixes #80238.

(cherry picked from commit 3cf1e04579)
2023-09-21 15:43:10 +02:00
Fabio Alessandrelli 4355bf9cf3 [Web] Update npm packages
(cherry picked from commit 61e7d47344)
2023-09-21 15:39:16 +02:00
bruvzg 21da3f3847 [X11] Do not fail DisplayServer init if non-essential extensions are missing.
(cherry picked from commit acff87ffda)
2023-09-21 15:28:23 +02:00
Emmanouil Papadeas 252d816459 Fix `JavaScriptBridge.eval()` never returning PackedByteArray
It wrongly returned 20 on array buffers, which used to be the enumerator
value of Godot 3.x's type PoolByteArray, and now is the value of type Color,
while it should return 29 which is the enumerator value for PackedByteArray.

(cherry picked from commit c662491bd4)
2023-09-21 14:57:13 +02:00
Eoin O'Neill 58ff96b8b7 Prevent double input events on gamepad when running through steam input
During GDC and general testing on Steam Deck units, we found that single
gamepads would often register inputs twice under certain circumstances.
This was caused by SteamInput creating a new virtual device, which Godot
registers as a second gamepad. This resulted in two gamepad devices
reporting the same button presses, often leading to buggy input response
on games with no multi-device logic and other-wise could cause intended
Steam rebindings to not work as intended (for example, swapping o and x
on a playstation pad if that feature isn't supported by the game.)

SDL gets around this by taking in a list of devices that are to be
ignored. When valve sees a controller that wants to be rebound via
SteamInput, they push a new VID/PID entry onto the environment
variable `SDL_GAMECONTROLLER_IGNORE_DEVICES` for the original gamepad
so that all game inputs can be read from the virtual gamepad instead.

This leverages the same logic as we are already using SDL gamepad
related HID mappings.

(cherry picked from commit 8de98dbf21)
2023-09-21 14:57:13 +02:00
Rémi Verschelde 269b115d9c SCons: Disable C++ exception handling
Upon investigating the extremely slow MSVC build times in #80513, I noticed
that while Godot policy is to never use exceptions, we weren't enforcing it
with compiler flags, and thus still included exception handling code and
stack unwinding.

This is wasteful on multiple aspects:

- Binary size: Around 20% binary size reduction with exceptions disabled
  for both MSVC and GCC binaries.
- Compile time:
  * More than 50% build time reduction with MSVC.
  * 10% to 25% build time reduction with GCC + LTO.
- Performance: Possibly, needs to be benchmarked.

Since users may want to re-enable exceptions in their own thirdparty code
or the libraries they compile with Godot, this behavior can be toggled with
the `disable_exceptions` SCons option, which defaults to true.

(cherry picked from commit 3907e53ff6)
2023-09-20 22:44:05 +02:00
Rémi Verschelde 8be838481d Allow unbundling OpenXR (for Linux distros)
Copy XrMatrix4x4f_CreateProjectionFov to our OpenXRUtil, instead of relying
on a private header.

(cherry picked from commit 34a07b81ae)
2023-09-20 22:44:05 +02:00
bruvzg a4c041b6b6 [macOS] Workaround Xcode 15 linker bug.
(cherry picked from commit 6da8c7a662)
2023-09-20 22:44:05 +02:00
Rémi Verschelde 12aeb83043 Web: Fix version check for missing scalbnf LTO workaround
The check needs to happen after we set `env["CXX"]`.
Follow-up to #81340.

(cherry picked from commit 50161808c2)
2023-09-20 22:44:04 +02:00
Rémi Verschelde 6122cf3178 Web: Workaround Emscripten 3.1.42+ LTO regression
Fixes #80010.

(cherry picked from commit b064008c07)
2023-09-20 22:44:04 +02:00
ocean (they/them) cd2e003a05 Build system: add option for MSVC incremental linking.
(cherry picked from commit bbafe14970)
2023-09-20 22:44:04 +02:00
bruvzg d3265cf518 [Windows] Add main executable to the console wrapper dependencies to prevent simultaneous linking.
(cherry picked from commit f37ace7036)
2023-09-20 22:44:04 +02:00
Rémi Verschelde cdce948473 Fix GCC -Wmaybe-uninitialized warnings
(cherry picked from commit efdff9cbc2)
2023-09-20 22:44:04 +02:00
Rémi Verschelde 32b7664371 SCons: Disable misbehaving MSVC incremental linking
Fixes #77968.

(cherry picked from commit bc1aef88ee)
2023-09-20 22:44:04 +02:00
Fabio Alessandrelli 5eabd5e04a [Web] Always return -1 as body length in HTTPClientWeb.
Body length cannot be reliably retrieved from the web.
Reading the "content-length" value will return a meaningless value when
the response is compressed, as reading will return uncompressed chunks
in any case, resulting in a mismatch between the detected body size and
the actual size returned by repeatedly calling read_response_body_chunk.

Additionally, while "content-length" is considered a safe CORS header,
"content-encoding" is not, so using the "content-encoding" to decide if
"content-length" is meaningful is not an option either.

We simply must accept the fact that browsers are awful when it comes to
networking APIs.

(cherry picked from commit f4713d235a)
2023-09-20 18:40:36 +02:00
kleonc 053538c125 Fix byte to float color conversion in DisplayServerWindows::screen_get_pixel
(cherry picked from commit 9d45dd812f)
2023-08-31 20:19:31 +02:00
bruvzg e67b6e0d0f [macOS] Fix uncapped frame rate for windows in the non-active workspaces.
(cherry picked from commit 2ee45dc293)
2023-08-31 20:19:30 +02:00
bruvzg f346b8133e [Android] Set `echo` property for the physical keyboard events.
(cherry picked from commit c687bfa697)
2023-08-31 19:48:16 +02:00
Rémi Verschelde fc63a8d349 libpng: Enable intrinsics on x86/SSE2, ppc64/VSX, and all arm/NEON
(cherry picked from commit 2c9b7fc7a8)
2023-08-31 19:26:49 +02:00
Rémi Verschelde 30ab0e2cf4 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.

(cherry picked from commit a6e75f3971)
2023-07-11 12:21:28 +02:00
Rémi Verschelde 6ec2d6d7d0 Linux: Fix build with `use_sowrap=no` and various warnings/errors
(cherry picked from commit dcd16a5750)
2023-07-11 12:21:28 +02:00
Rémi Verschelde 29b4ee3d97 Change explicit 'Godot 4.0' references to 'Godot 4'
Fixes #79276.

(cherry picked from commit 8a06ec979e)
2023-07-10 18:09:58 +02:00
Kamil Brzoskowski 6becf94f49 Fix formatting of dlopen error message on Windows
And harmonize the format for all platforms.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
(cherry picked from commit 3cd865dbe8)
2023-07-10 18:09:57 +02:00
Septian add7c218d1 fix typo on TLSOptions.xml and library_godot_display.js
(cherry picked from commit b88b6b4f48)
2023-07-10 17:46:09 +02:00
Rémi Verschelde 4c1c26979b Linux: Link libsquish directly when unbundling, .pc file unreliable
(cherry picked from commit b3b4f4c1c9)
2023-07-10 17:46:08 +02:00
bruvzg fa45bb63c6 [Windows] Fix setting initial non-exclusive window mode.
(cherry picked from commit db0109b237)
2023-07-10 17:46:08 +02:00
Hugo Locurcio e32330473a Remove uses of `vformat()` with no placeholders
This is identical to passing the string directly.

(cherry picked from commit dcc92c174e)
2023-07-10 17:46:07 +02:00
bruvzg 221535c33c [Windows] Flash both the window caption and taskbar button on `request_attention`.
(cherry picked from commit 49af2582c4)
2023-07-10 17:26:14 +02:00
Rémi Verschelde da1e511f11 Linux: Allow unbundling brotli to use system library
(cherry picked from commit 153c4a4c4f)
2023-07-10 17:11:22 +02:00
Hugo Locurcio 0b19ec3498
Display a message about missing C# support on Android/iOS/Web platforms
When trying to export a C# project, this displays an error message after
creating a export preset for an unsupported platform.

Support for these platforms is planned for a future release.
2023-06-24 00:09:06 +02:00
Rémi Verschelde d586096415
Merge pull request #72720 from pkdawson/fix-mouse-capture
DisplayServerWindows: Fix mouse capture when button up message is missed
2023-06-22 18:29:34 +02:00
Rémi Verschelde 90446fe9f3
SCons: Move platform logo/run icon to `export` folder
Follow-up to #75932.
Since these icons are only used by the export plugin, it makes sense to
move them and generate the headers there.

The whole `detect.is_active()` logic seems to be a leftover from before
times, as far back as 1.0-stable it already wasn't used for anything.

So I'm removing it and moving the export icon generation to
`platform_methods`, where it makes more sense.
2023-06-20 13:16:37 +02:00
Rémi Verschelde ddaefb3cd6
Merge pull request #78455 from aaronfranke/macos-fix-tex-format-valid
macOS: Finish checking templates before validating texture formats
2023-06-20 13:14:23 +02:00
Rémi Verschelde 65628f23c5
Merge pull request #78175 from phil-hudson/fix-#78105
Android: Set pending intent flag to stop insta-crash
2023-06-20 13:14:07 +02:00
Phil Hudson ce7f648694 fix(android): set pending intent flag to stop insta-crash
fix(android): add conditional check for minimum sdk version

fix(android): formatting

fix(android): formatting

fix(android): formatting

fix(android): formatting again
2023-06-20 16:56:59 +08:00
Aaron Franke a981158d1a
macOS: Finish checking templates before validating texture formats 2023-06-19 21:36:31 -05:00
Rémi Verschelde 217a20a8a0
Merge pull request #78448 from akien-mga/black-23.3.0
CI: Update static checks to black 23.3.0
2023-06-20 00:05:39 +02:00