Commit graph

617 commits

Author SHA1 Message Date
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
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
bruvzg
a8f521bcad
[Native File Dialog] Add support for adding custom options to the dialogs.
Add support for adding custom options (checkboxes and optionboxes) to the dialogs (both native and built-in).
2024-01-24 15:00:31 +02:00
David Snopek
64a52e08fe [X11] Don't re-set input focus if the given window already has it 2024-01-18 08:52:03 -06:00
Rémi Verschelde
4aff0ab5d5
Merge pull request #86441 from dsnopek/mequam-x11-focus-grab
[X11] Fix Godot stealing focus on alternative window managers
2024-01-18 09:34:18 +01:00
Yuri Sizov
95b27fe8c7 Reorganize code related to editor theming
This change introduces a new EditorThemeManager class
to abstract theme generatio and its subroutines.

Logic related to EditorTheme, EditorColorMap, and editor
icons has been extracted into their respective files with
includes cleaned up.

All related files have been moved to a separate folder to
better scope them in the project. This includes relevant
generated files as well.
2024-01-16 11:57:45 +01:00
Rémi Verschelde
03767fbf3b
Merge pull request #86446 from reduz/transient-to-focused
Implement a `transient_to_focused` Window mode
2024-01-15 13:25:00 +01:00
Juan Linietsky
15144c24bd Implement a transient_to_focused mode
This intends to be the correct way to handle non-child windows becoming covered by the current window when becoming focused.
Enabling this property on select windows, they will become transient to the currently focused one when becoming visible.

This deprecates the "unparent_when_invisible" function introduced by #76025.
2024-01-14 18:51:44 +01:00
kobewi
0e8f90f4c8 Update deferred calls to use Callables 2024-01-09 16:11:47 +01:00
mequam
40d69c25d5 [X11] Fix Godot stealing focus on alternative Window Managers 2024-01-09 08:58:59 -06:00
Rémi Verschelde
6c390b620d
Merge pull request #84445 from Rubonnek/add-const-references-clang-tidy
Add const references detected by clang-tidy
2024-01-04 14:25:33 +01:00
Rémi Verschelde
d36903860c
Merge pull request #86160 from gregdebonis/gregdebonis/issue86156
Fix key mapping for `XK_KP_Delete` key
2024-01-03 15:44:32 +01:00
jsjtxietian
078bfae6a4 Add RD_ENABLED when VULKAN_ENABLED or D3D12_ENABLED is added 2023-12-25 11:13:01 +08:00
Yuri Sizov
3a8524dd92
Merge pull request #83452 from RandomShaper/rd_common
Split `RenderingDevice` into API-agnostic and `RenderingDeviceDriver` parts
2023-12-20 20:09:18 +01:00
Pedro J. Estébanez
12a519bae2 Split RenderingDevice into API-agnostic and RenderingDeviceDriver parts
Credit and thanks to @bruzvg for multiple build fixes, update of 3rd-party items and MinGW support.

Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
2023-12-20 19:18:08 +01:00
Yuri Sizov
aee8a3bada Merge pull request #75489 from bruvzg/init_pos_usable
[DisplayServer] Use screen "usable rect" instead of full rect to calculate initial window rect.
2023-12-19 20:32:10 +01:00
Wilson E. Alvarez
a3cb1b096f
Add const references detected by clang-tidy 2023-12-16 13:36:44 -05:00
Gregory De Bonis
95bcf93849 Wrong key mapping for XK_KP_Delete key
Fixes #86156
2023-12-14 10:39:15 -03:00
Yuri Sizov
773b4d7764 Ensure more export errors are reported to users
Also fixes the timing issue when exporting all
presets at the same time, where the error report
would try to appear while the progress dialog
was still visible.
2023-12-06 15:26:07 +01:00
bruvzg
b02cf351f3
[DisplayServer] Use screen "usable rect" instead of full rect to calculate initial window rect. 2023-12-04 07:56:33 +02:00
HolonProduction
bf45d3ae24 X11: Send IME update notification deferred 2023-11-24 13:18:50 +01:00
Rémi Verschelde
15b8185c68
Don't use TTR/RTR for ERR/WARN prints
We don't translate those, only editor strings are translated.
2023-11-12 12:00:55 +01:00
bruvzg
f3d4f5a77e
[X11] Add fallback from desktop GL to GLES, suppress PRIME detector error spam. 2023-11-06 12:40:44 +02:00
Rémi Verschelde
63153c9d36
Linux: Remove hardcoded lib path for x86 cross-compilation
This breaks the build with our updated i686 Linux SDK which doesn't contain
this path, and may not be needed at all.

