Before, the cursor kept updating for no good reason really.
It's also a bit neater and it ever-so-slightly makes `WAYLAND_DEBUG`
logs easier to read, although they're still spammed by the window's
frame logic (which is needed).
- `Main::setup` early exits (failure or `--help`/`--version`) now
consistently return `EXIT_FAILURE` or `EXIT_SUCCESS` on all platforms,
instead of 255 on some and a Godot Error code on others.
- `Main::start` now returns the exit code, simplifying the handling of early
failures.
- `Main::iteration` needs to explicit set the exit code in OS if it errors
out.
- Web and iOS now properly return `OS::get_exit_code()` instead of 0.
fixes godotengine#82061
fixes godotengine#61556
Also, distinguish between main pack and DLC packs.
It's desirable to downloaded content to be as small as possible. This change avoids bloating non-main pack files with new versions of resources that are all read on startup and never used again. They have no effect if loaded after startup.
- project.godot/project.binary file
- extension_list.cfg
- app icon and boot_splash
- .ico and .icns files (these can still be opted in for DLC by listing them explicitly in the include filter)
Follow-up to https://github.com/godotengine/godot/pull/88297 to address the following issues:
- Ensure that the custom gradle android source template is valid. Show a warning if it's not
- Don't show an error when the official export templates are not installed but a custom android source template is specified
This code was already partially there, although heavily incomplete and
nowadays commented out.
It got broken after the `WaylandThread` refactor and I didn't bother to
bring it over, preferring to `#if 0` it into oblivion for the time
being as I don't have a tablet/pen which support an eraser and tilt
reporting.
This commit brings it back and adds proper multi-tool support (needed
for eraser detection) thanks to winston-yallow, who could test this code
with their more capable tablet.
This should fix a lot of issues regarding to old controller API, such as vibration
Haptics (vibrations) are only available in macOS 11+, so haptics are now
processed in macOS 11+ only. Also, this doesn't interfere with
controller's input as controller support is available in macOS 10.9+.
Added a Note for macOS regarding vibration support
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.
Instead of hardcoding platform names that support C#, let platforms
set a flag indicating if they support it. All public platforms
except web already support it, and it's a pain to maintain a patch
for this list just to add additional names of proprietary console
platforms.
This makes adding new platforms or variants or existing platforms
much easier, as the platform can signal what it supports/doesn't
support directly, and we can avoid harcoding platform names.
Fix the fetching of images from windows clipboard, if they're in CF_DIB format (e. g. by taking screenshots).
Image::create_from_data was used with an instance of Image, but it's a static function, returning a new instance.
Using 2.2.7.dev115+g0eb441d6.
Had to add `cancelled` to the ignore list, as it's a Wayland signal which
we're handling in our code, so we don't want codespell to fix that "typo".
Also includes the typo fix from #87927.
Co-authored-by: Divyanshu Shekhar <61140213+divshekhar@users.noreply.github.com>
This prevents a wayland-scanner message from appearing every build
when `wayland=yes` is used (the default). The error message when
wayland-scanner is still printed as it's not printed by
wayland-scanner itself.
This is a workaround for the most critical portion of the WM focus bug
described in #68305. On some specific X11 WM configurations, the
editor's main window and any popups it creates will fight for focus,
which causes a total system lockup due to mouse and keyboard input being
stolen as well. Getting out of this infinite loop requires force
restarting the system.
It can be tested with the following shell script:
```bash
!#/bin/sh
godot4 &
sleep 30
pkill -x godot4
```
The workaround identified in #68305 is to remove the call to
XSetInputFocus in the ConfigureNotify event handler, so I have removed
the conditional block that calls this as well as the setup code above it
since there is no need to allocate the memory for the variables if they
won't be used in that call anymore.
This is just a hack and is not a complete fix for #68305. Multiple
developers are collaborating on a proper fix in the discussion in that
issue, but time is a valuable resource that no one has enough of, so I
am committing this workaround as a stop-gap to prevent the most critical
problem while we work on a full solution for the underlying cause.
Custom Visual Studio project generation logic that supports any platform that has a msvs.py
script, so Visual Studio can be used to run scons for any platform, with the right defines per target.
Invoked with `scons vsproj=yes`
To generate build configuration files for all platforms+targets+arch combinations, users should call
```
scons vsproj=yes platform=XXX target=YYY [other build flags]
```
for each combination of platform+target[+arch]. This will generate the relevant vs project files but
skip the build process, so that project files can be quickly generated without waiting for a command line
build. This lets project files be quickly generated even if there are build errors.
All possible combinations of platform+target are created in the solution file by default, but they
won't do anything until each one is set up with a scons vsproj=yes command for the respective platform
in the appropriate command line. This lets users only generate the combinations they need, and VS
won't have to parse settings for other combos.
Only platforms that opt in to vs proj generation by having a msvs.py file in the platform folder are included.
Platforms with a msvs.py file will be added to the solution, but only the current active platform+target+arch
will have a build configuration generated, because we only know what the right defines/includes/flags/etc are
on the active build target currently being processed by scons.
Platforms that don't support an editor target will have a dummy editor target that won't do anything on build,
but will have the files and configuration for the windows editor target.
To generate AND build from the command line, run
```
scons vsproj=yes vsproj_gen_only=no
```
Fixes non-constant-expression cannot be narrowed from type 'DWORD' (aka 'unsigned long') to 'int' in initializer list [-Wc++11-narrowing]
Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
This allows previous X11-only setups to still build Godot with default
settings. Note that compilation will still abort if wayland-scanner is
present but not the various Wayland libraries.
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.
This adds a new enum `KeyLocation` and associated property
`InputEventKey.location`, which indicates the left/right location of key
events which may come from one of two physical keys, eg. Shift, Ctrl.
It also adds simulation of missing Shift KEYUP events for Windows.
When multiple Shifts are held down at the same time, Windows natively
only sends a KEYUP for the last one to be released.
This makes it much faster to get started with Direct3D 12 builds,
as you only need to run `python .\misc\scripts\install_d3d12_sdk_windows.py`
then run `scons d3d12=yes`.
This installs DirectX Shader Compiler, Mesa NIR, WinPixEventRuntime
and DirectX 12 Agility SDK.
- Define a default path that uses the locations from the script.
- Now the default path is in "%LOCALAPPDATA%\Godot\build_deps\"
- Updated CI to use this new python script.
Co-Authored-By: Hugo Locurcio <hugo.locurcio@hugo.pro>
- Update Android gradle plugin version from 7.2.1 to 8.2.0
- Update gradle version from 7.4.2 to 8.2
- Update target SDK from 33 to 34
- Update build tools version from 33.0.2 to 34.0.0
- Update kotlin version from 1.7.0 to 1.9.20
- Update Android fragment version from 1.3.6 to 1.6.2
- Update AndroidX window version from 1.0.0 to 1.2.0