This allow the page to be considered a SecureContext if the address is
localhost (127.0.0.1/::1) and let Firefox (and future Chrome versions)
enable extra features needed for the HTML5 threaded export.
When pasting clipboard content from Godot to other applications,
multiple SelectionRequest events are sent to Godot in order to access
the data. It could take a long time before the data is ready for the
other app because events were processed one by one on the main thread,
especially when Godot is unfocused and runs at low frequency.
With this change, SelectionRequest events are directly handled on the
separate event polling thread to minimize this delay.
This change also replaces clipboard_get() calls in SelectionRequest with
a direct access to internal_clipboard, since in this case we know Godot
is the owner of the clipboard content and it's not necessary to query
the x server for it.
This change makes keyboard inputs more responsive on Linux, especially
when the FPS is lower on slower configurations.
Polling events from the x server is done on a separate thread to avoid a
frame delay with inputs, due to first sending the event to the input
manager with XFilterEvent then processing the new event only on the next
frame.
Calls to Input Manager functions like XSetICFocus, XUnsetICFocus and
XSetICValues use a mutex, because they are polling events internally and
would otherwise interfere with our own thread process for polling events
which can cause a deadlock in some cases.
XUnsetICFocus is called instead of XSetICFocus on FocusOut events,
so the input manager can be properly notified of focus changes.
clipboard_get now uses a blocking call to poll for a specific event type
when waiting for a SelectionNotify event, instead of polling all events
and filtering them afterwards.
Fixes: #28683, #28621, #28596 and maybe others
For iOS we enable pvrtc feature by default for all backends
Etc1 for iOS doesn't have any sense, so it disabled.
Fixed checks in export editor.
Fixed pvrtc encoding procedure.
Edit by Akien: Forward-ported from #38076, this may not make sense as is for
Godot 4.0, but it's important that we have the latest code in sync with 3.2
for when more rendering backends and proper iOS support are added back.
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
The engine now expects to emscripten FS to be setup and sync-ed before
main is called. This is exposed via `Module["initFS"]` which also allows
to setup multiple persistence paths (internal use only for now).
Additionally, FS syncing is done **once** for every loop if at least one
file in a persistent path was open for writing and closed, and if the FS
is not syncing already.
This should potentially fix issues reported by users where "autosave"
would not work on the web (never calling `syncfs` because of too many
writes).
Add __NetBSD__ to `platform_config.h` so that it can find `alloca`
and use the proper `pthread_setname_np` format.
Rename RANDOM_MAX to avoid conflict with NetBSD stdlib.
Fixes#42145.
Proper implementation for get_window_at_screen_position:
Now getting the topmost last active window when overlapping.
Mouse drag & release events:
They are now propagated through the current focused window, in order to
make it consistent with the engine expectations and the Windows display
server implementation.
On Windows, WINDOW_EVENT_FOCUS_IN was never sent by the display server
for popups, because WM_ACTIVATE events are received during the call to
_update_window_style, which happened before the callbacks were set.
This was causing some issues with the way Popup is now handling closing on
parent focus.
Now _update_window_style is only called during show_window, after Window
initialized callbacks.
Now using override_redirect for menu & tooltip popups to prevent the WM from
interfering with them, so we have more control over focus management
and avoid a delay before they show up.
By default 'add_ios_framework' would not embed a framework to save previous behavior.
New 'add_ios_embedded_framework' would embed framework on export.
Extracted the most minimal core initialization functionality from
`setup()` and `setup2()` so that `ClassDB` could be tested properly
(input, audio, rendering, physics etc, are excluded).
Display and rendering servers/singletons are not initialized at all.
Due to the fact that most subsystems are disabled, fixed various crashes in the
process (in order):
- `AcceptDialog` OK/cancel swap behavior (used `DisplayServer` while
`register_scene_types()`);
- `make_default_theme` which depends on `RenderingServer`;
- `XRServer` singleton access while calling `register_modules_types()`;
- hidden bug in a way joypads are cleaned up (MacOS and Linux only).
Removed manual `ClassDB` init/cleanup calls from `test_validate_testing.h`.
ClassDB tests:
Co-authored-by: Ignacio Etcheverry <ignalfonsore@gmail.com>
This code currently isn't compiled (and cannot compile).
We plan to re-add OpenGL ES-based renderer(s) in Godot 4.0 alongside Vulkan
(probably ES 3.0, possibly also a low-end ES 2.0), but the code will be quite
different so it's not relevant to keep this old Godot 3.2 code.
The `drivers/gles2` code from the `3.2` branch can be used as a reference for
a potential new implementation.
Previously `joypad_count` was used as the index into the d_joypads array when initializing a new gamepad.
This caused the accidental override of an already connected device when a gamepad with a lower id was disconnected and connected again.
fixes#17566
This was caused by `XSetWMNormalHints` being called multiple times, each time with different values. Calling the method replaces the old data completely, resulting in some of the settings being lost.
Since the method was called 3 times before the window was mapped, this resulted in the position hint being lost and the window always getting opened at a position determined by the WM.
It's too hard to get compatibility between GNU and BSD sed,
so let's just use perl oneliners.
And improve it to also remove trailing tabs, not just spaces.
Depending on the device implementation, editor actions could be
received with different action ids or not at all for multi-line.
Added a parameter to virtual keyboards to properly handle single-line
and multi-line cases in all situations.
Single-line:
Input type set to text without multiline to make sure actions are sent.
IME options are set to DONE action to force action id consistency.
Multi-line:
Input type set to text and multiline to make sure enter triggers new lines.
Actions are disabled by the multiline flag, so '\n' characters are
handled in text changed callbacks.
Until https://github.com/psf/black/pull/1328 makes it in a stable release,
we have to use the latest from Git.
Apply new style fixes done by latest black.
This gesture recognizer will prevent GodotView from processing unwanted gestures.
Emulates UIScrollView behavior.
Fires delayed touches on significant movement.
Add VMA to iphone platform Use linkflag for iphone building to enforce static linking. Works fine with dynamic '.framework' library
Updated xcode project to use '.a' static library
Implemented Vulkan Support.
Use DisplayServer for rendering and input handling
Use single view for rendering in both GLES2 (not supported yet) and Vulkan
Use @available checks where it's required (otherwise compiler would fail compilation)
Simulator checks
Disabling virtual keyboard focus adjustement caused get_keyboard_height
to always return 0 because it was calculated when the view is resized.
In order to fix it, a PopupWindow is now created on top of the main view
and is set for focus adjustments so the keyboard size can be calculated
based on this popup without affecting the main view.
Implements exit codes into the engine so tests can return their statuses.
Ideally we don't do this, and we use FIXUP logic to 'begin' and 'end' the engine execution for tests specifically.
Since realistically we're initialising the engine here we don't want to do that, since String should not require an engine startup to test a single header.
This lowers the complexity of running the unit tests and even for
physics should be possible to implement such a fix.
Its last use was removed in Godot 3.0, so it no longer makes sense to define.
Also removed `D3D_DEBUG_INFO` for Windows as it's likely a left over from a
long time ago pre-opensourcing when Godot had some form of Direct3D 9 support?
When creating a window, Godot would first register it to the WM(show it) and then set its flags.
This works fine on a floating WM, but on tiling WMs as soon as a window gets registered
the WM immediately acts on the window by scaling it up and treating it as a generic window,
being registered without any special flags.
This commit separates the showing of the window into another function and calls it after the most important flags are set,
making windows with special flags(eg. all popups) work again on tiling WMs.
Fixes#37930
Fixes this compilation error:
In file included from thirdparty/vulkan/vk_mem_alloc.cpp:7:
thirdparty/vulkan/vk_mem_alloc.h:3691:18: error: 'shared_mutex' is unavailable: introduced in macOS 10.12
std::shared_mutex m_Mutex;
^
/home/[user]/sources/osxcross/target/bin/../SDK/MacOSX10.14.sdk/usr/include/c++/v1/shared_mutex:178:58: note: 'shared_mutex' has been explicitly marked unavailable here
class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_SHARED_MUTEX shared_mutex
The Online Tutorials section of InputMap in the editor's built-in
documentation viewer contains this link:
docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html#inputmap
The macOS implementation for opening a link percent-encodes it before
sending it to the browser, resulting in a 404. This is to fix#13422
where filenames with special characters could not be opened in Finder.
However, this breaks URLS so I added a check to see if the resource
scheme is file:// and if so, only then is it escaped. This allows other
schemes like `http`, `ftp`, and `mailto` to be used.
- Makes all boolean setters/getters consistent.
- Fixes bug where `glow_hdr_bleed_scale` was not used.
- Split CameraEffects to their own source file.
- Reorder all Environment method and properties declarations,
definitions and bindings to be consistent with each other
and with the order of property bindings.
- Bind missing enum values added with SDFGI.
- Remove unused SDFGI enhance_ssr boolean.
- Sync doc changes after SDFGI merge and other misc changes.
Detecting the case where WM_SIZE is received during the window creation.
There's no need to call window_resize on the Vulkan context.
Also creating a WindowData entry early enough to avoid storing a
separate WindowData wrongly associated to INVALID_WINDOW_ID.
Fixes#39199
The Haiku port now resides at:
https://github.com/godotengine/godot-haiku-platform
While we're happy to support as many Free and Open Source platforms as we can,
we need to put the main focus on the platforms that we can reasonably maintain,
and for Haiku we have been lacking maintainers ever since the port was first
merged in 2015.
The Haiku code has not been compiling and much less working at least since the
release of Godot 3.0, and while some attempts have been made at fixing things,
it's still not functional today in the `3.2` branch (and much less in `master`,
understandably).
Having it in an external repository should hopefully enable Haiku contributors
to fix issues in their own time, and possibly tag versions compatible with
past Godot releases once they are ready.
"Bundle Identifier" is more well-understood among macOS and iOS
developers and is less ambiguous.
This is a slight breaking change as export presets will need to be
updated to account for this change.
See https://github.com/godotengine/godot-docs/pull/3295.