Commit Graph

664 Commits

Author SHA1 Message Date
Thaddeus Crews 8116d70d4b
SCons: Convert remaining `run_in_subprocess` to `env.Run` 2024-03-10 14:01:23 -05:00
Rémi Verschelde 2cb884bdbd
Merge pull request #89328 from Riteo/wayland-cursor-frame-opt
Wayland: Setup next cursor frame callback only if animated
2024-03-09 22:20:12 +01:00
Rémi Verschelde 3ca230df25
Merge pull request #89307 from alesliehughes/wayland_usage
Wayland: Stop possible Null pointer dereferences
2024-03-09 22:19:48 +01:00
Riteo 120936f78c Wayland: Setup next cursor frame callback only if animated
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).
2024-03-09 20:32:54 +01:00
Alistair Leslie-Hughes 82a052a008 wayland: Stop possible Null pointer dereferences 2024-03-09 21:50:55 +11:00
Alistair Leslie-Hughes d3ebae5e33 wayland: Stop unreachable warning 2024-03-09 21:50:39 +11:00
Rémi Verschelde 13954fc33e
Merge pull request #87452 from bruvzg/native_menu
Move `global_menu_*` methods to a separate `NativeMenu` class.
2024-03-06 13:16:52 +01:00
Rémi Verschelde 2ecf0eba95
Merge pull request #88520 from LinuxUserGD/execinfo
Disable the crash handler if `execinfo=no` scons option is set
2024-03-05 16:54:37 +01:00
Rémi Verschelde f9ebd84b5a
Merge pull request #89178 from Riteo/gotta-have-them-all
Wayland: Properly report all used features
2024-03-05 14:55:36 +01:00
bruvzg c65a667924
Move `global_menu_*` methods to a separate `NativeMenu` class. 2024-03-04 23:41:41 +02:00
Riteo ea4be5d3df Wayland: Properly report all used features
Oops, missed a few.
2024-03-04 21:08:37 +01:00
A Thousand Ships 9273106bb3
[Wayland] Fix tilt handling 2024-03-03 20:45:07 +01:00
Rémi Verschelde 6d9a529c87
Merge pull request #88970 from KoBeWi/ImageCursor2D
Improve `cursor_set_custom_image()` method
2024-02-29 13:54:53 +01:00
Rémi Verschelde 7434f8b4e3
Merge pull request #88959 from akien-mga/pre-commit-clang-17.0.6-black-24.2.0
Pre-commit: Update to clang-format 17.0.6 and black 24.2.0
2024-02-29 13:54:38 +01:00
kobewi 3aeb4a5542 Improve cursor_set_custom_image() method 2024-02-28 20:32:25 +01:00
Rémi Verschelde 3a08c646ee
Pre-commit: Update to clang-format 17.0.6 and black 24.2.0 2024-02-28 14:25:35 +01:00
Riteo b01a36b3cd Wayland: Restore tablet support and handle multiple tools
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.
2024-02-28 13:08:31 +01:00
LinuxUserGD 6307cebf37
os_linuxbsd.cpp: include `servers/rendering_server.h` 2024-02-19 01:14:30 +01:00
Rémi Verschelde 033821c595
Merge pull request #88245 from shana/simplify-mono-support-detection
C#: Let platforms signal if they support the mono module or not
2024-02-19 00:08:07 +01:00
LinuxUserGD f1a677fb4c
Disable the crash handler if execinfo=no scons option is set 2024-02-18 21:42:05 +01:00
Rémi Verschelde 59643bdb86
Merge pull request #88325 from akien-mga/texture-formats
Export: Unify settings for PC texture formats, removed obsoleted ETC feature
2024-02-17 00:23:45 +01:00
Riteo 2e07dcf1e7 Wayland: suspend window after frame timeout or suspend state
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.
2024-02-15 23:48:56 +01:00
Rémi Verschelde ef5d6ccfb7
Merge pull request #86966 from Muller-Castro/value2ref-core
Add const lvalue ref to `core/*` container parameters
2024-02-15 15:44:43 +01:00
Rémi Verschelde a10b4bdb81
Export: Unify settings for PC texture formats
S3TC and BPTC should always be used together, and likewise for ETC2 and ASTC.
2024-02-14 17:16:43 +01:00
Rémi Verschelde e457f41f9b
Remove code relative to obsoleted ETC texture format
Co-authored-by: BlueCube3310 <53150244+BlueCube3310@users.noreply.github.com>
2024-02-14 17:16:41 +01:00
Thaddeus Crews 633dcf6dfd
SCons: "Environment" to "SConsEnvironment" 2024-02-14 09:26:47 -06:00
Muller-Castro a8bc9f3e78 Add const lvalue ref to core/* container parameters 2024-02-14 11:20:36 -03:00
Andreia Gaita 21e524a798 C#: Let platforms signal if they support it or not
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.
2024-02-13 22:48:43 +01:00
bruvzg ee53ae28df
Add method to get "base" system UI color (macOS/Windows) and system theme change callback. 2024-02-13 18:38:53 +02:00
Dario 73eff10c76 Finish splitting functionality of the Vulkan and D3D12 backends into RenderingDeviceDriver. 2024-02-12 10:02:18 -03:00
Rémi Verschelde 4e990cd7e5
Merge pull request #88134 from akien-mga/scons-wayland-py3.12-escape
SCons: Use r-strings for wayland-scanner builder command
2024-02-09 18:10:19 +01:00
Rémi Verschelde 74b03edf1e
Merge pull request #82800 from Sauermann/fix-screen-mousemotion
Add screen-related attributes to mouse input events
2024-02-09 18:08:58 +01:00
Rémi Verschelde 03c8a0d089
SCons: Use r-strings for wayland-scanner builder command
Silences a Python 3.12 warning.
2024-02-09 15:52:20 +01:00
Rémi Verschelde 11964fb569
Merge pull request #87464 from bruvzg/pck_section
[Linux] Add support for PCK embedding section with non GNU-ld linkers.
2024-02-08 10:53:36 +01:00
Rémi Verschelde 7223c5b54a
Fix various typos with codespell
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>
2024-02-07 11:09:34 +01:00
Rémi Verschelde c9c2b12637
Merge pull request #88028 from Calinou/wayland-silence-scanner-check
Silence wayland-scanner check in buildsystem
2024-02-07 11:06:00 +01:00
Rémi Verschelde 3b6f2e0525
Merge pull request #87977 from Chubercik/wayland-1.22.0
wayland: Update to 1.22.0
2024-02-07 11:02:05 +01:00
Rémi Verschelde 4f478a55cc
Merge pull request #86843 from RandomShaper/fix_null_ptr
Avoid several null-dereferences of ApiContextRD
2024-02-07 10:58:01 +01:00
Pedro J. Estébanez d5a5dd52e8 Avoid several null-dereferences of ApiContextRD 2024-02-06 19:55:01 +01:00
Hugo Locurcio 7b0f2a5f53
Silence wayland-scanner check in buildsystem
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.
2024-02-06 19:49:34 +01:00
Jakub Marcowski 292df42c3f wayland: Update to 1.22.0 2024-02-06 10:23:42 +01:00
Markus Sauermann 2235a1cbd0 Add screen-related attributes to mouse input events 2024-02-05 23:30:15 +01:00
Rémi Verschelde 9adb7c7d13
Merge pull request #87764 from Riteo/wayland-native-handle
Wayland: Implement `window_get_native_handle`
2024-01-31 14:01:59 +01:00
Rémi Verschelde f23fda39d3
Merge pull request #87776 from bruvzg/wl_nfd
[Wayland] Add support for native file dialogs.
2024-01-31 14:00:30 +01:00
bruvzg edb21e0573
[Wayland] Add support for native file dialogs. 2024-01-31 14:13:19 +02:00
Riteo d8658df94e Wayland: implement `window_get_native_handle`
This will be the most useful for stuff like OpenXR, although we'd need a
way to eventually also expose the EGL handles.
2024-01-31 11:57:05 +01:00
Riteo c3d6cc57be Wayland: disable backend at build-time if wayland-scanner is missing
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.
2024-01-31 02:08:33 +01:00
Riteo 7e0f7d3abd Add Wayland support
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.
2024-01-30 16:44:47 +01:00
Rémi Verschelde f220d46cdc
Merge pull request #80231 from romlok/input-key-location
Support detecting and mapping ctrl/alt/shift/meta by their left/right physical location
2024-01-29 13:15:42 +01:00
Mel Collins 8406e60522 Add InputEventKey.location to tell left from right
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.
2024-01-26 14:42:28 +01:00