This might need further work to be robust, and there's an open PR already
adding -march flags for all supported architectures, but for now we're
playing it safe for 4.2.
2023-11-01 14:14:01 +01:00
thfrwn
a0253e593c TTS_Linux: Fix size_t template issue on OpenBSD by using int consistently 2023-10-27 12:23:39 -04:00
Setadokalo
1d9ec3caa3 Fix freeze when requesting clipboard image from our own window 2023-10-25 18:32:40 -05:00
Brayden Harlon
085255bd0e Improved X11 screen_get_refresh_rate performance 2023-10-24 11:25:51 -07:00
Rémi Verschelde
2f33c2b20e
Merge pull request #81439 from Setadokalo/clipboard_image
Implement `clipboard_get`/`has_image` for X11
2023-10-20 15:06:42 +02:00
Setadokalo
3b5a9e31bb Implement clipboard_get/has_image for X11 2023-10-20 02:59:10 -05:00
bruvzg
b52826bf55
Add error messages to the native menu and file dialogs callback. 2023-10-14 18:10:39 +03:00
Kacper Gibas
8eb32f9aad Fix unused variables warning when touch is disabled 2023-10-13 16:04:08 +02:00
A Thousand Ships
f18aa00e85 Replace ERR_FAIL_COND with ERR_FAIL_NULL where applicable 2023-10-08 17:23:33 +02:00
kobewi
09b30be86d Add vararg call() method to C++ Callable 2023-10-05 11:35:29 +02:00
Rémi Verschelde
d8ab953442
Merge pull request #82163 from naelstrof/master
Made signal handling more uniform during crashes.
2023-10-05 10:08:09 +02:00
Rémi Verschelde
03ff9fedb6
Merge pull request #82101 from bruvzg/x11_gles
[X11] Add support for using EGL/GLES instead of GLX.
2023-10-04 15:35:05 +02:00
bruvzg
af00c4a54a
[X11] Add support for using EGL/GLES instead of GLX. 2023-10-04 14:15:36 +03:00
bruvzg
43e4708dff
[Native File Dialogs] Improve filter list handling, add selected filter to the callback. 2023-10-03 19:26:16 +03:00
Rémi Verschelde
31dbbc2c5a
Merge pull request #80952 from bruvzg/nfdlg_refocus
[Native File Dialogs] Refocus last focused window on close.
2023-10-03 17:13:58 +02:00
Rémi Verschelde
48bee5c8ef
Merge pull request #82221 from Riteo/linux-ogl-no-vsync-override
Linux/OpenGL: Don't force vsync in the editor
2023-09-26 13:45:12 +02:00
Mario Liebisch
426e18fd37
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`).
2023-09-25 21:17:20 +02:00
Rémi Verschelde
b362976504
SCons: Fix Python 3.12 SyntaxError with regex escape sequences 2023-09-25 10:39:30 +02:00
Riteo
4fd6777cf4 Linux/OpenGL: don't force vsync in the editor
I couldn't tell whether this has an actual purpose and it feels more
like a debug remnant.

We also need to be able to disable vsync in the editor for the WIP
Wayland backend (in the EGL driver) as it does manual frame throttling.
2023-09-24 04:36:58 +02:00
naelstrof
b49e9c9896 Made signal handling more uniform. Fixes #82102 2023-09-22 20:06:58 -06:00
bruvzg
1887a9df19
[macOS/Windows] Add optional ANGLE backed OpenGL renderer support. Add EGL_ANDROID_blob_cache caching.
Co-authored-by: Riteo <riteo@posteo.net>
2023-09-21 14:21:00 +03:00
A Thousand Ships
3565d1bf7e [Drivers,Platform] Replace ERR_FAIL_COND with ERR_FAIL_NULL where applicable 2023-09-12 20:13:32 +02:00
kobewi
6de34fde27 Add EditorStringNames singleton 2023-09-03 19:58:18 +02:00
bruvzg
2e1f48ff6e
[Native File Dialogs] Refocus last focused window on close. 2023-08-24 09:34:58 +03:00
Rémi Verschelde
c72b851dfb
Merge pull request #80104 from bruvzg/freedesktop_native_file_dialog
[Linux/Freedesktop] Implement native file selection dialog support.
2023-08-17 11:23:00 +02:00