Commit Graph

1064 Commits (cb1569345a6f17da08241e645ab03cb2e1b78d2f)

Author SHA1 Message Date
Micky 5d794f83ed Tweak a few miscellaneous localization strings 2025-03-20 13:12:44 +07:00
Pāvels Nadtočajevs f6891b0305
[DisplayServer] Decouple `show_window(MAIN_WINDOW_ID)` from `DisplayServer` constructor, update project manager size/position after DS init. 2025-03-19 11:23:04 +07:00
Thaddeus Crews 49fcd4ce46
Merge pull request #101546 from bruvzg/portal_color_picker
[Linux] Implement native color picker.
2025-03-17 10:52:29 +07:00
Pāvels Nadtočajevs 18f6c33d72
[DisplayServer] Implement `get_accent_color` on Linux. 2025-03-14 09:05:03 +07:00
Rémi Verschelde 28451c001a
Merge pull request #103815 from bruvzg/x11_fd_cond
[X11] Fix native dialog parent selection condition.
2025-03-14 00:08:45 +07:00
Aaron Franke 97ee05e9b7
Rename version defines to GODOT_VERSION_* to match GDExtension godot-cpp 2025-03-12 11:11:38 +07:00
Thaddeus Crews 991d01fb52
Merge pull request #103891 from shahriarlabib000/update_readme
Update logo/run icon path in platform READMEs
2025-03-10 21:05:55 +07:00
A Thousand Ships 331a43a9d8
Add `String::remove_char(s)` methods for performance and convenience 2025-03-10 13:19:28 +07:00
风青山 456261cd7e
Fix cannot input Chinese after restarting the input method on X11
Register a callback via `XRegisterIMInstantiateCallback()` to detect
whether the input method is available again.
2025-03-10 17:18:02 +07:00
shahriarlabib000 25a8b808d3 update logo/run icon path in README 2025-03-10 12:03:41 +07:00
风青山 7fd154c4b4
Set `unsupported` to true on error in `FreeDesktopScreenSaver`
This avoids possible memory leaks when the editor exits.
2025-03-09 11:10:27 +07:00
A Thousand Ships 466590d0ec
Use `get_slicec` instead of `get_slice` for single character splitters 2025-03-08 20:36:37 +07:00
Pāvels Nadtočajevs fe38504aa0 [X11] Fix native dialog parent selection condition. 2025-03-08 16:28:25 +07:00
Thaddeus Crews 324512e11c
Style: Replace header guards with `#pragma once` 2025-03-07 17:33:47 +07:00
Thaddeus Crews 3d9b37911d
Merge pull request #103011 from Repiteo/style/svgo-newline
Style: Ensure svgs have trailing newlines
2025-03-07 15:12:41 +07:00
Thaddeus Crews c937b6d180
Merge pull request #102419 from Ivorforce/std-size
Use `std::size` instead of `sizeof(a) / sizeof(a[0])` pattern throughout the codebase.
2025-03-07 15:12:25 +07:00
Thaddeus Crews d9125ebebe
Merge pull request #101293 from Ivorforce/string-to-pointer-conversion
Remove implicit conversions from `String`, `Char16String` and `CharString` to data pointers.
2025-03-07 15:12:12 +07:00
Thaddeus Crews dadfcd1ff2
Merge pull request #95776 from Calinou/crash-handler-linuxbsd-simplify-file-path
Simplify the printed file paths in the Linux/*BSD crash handler
2025-03-07 15:12:10 +07:00
bruvzg 3e4e6e6c0c Improve native file dialog parent window selection. 2025-03-06 17:15:39 +07:00
Thaddeus Crews 1f2d135444
Merge pull request #103526 from jamie-pate/fix_103522
Fix check for is_maximized in x11 to require both horizontal and vert
2025-03-05 12:07:41 +07:00
Pāvels Nadtočajevs 6ed12bfc5d [Linux/BSD] Offload RenderingDevice creation test to subprocess. 2025-03-04 13:18:26 +07:00
Jamie Pate 4f14f722b8 Fix check for is_maximized in x11 to require both horizontal and vertical
Fixes #103522

Persistent window state doesn't work if your window is 'tiled' in X11
gnome

3.x checks for `horz && vert`
4396e98834/platform/x11/os_x11.cpp (L1708)

4.x also checked `horz && vert` until this change where it was switched
to `horz || vert`
524f061c01 (diff-05f85bc3bf96d384f6b96260c758e63e10bbdd52b04f8ccb34649372e7bc1f48R1382)

The corrected logic is:
Check `horz && vert` for 'is_maximized'
Check `horz || vert` for 'can_maximize'
2025-03-03 15:45:21 +07:00
Hilderin 0c384e7217 Replace error to info messages for embedded game 2025-02-26 19:32:25 +07:00
Pāvels Nadtočajevs ab717497ef [Windows] Offload `RenderingDevice` creation test to subprocess. 2025-02-24 19:40:10 +07:00
Thaddeus Crews 7e5baa0426
Style: Enforce trailing newlines on svgs 2025-02-18 11:02:45 +07:00
Pāvels Nadtočajevs f710781b16 Prevent pending input event callbacks from erasing the window in the middle of a loop. 2025-02-18 15:26:13 +07:00
Rémi Verschelde a8a1009468 Merge pull request #102641 from Riteo/modifying-spacetime-itself
Wayland: Unstuck keys with same keycode
2025-02-11 23:59:12 +07:00
Riteo 54755a27e9 Wayland: Unstuck keys with same keycode
This fixes once and for all the core issue of different Godot `keycode`s
released from the same raw XKB keycode.

The `InputEventKey` `keycode` value _should_ map to the "unmodified"
key, but unfortunately there's an ambiguity with their encoding for
"special" keys ("delete", "insert", etc.), in witch they ignore their
unicode representation. This means that a key that is special when plain
but a character when modified would never be properly picked up, so we
do indeed change its keycode. As a consequence of this exception, some
Godot keys never receive release events and get "stuck".

This patch adds an extra check through an `HashMap` to "unstuck" keys
that changed while having the same keycode.

I also could not resist simplifying a bit the regular key event
generation method but this makes things more consistent and predictable
IMO.
2025-02-11 13:16:16 +07:00
Rémi Verschelde e912241f4d Merge pull request #102674 from Riteo/waiting-for-frame
Wayland: Fix engine stalls while waiting frames
2025-02-11 10:54:28 +07:00
Riteo cbd68eb403 Wayland: Fix engine stalls wihle waiting frames
There were two edge cases in the frame waiting logic (aka manual frame
throttling or emulated vsync) which would cause the editor to stall in
one way or another:

 1. Waiting right after starting the editor would cause a deadlock
between both threads until something happened in the Wayland event
queue, in turn unblocking the Wayland thread and kickstartin the whole
thing;

 2. Starting the editor (and probably other long-loading stuff) without
low consumption mode would suspend the window and never commit its
surfaces, thus never signaling the compositor that we want frame events.
2025-02-11 01:33:36 +07:00
Rémi Verschelde 19a30bb723 Wayland: Fix build config with `so_wrap` disabled
We should only include the vendored headers for Wayland and libdecor-0 when
we use `so_wrap`, i.e. when we *don't* build against system libraries.

The libdecor-0 pkg-config file includes the `libdecor-0/` prefix already,
so its header should be included without it, and likewise in our so wrappers.
Fixes #102671.
2025-02-10 21:42:25 +07:00
Adam Scott 1376828ef6
Fix `fr+oss` layout issues with KP period
Co-authored-by: Riteo Siuga <riteo@posteo.net>
2025-02-08 17:17:11 +07:00
Lukas Tenbrink e34f1f504c Use `std::size` instead of `sizeof(a) / sizeof(a[0])` pattern throughout the codebase. 2025-02-07 14:57:48 +07:00
Hilderin a3d03717c0 Fix Floating Window request close when a dialog is opened 2025-02-05 20:34:32 +07:00
Thaddeus Crews a63a8b430b
Merge pull request #102104 from Hilderin/fix-embedded-game-disappear-when-not-focused
Fix Embedded Game disappear when not focused on KDE 5
2025-02-05 10:27:38 +07:00
Thaddeus Crews a2d6e2e138
Merge pull request #102448 from adamscott/a-miserable-little-pile-of-secrets
Add `XK_KP_{Decimal,Enter}` to `KeyMappingX11::is_sym_numpad()`
2025-02-05 10:27:30 +07:00
Adam Scott e34e127062
Add `XK_KP_{Decimal,Enter}` to `KeyMappingX11::is_sym_numpad()` 2025-02-05 10:54:46 +07:00
Hilderin f7d1558bc0 Fix Embedded Game disappear when not focused on KDE 5
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2025-02-05 12:01:40 +07:00
Rémi Verschelde b4e16b4520 Merge pull request #102314 from Hilderin/fix-floating-window-overlapping
Fix Floating Window overlapping when on screen edge on KDE
2025-02-05 11:34:05 +07:00
Rémi Verschelde ab0c712bf5 Merge pull request #102311 from Hilderin/fix-floating-window-not-visible-after-restore
Fix Floating Window not visible after restore on KDE
2025-02-05 11:34:01 +07:00
Pāvels Nadtočajevs 05ca80632d [Linux] Implement native color picker. 2025-02-03 16:30:44 +07:00
Thaddeus Crews 480843cf2b
Merge pull request #101812 from bruvzg/portal_chk
[FreeDesktop portal] Check for `FileChooser` and `Settings` interface availability instead of assuming it's always available.
2025-02-03 08:16:10 +07:00
Thaddeus Crews d2995dcfe8
Merge pull request #102169 from Riteo/what-is-even-a-keypad
Linux/BSD: Modify only keypad keys
2025-02-03 08:16:08 +07:00
Riteo 140a63be25 Linux/BSD: Modify only keypad keys
The `keycode` field of `InputEventKey` is supposed to be "unshifted";
That is, what the key would output if no modifier keys were pressed.
This should match what's written on the key label, but `Key` enumerates
also all keypad keys, which require a modifier. We thus require some
extra checks for them.

Note that this can still allow "stuck keys", but that's an even deeper
problem.
2025-02-02 19:19:15 +07:00
Hilderin bc0efb86a9 Fix Floating Window overlapping when on screen edge 2025-02-01 22:27:57 +07:00
Hilderin 150191353f Fix Floating Window not visible after restore on KDE 2025-02-01 21:08:39 +07:00
Thaddeus Crews 4f3dddbbff
Merge pull request #101987 from Riteo/imagine-using-rids
Wayland: Check custom cursor resource reference for cache invalidation
2025-01-31 09:15:52 +07:00
Pāvels Nadtočajevs 86f56efbaa [FreeDesktop portal] Check for `FileChooser` and `Settings` interface availability instead of assuming it's always available. 2025-01-31 07:52:40 +07:00
Thaddeus Crews 3c80c14092
Merge pull request #101924 from adamscott/game-editor-non-cached-mouse-mode
Delegate handling `mouse_mode` to the `DisplayServer`
2025-01-28 16:08:56 +07:00
Adam Scott 47f553ae0b
Delegate to the DisplayServer the task of handling mouse_mode
- Add `MOUSE_MODE_MAX` and various index checks
2025-01-28 11:22:27 +07:00
Hilderin 725dd4930e Fix BadWindow error when stopping embedded game on Linux 2025-01-25 20:30:40 +07:00
Riteo c8087567c9 Wayland: Check custom cursor resource reference for cache invalidation
Images don't have RIDs and this way of checking stuff broke the cursor
cache. Let's do like all other platforms and check the resource
reference instead.
2025-01-24 15:10:46 +07:00
Thaddeus Crews f1c0b5b854
Merge pull request #101779 from Riteo/primary-mess
Wayland: Check selection devices before using them
2025-01-22 09:19:30 +07:00
Hilderin 9eed43d429 Fix NOTIFICATION_WM_CLOSE_REQUEST in Embedded Floating Window 2025-01-21 21:03:15 +07:00
Riteo d12137bdda Wayland: Pass unmodified symbols to key events
Before this change we would internationalize the keycode itself in all
`InputEventKey`s, confusing the whole input subsystem.
2025-01-20 18:27:04 +07:00
Riteo Siuga bed2a1927f Wayland: Check selection devices before using them
Looks like we never actually stopped the code from using bad pointers.
I even forgot the check in the primary selection code 🤦
2025-01-20 02:13:45 +07:00
Riteo Siuga 368a59e6f9 Wayland: Release pressed events on application focus out
Looks like I always assumed wrongly that the compositor would send us
key release events when unfocusing... It did not.
2025-01-20 01:38:25 +07:00
Lukas Tenbrink 512abc38b2 Remove implicit conversions from String, Char16String and CharString to data pointers. Make conversions to StrRange implicit to aid transition. 2025-01-17 17:31:58 +07:00
Pāvels Nadtočajevs 133ea4f17a [Wayland] Fix excessive IME updates. 2025-01-17 15:29:06 +07:00
Thaddeus Crews fd88acc671
Merge pull request #101008 from Repiteo/scons/nocache-all-text
SCons: Properly `NoCache` all text files
2025-01-16 17:17:59 +07:00
Thaddeus Crews 73278bf35d
SCons: Properly `NoCache` all text files 2025-01-16 16:59:12 +07:00
Travis Lange d713a22f2e fix wayland can set mode exclusive full screen 2025-01-14 20:21:52 +07:00
Pāvels Nadtočajevs 2e99d84e87 [DisplayServer] Add missing `FEATURE_WINDOW_DRAG` flag to Windows, X11 and Wayland display servers. 2025-01-14 15:26:32 +07:00
Rémi Verschelde 26db0bb15f SCons: Make `lto=auto` prefer ThinLTO over full LTO for LLVM targets
This speeds up build time considerably for these platforms compared to
using `lto=full`, which is sadly single-threaded with LLVM, unlike GCC.

Changes to default behavior of `lto=auto` (i.e. `production=yes`):
- Linux: Prefer ThinLTO for LLVM
- Web: Prefer ThinLTO
- Windows: Prefer ThinLTO for llvm-mingw

The following LLVM targets don't use LTO by default currently, which
needs to be assessed further (gains from LLVM LTO on performance need
to be weighed against the potential size increase from heavy inlining):
- Android
- iOS
- macOS
- Windows clang-cl
2025-01-09 13:03:58 +07:00
Rémi Verschelde 65cf7c1d5e Merge pull request #101221 from bruvzg/win_dec_exp
[Window] Expose `start_drag` and `start_resize` methods (for both native and embedded windows).
2025-01-09 11:17:24 +07:00
Rémi Verschelde 7fe0609118 Linux: Relax interdependency between freetype, libpng, and zlib for unvendored builds
This restriction was added to fix #7373 back then, which was a symbol conflict
between FreeType's bundled copy of gzip/zlib, and distro packages.

But we also unbundled FreeType's zlib in #69395 so this is no longer an issue.

On the other hand recent issues pointed out that using system-provided icu4c
or harfbuzz can cause issues (#91401, #100301). We still allow it for now but
raise a warning.
2025-01-09 00:28:46 +07:00
Riteo e5ac45e822 Wayland: Unsuspend only for the same reason as suspension
Before, we would check both methods together, leading to loops.

Now we track the actual reason we suspended and only unsuspend when
that same reason triggers. For example, if we suspend because of the
suspended flag we'll unsuspend only because it got unset. Conversely, if
we suspend because of a timeout we'll unsuspend only if we get a new
frame event.

We do this because, while some compositors properly report a "suspended"
state (hinting us to stop repainting), most don't and we need a "safety
net" anyways as we do not want to constantly stay at 1fps (the max time
we'll wait before giving up) either.
2025-01-08 13:53:01 +07:00
Rémi Verschelde cecc83d26a Merge pull request #101225 from Summersay415/arch-docs
Update official export templates architecture list in docs
2025-01-08 00:21:07 +07:00
Rémi Verschelde 0fee2724f0 Merge pull request #100751 from YYF233333/force_regex_with_editor
Force build editor with regex module, remove checking code
2025-01-07 23:17:35 +07:00
Pāvels Nadtočajevs 8d911b2554 [Window] Expose `start_drag` and `start_resize` methods (for both native and embedded windows). 2025-01-07 23:35:14 +07:00
Summersay415 f6d22da94b Update official export templates architecture list in docs 2025-01-07 20:28:25 +07:00
Yufeng Ying 34d8255947 Force build editor with regex module, remove checking code.
Fix include.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2025-01-07 19:43:23 +07:00
Pāvels Nadtočajevs 7f0b4e58b0 Implement `DisplayServer.window_start_resize`. 2025-01-07 07:58:02 +07:00
Rémi Verschelde cc32e46360
Merge pull request #101135 from Hilderin/fix-embedding-not-working-intermittently
Fix embedding failing intermittently
2025-01-06 22:49:05 +07:00
Rémi Verschelde 44f871ff72
Merge pull request #100898 from Summersay415/wayland-issue
Fix exclusive fullscreen on Wayland
2025-01-06 22:47:53 +07:00
Rémi Verschelde e06cac212b
Merge pull request #99893 from kiroxas/avoidUTF8ParsingWhenNotNecessary
Avoid duplicated `utf8()` calls
2025-01-06 22:47:12 +07:00
Hilderin 2f061df7b0 Fix embedding not working intermittently 2025-01-06 08:04:57 +07:00
Pāvels Nadtočajevs e1f129cb52 Support MIME types in file dialog filters on macOS and Linux. 2025-01-04 22:05:35 +07:00
Rémi Verschelde 35cf29bb21
Merge pull request #100715 from buresu/fix-wayland-ime-input
Fix last character deletion in Wayland IME input
2025-01-03 00:48:55 +07:00
Summersay415 8c1742c957 Fix exclusive fullscreen on Wayland 2025-01-02 21:49:49 +07:00
Thaddeus Crews 3994e561ea
Merge pull request #100827 from OS-of-S/fixed-mold-search
Fix Mold-search in older systems
2024-12-30 08:58:49 +07:00
OS-of-S b9f0e0cfa3 Fixed Mold-search in older systems 2024-12-28 13:49:56 +07:00
A Thousand Ships a1846b27ea
Improve use of `Ref.is_null/valid`
Use `is_null` over `!is_valid` and vice versa.
2024-12-23 16:35:02 +07:00
Naoto Kondo b719eed725 Fix last character deletion in Wayland IME input 2024-12-22 05:52:03 +07:00
Rémi Verschelde 13274842a9
Merge pull request #100638 from Tiktalik/fixed-wayland-horizontal-scroll
Fix Wayland left/right scroll wheel issues.
2024-12-20 23:57:16 +07:00
Rémi Verschelde eaed664bce
Merge pull request #100637 from bruvzg/unset_fw
Unset last focused window when it is destroyed.
2024-12-20 23:57:13 +07:00
Tiktalik fb741715c1
Fixed incorrect use of vertical scroll where it should have been horizontal. 2024-12-20 00:53:10 +07:00
Pāvels Nadtočajevs 73faa509ea Unset last focused window when it is destroyed. 2024-12-20 09:40:25 +07:00
Kiro 06efe84bca Remove duplicate `utf8()` calls 2024-12-19 10:15:46 +07:00
Hilderin 9d2a4c03be Embedding game process in editor 2024-12-18 17:52:42 +07:00
Rémi Verschelde 4e46e8beb7
Merge pull request #100464 from bruvzg/start_drag_port
Implement `window_start_drag` on Windows and Linux.
2024-12-18 00:39:56 +07:00
Fredia Huya-Kouadio 2d3f6963b2 Update the visibility for the custom templates for all platforms
Hide the custom template options behind the `Advanced Options` toggle
2024-12-17 13:08:47 +07:00
Rémi Verschelde 182b4741ea
Merge pull request #93479 from Repiteo/scons/better-colored-output
SCons: Improve colored output
2024-12-17 16:18:41 +07:00
Pāvels Nadtočajevs 293be04ec8 Implement `window_start_drag` on Windows and Linux. 2024-12-17 16:49:27 +07:00
Hilderin 4e19ab8afe
Fix connecting a signal with a double click is too difficult
Co-authored-by: Danil Alexeev <dalexeev12@yandex.ru>
2024-12-14 16:18:34 +07:00
HP van Braam dbbacf3d0e Regenerate X11 wrappers with dynload-wrapper 0.7
Dynload-wrapper 0.7 introduces the --include-dir option which lets us restrict
what headers are considered for generation.

In this case it removes the `XFreeThreads` Xlib function which does not
exist on Ubuntu 22.04 and older.
2024-12-12 14:57:26 +07:00
Thaddeus Crews 38775731e8
Merge pull request #99965 from Riteo/unstable-galore
Wayland: Add support for xdg-foreign-unstable-v2
2024-12-11 17:36:07 +07:00
Thaddeus Crews 6cbf7c77c2
Merge pull request #100150 from ArchercatNEO/homeless-export
Use temp dirs instead of cache dirs for export
2024-12-10 14:15:54 +07:00
Thaddeus Crews f222cc43f3
Merge pull request #99633 from buresu/fix-wayland-keymapping
Fix underscore input not working with jp106 keyboard on wayland platform
2024-12-10 14:15:51 +07:00
Thaddeus Crews d8761f2c79
SCons: Improve colored output 2024-12-10 11:44:48 +07:00
Riteo 65c28ed31d Wayland: Add support for xdg-foreign-unstable-v2
The v1 version is deprecated and bound to be removed in the future from
all compositors. This patch adds a v1/v2 designator to everything
related to the protocol and prefers the v2 protocol if both are
available.

Additionally, renames the event handler to follow the Wayland interface
name, for consistency with the rest of the codebase.
2024-12-10 01:29:46 +07:00
ArchercatNEO 00a791f04e Use temp dirs instead of cache dirs for export
Fixes #95897
During CI scenarios $HOME may be set to an invalid value (such as
`/var/empty`).
Using temp dirs fits better with godot's usage of these paths and is
independent from the user's $HOME.
2024-12-08 12:07:17 +07:00
Thaddeus Crews 49e033f8e2
Merge pull request #100047 from MBCX/fix-freebsd-compilation
Make Godot compile on `FreeBSD`
2024-12-05 14:12:11 +07:00
Thaddeus Crews 63af934d74
Merge pull request #98506 from 0xafbf/build-linux-with-spaces-in-path
Fix linux builds with separate debug symbols file when there is a space in the path.
2024-12-05 14:12:10 +07:00
MBCX 6bc80effbb Make Godot compile on FreeBSD 2024-12-05 12:33:55 +07:00
Student Main f39614aa5a Ignore case when parse /proc/cpuinfo 2024-12-06 00:19:58 +07:00
Student Main e0693f8ad8 Add loongarch64 support 2024-12-06 00:18:26 +07:00
Andrés Botero becf5d7ac3 Fix linux builds with debug symbols when there is a space in the path. 2024-12-05 10:31:12 +07:00
Pāvels Nadtočajevs 84650f2018 Implement `DisplayServer.beep`. 2024-12-03 12:43:26 +07:00
Rémi Verschelde 60e1490df1
Merge pull request #99644 from bruvzg/fd_all_name
Change file dialog all files filter name from `All Files (*)` to `All Files (*.*)`.
2024-12-02 17:20:23 +07:00
Rémi Verschelde 1fed9cf01f
Merge pull request #99110 from bruvzg/gnome_fd
[Linux] Use safe IDs for native file dialog options. Show extensions in export dialog.
2024-12-02 15:51:07 +07:00
rune-scape d58b2e879f Get rid of easily removable uses of const_cast 2024-12-01 17:50:13 +07:00
Naoto Kondo f367a6c231 Fix underscore input not working with jp106 keyboard on wayland platform 2024-11-30 23:40:42 +07:00
Pāvels Nadtočajevs 1d43fa9a64 Change file dialog all files filter name from `All Files (*)` to `All Files(*.*)`. 2024-11-24 20:09:05 +07:00
Trevor Davenport 0d9a705e25 Wayland: Only set selection when there is not already a source.
Co-authored-by: Riteo Siuga <riteo@posteo.net>
2024-11-17 16:00:24 +07:00
Pāvels Nadtočajevs f5fad7592f Use processed filter list for native dialogs. 2024-11-15 12:08:33 +07:00
Pāvels Nadtočajevs ed7b4f5c4a [Linux] Use safe IDs for native file dialog options. 2024-11-15 08:45:33 +07:00
Yevhen Babiichuk (DustDFG) a42b8e2413 Buildsystem: Use pkg-config for miniupnpc and mbedtls
Miniupnpc added pkg-config files in 2.2.3 but we require 2.2.8
5a398006b9

MbedTLS added pkg-config files in 3.6.0 while we require 3.6.1
https://github.com/Mbed-TLS/mbedtls/blob/development/ChangeLog

Signed-off-by: Yevhen Babiichuk (DustDFG) <dfgdust@gmail.com>
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2024-11-13 15:25:42 +07:00
Hein-Pieter van Braam 333452d499 Regenerate X11 wrappers
Version 0.6 of https://github.com/hpvb/dynload-wrapper/ now supports all
of the features we need to generate the wrappers without editing them.

This replaces the hand-patched wrappers with "clean" generated ones.
2024-11-09 02:52:49 +07:00
Thaddeus Crews bb5f390fb9
Style: Apply `clang-tidy` fixes (superficial)
• `modernize-use-bool-literals`, `modernize-use-nullptr`, and `readability-braces-around-statements`
2024-11-04 12:11:14 +07:00
Anish Mishra 0dfd18c84b [DisplayServer] Add feature flag for native file dialog access to `user/res` and `options` 2024-10-30 14:13:43 +07:00
Thaddeus Crews 05a4620e88
Merge pull request #98615 from Summersay415/three-opengls-please
Fix fallbacks to OpenGL
2024-10-29 19:25:48 +07:00
Thaddeus Crews b7a0971ad2
Merge pull request #97934 from adamscott/give-AThousandShips-a-break
[Codestyle] Set clang-format `RemoveSemicolon` rule to `true`
2024-10-29 19:25:36 +07:00
Summersay415 6d14cd6ff9 Fix fallbacks to OpenGL 2024-10-28 22:57:19 +07:00
Thaddeus Crews 07e759b74a
Merge pull request #97771 from dsnopek/openxr-linux-egl
OpenXR: Add support for Wayland on Linux
2024-10-25 13:04:08 +07:00
Thaddeus Crews 17f06f6dae
Merge pull request #97555 from dustdfg/platform_methods/extract_validate_arch
Build System: Extract `validate_arch` helper functions
2024-10-25 13:03:48 +07:00
Adam Scott 0d350e7108
Set clang-format `RemoveSemicolon` rule to `true`
- Set clang-format `Standard` rule to `c++20`
2024-10-25 13:49:43 +07:00
Matias N. Goldberg 0818408db5 Fix wrong Wayland path if building with opengl3=no
Godot checks if there's Vulkan or GLES3 support.
If no support is found, it shows an error message.

However the code for this error message is left out when building with
opengl3=no
2024-10-12 20:20:12 +07:00
Yevhen Babiichuk (DustDFG) 7aacdaa071 Build System: Extract `validate_arch` helper function
Signed-off-by: Yevhen Babiichuk (DustDFG) <dfgdust@gmail.com>
2024-10-06 07:50:49 +07:00
David Snopek 256699ee31 OpenXR: Add support for Wayland on Linux 2024-10-04 11:44:05 +07:00
bruvzg d2f3725120
Fix window_set_current_screen for maximized windows. 2024-10-03 10:38:32 +07:00
Gergely Kis 146ba4106f Move Vulkan includes to a central godot_vulkan.h header
Also fixes Vulkan build problem with recent Clang.
2024-09-29 17:53:18 +07:00
BlueCube3310 2167157aaf Replace squish with bcdec for BC decompression 2024-09-26 14:42:54 +07:00
Rémi Verschelde a4c1804cab
Merge pull request #97483 from akien-mga/clang-format-19.1.0
CI: Update `clang-format` pre-commit hook to 19.1.0
2024-09-26 12:46:04 +07:00
Rémi Verschelde a90da7e87b
Merge pull request #93058 from Repiteo/scons/scons_hints
SCons: Add unobtrusive type hints in SCons files
2024-09-26 12:45:21 +07:00
Rémi Verschelde c92a6c7e27
CI: Update `clang-format` pre-commit hook to 19.1.0 2024-09-26 11:46:12 +07:00
Thaddeus Crews 9f9ee0c813
SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 +07:00
David Snopek 36293a2dbf Fix renaming nodes on X11 2024-09-25 09:05:51 +07:00
Joaquim Monteiro c4e4810e93
Fallback to OpenGL 3 if Vulkan isn't available on Wayland 2024-09-21 06:35:35 +07:00
Rémi Verschelde c2564f42aa
Merge pull request #97142 from SheepYhangCN/master
Fallback to OpenGL 3 if other rendering drivers are not supported
2024-09-20 16:06:35 +07:00
Thaddeus Crews b37fc1014a
Style: Apply new `clang-format` changes 2024-09-20 08:09:48 +07:00
SheepYhangCN 3b839347df Added fallback_to_opengl3 2024-09-20 06:10:05 +07:00
David Snopek b1871cdabf Fix project manager stealing focus on i3 2024-09-16 16:55:57 +07:00
Rémi Verschelde 4215dfdff7
Merge pull request #96973 from Riteo/pointing-the-obvious
Wayland: Simplify cursor code and fix custom cursors
2024-09-16 13:35:35 +07:00
Markus Sauermann 60aaa017ff Enable Drag and Drop for SubViewports and Windows
Make Drag and Drop an application-wide operation.
This allows do drop on Controls in other Viewports/Windows.

In order to achieve this, `Viewport::_update_mouse_over` is adjusted to
remember the Control, that the mouse is over (possibly within nested
viewports). This Control is used as a basis for the Drop-operation, which
replaces the previous algorithm, which was only aware of the topmost
Viewport.

Also now all nodes in the SceneTree are notified about the Drag and Drop
operation, with the exception of SubViewports that are not children of
SubViewportContainers.
2024-09-15 01:06:02 +07:00
Riteo c15cd3acc4 Wayland: Simplify cursor code and fix custom cursors
Initially the WaylandThread cursor code was supposed to be as stateless
as possible but, as time went on, this wasn't possible.

This expectation made the resulting API quite convoluted, so this patch
aims to simplify it substantially bot in terms of API surface and, most
importantly, in terms of actual implementation complexity.

This patch also fixes custom cursors since I accidentally changed the
mmap flags to MAP_PRIVATE some time ago. This took me hours to notice.
2024-09-13 19:08:53 +07:00
Riteo 343ea9c6f7 Wayland: clear button mask on pointer leave
While experimenting with the recent "extent to title" PR, I noticed that
it's not guaranteed for a "button released" event to be emitted when
the pointer leaves the main surface, leaving some buttons stuck.

Not doing this for tablets since the spec makes this behavior clear and
explicit, so we (hopefully) shouldn't have this issue there.
2024-09-10 20:53:53 +07:00
Riteo 26d89bc8e9 Wayland: make primary selection logic consistent with main clipboard 2024-09-08 16:48:41 +07:00
Rémi Verschelde 9abf86f4fe
Merge pull request #96540 from hunterkepley/fix-wayland-middlemouse-paste
Wayland: Fix primary clipboard handling
2024-09-04 11:16:42 +07:00
Rémi Verschelde 8eff04192b
Merge pull request #91780 from Riteo/falling-with-style
Improve UX when falling back between Display Servers
2024-09-04 11:16:08 +07:00
hunterkepley 7949585aad Wayland: Fix primary clipboard handling 2024-09-03 22:39:54 +07:00
bruvzg c273786758
Update rendering driver name on fallbacks. Fix rendering driver/method in the editor system info. 2024-09-01 18:22:40 +07:00
Rémi Verschelde 0897d830fe
Merge pull request #96204 from bruvzg/fd_no_case
[Linux] Make file filters case insensitive.
2024-08-30 09:59:23 +07:00
Rémi Verschelde 66dd06837c
Merge pull request #90782 from bruvzg/export_platform_extension
Allow adding custom export platforms using scripts / GDExtension.
2024-08-30 09:58:52 +07:00
bruvzg ace603bcb9
[Linux] Make file filters case insensitive. 2024-08-28 11:13:47 +07:00
bruvzg 07e986f728
Allow adding custom export platforms using scripts / GDExtension. 2024-08-28 10:29:01 +07:00
bruvzg 7b4e3e021a
[Linux] Fix "all files" filter in the native file dialog. 2024-08-28 10:14:01 +07:00
Joel Winarske 6ce71f0fb0 Use wayland-egl-core.h instead of wayland-egl.h
-avoid use of transitive wayland include

-resolves https://github.com/godotengine/godot/issues/95830

Signed-off-by: Joel Winarske <joel.winarske@gmail.com>
2024-08-23 14:16:37 +07:00
Rémi Verschelde 568589c9d8
Merge pull request #90993 from darksylinc/matias-TheForge
Add debug utilities for Vulkan
2024-08-22 00:38:22 +07:00
Rémi Verschelde 78f47abe2b
Merge pull request #94022 from Riteo/a-fraction-of-the-work
Wayland: Switch pointer position handling to doubles
2024-08-22 00:10:31 +07:00
Matias N. Goldberg 364f916f3f
Add debug utilities for Vulkan
Features:
- Debug-only tracking of objects by type. See
get_driver_allocs_by_object_type et al.
 - Debug-only Breadcrumb info for debugging GPU crashes and device lost
 - Performance report per frame from get_perf_report
- Some VMA calls had to be modified in order to insert the necessary
memory callbacks

Functionality marked as "debug-only" is only available in debug or dev
builds.

Misc fixes:
 - Early break optimization in RenderingDevice::uniform_set_create

============================

The work was performed by collaboration of TheForge and Google. I am
merely splitting it up into smaller PRs and cleaning it up.
2024-08-21 23:48:08 +07:00
Riteo 33e414cf75 Wayland: report when video drivers can't be loaded or found
This brings it to parity with the X11 backend.
2024-08-21 07:15:08 +07:00
Riteo c01f9361b1 X11: Alert only when video drivers fail initialization
Before, they would always complain even if there was no attempt at
initializing them (e.g. because there's no X11 display).

While we're at it, this patch also adds a specific message for OpenGL ES
and rewords "OpenGLES" to "OpenGL ES" in an error, for consistency
(AFAIK we either say "GLES" or "OpenGL ES").
2024-08-21 06:31:19 +07:00
Hugo Locurcio 57141e04a6
Simplify printed file paths in the Linux/*BSD crash handler
This shortens the printed paths a bit when they would contain `/./`,
which is redundant (e.g. `/opt/godot/./core` becomes `/opt/godot/core`).
2024-08-18 23:36:29 +07:00
bruvzg f72e74f395
[Windows/Linux] Check custom export templates architecture. 2024-08-16 15:52:12 +07:00
Riteo 0d1826e084 Wayland: Avoid recreating input objects on capability change
Before, multiple capability events would instantiate the same object
over and over as long as its bit was set. This caused issues with
hotplug and device suspension.
2024-08-09 15:42:23 +07:00
bruvzg 99b0100a06
[X11] Use motion event button state instead of async state. 2024-08-01 10:07:07 +07:00
alvinhochun 24e02d56cb
Remove unneeded call in DisplayServerX11
X11 does not need setting exclusive flag (it is not implemented).

Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
2024-07-25 17:11:15 +07:00
Alvin Wong 97aa278edb Pass window exclusive and transient properties for subwindow creation
On Windows this allows to avoid having to change the owner of the window
after it has been created, which in rare circumstances may cause the
window to bug out.
2024-07-25 00:27:27 +07:00
bruvzg 52a2836861 Disable FP contraction. 2024-07-23 14:33:51 +07:00
Riteo e307fd60d8 Wayland: Fix error spam when interacting with decorations
Also tried to make tablet handling a bit tidier (less whitespace).

That said I'll uniform tablet handling better once we're back in the dev
cycle.
2024-07-20 03:46:35 +07:00
Ronald Casili 3636d9dafc
Linux/X11: Fix memory leak from created screen images
Allocated XImages are improperly free'd with XFree.
The X11 documentation says that XImage should use
XDestroyImage to free both the image structure and
the data pointed to by the image structure.

Also fix a potential use-after-free bug.
2024-07-18 09:45:44 +07:00
Rémi Verschelde 64a11d08cc
Merge pull request #94411 from Riteo/suspending-the-right-way
Wayland: Check for suspended flag when unsuspending
2024-07-17 12:52:50 +07:00
Riteo 84f26a629d Wayland: check for suspended flag when unsuspending
Before, we would only check for the frame flag, which is unreliable on
newer suspension-aware compositors.
2024-07-16 00:11:22 +07:00
Riteo a852e76196 Wayland: commit surface on window creation
This is needed for initializing xdg_surfaces when not using libdecor.
Now the pure xdg_shell code path should work again.
2024-07-15 22:11:24 +07:00
Rémi Verschelde 49a6171319
Merge pull request #93352 from Calinou/linuxbsd-controller-no-trackpad-graphics-tablet
Fix trackpads and graphics tablets being recognized as controllers on Linux/*BSD
2024-07-09 16:47:04 +07:00
Riteo 2ff50119dc Wayland: switch pointer position handling to doubles
This reduces even further the amount of work we have to do when scaling
and potentially improves input accuracy as now the input code is free
from any form of rounding.
2024-07-07 09:07:29 +07:00
Riteo 3e0632cbd2 Wayland: scale relative pointer motion
Oops, forgot to do that. Motion-dependent stuff should now work properly
when using scaled displays.
2024-07-07 08:39:53 +07:00
Hugo Locurcio 724cdffc8c
Fix trackpads and graphics tablets being recognized as controllers on Linux/*BSD 2024-07-06 00:26:39 +07:00
Rémi Verschelde 25de53e147
X11: Fix creating RenderingDevice after #93706
The line was removed by mistake.
2024-06-29 14:03:29 +07:00
Pedro J. Estébanez 32d9c93af3 Improve handling of rendering startup errors 2024-06-28 19:31:50 +07:00
Rémi Verschelde ac9181c666
Merge pull request #93682 from dsnopek/fix-text-editor-find-in-files-focus-bug
Fix text editor stealing focus from "Find in Files" dialog on X11
2024-06-28 12:37:52 +07:00
Riteo f27471fbd8 Wayland: minimize surface commits and limit them to the main thread
Before of this patch, as explained in the usual
commented-wall-of-text-longer-than-the-actual-patch-itself™, due to the
multithreaded nature of the Wayland thread, it was possible to commit a
surface while the renderer was doing stuff, which was _very_ wrong.

Initially the consequences of such a sin weren't obvious but, now that
explicit synchronization is becoming more and more common, we can't
commit a buffer randomly without basically guaranteeing a nasty, nasty
crash (and we should have avoided commits altogether in the first place
to ensure atomic surface updates).

We now only trigger a commit _in the main thread_ when low processor usage
mode is on _and_ if we know that we won't be rendering anything as, due to
its intermittent nature, it makes "legacy" (pre xdg_wm_base v6) frame
callback based suspension quite annoying.
2024-06-28 01:47:25 +07:00
David Snopek 1289298b5e Fix text editor stealing focus from "Find in Files" dialog on X11 2024-06-27 17:27:21 +07:00
Thaddeus Crews cc6dd8d02c
Style: Optimize `.svg` files with `svgo` 2024-06-23 08:15:19 +07:00
bruvzg b5e3238109
[TextServer] Fix get_word_breaks and it uses. 2024-06-21 14:56:57 +07:00
Rémi Verschelde 4e01d8663e
Merge pull request #93021 from bruvzg/wl_ime
[Wayland] Implement IME support.
2024-06-19 10:10:09 +07:00
Hugo Locurcio 29348be0ca Tweak warning messages related to V-Sync on OpenGL
- Make warnings print only once per session.
- Tweak the message to be less confusing, and mention that the issue
  most likely stems from a graphics driver limitation.
2024-06-16 21:22:10 +07:00
Rémi Verschelde e15c2e051e
Merge pull request #92663 from Riteo/holy-egl-batman
EGL: Use `EGL_EXT_platform_base` whenever possible
2024-06-13 17:19:17 +07:00
bruvzg 3cabf51325
[X11] Detect XWayland and disable screen capture support. 2024-06-12 10:05:17 +07:00
bruvzg be25e60f61
[Wayland] Implement IME support. 2024-06-11 12:24:54 +07:00
Rémi Verschelde b80e591448
Merge pull request #92843 from anniryynanen/tooltip-in-popup
Stop color picker tooltip from stealing input events
2024-06-10 16:11:52 +07:00
Rémi Verschelde e52658643d
Merge pull request #92702 from kleonc/cursor_image_from_atlas_texture_fix
Fix creating cursor image from `AtlasTexture`
2024-06-07 23:29:57 +07:00
Anni Ryynänen ae1e2182ec
Stop color picker tooltip from stealing input events
Input events go to the tooltip because it's added to `popup_list` in
DisplayServer `popup_open`. I think there's no harm in tooltips being omitted
from the list, so this commit blocks non-popup windows from being added if they
have `FLAG_NO_FOCUS` and `FLAG_MOUSE_PASSTHROUGH`.

I'm not happy with this way of detecting tooltips. It'll also catch other
windows where this behavior may or may not be wanted.

I thought about adding `FLAG_TOOLTIP`, but went with the smaller change for
now.

Fixes #79500.
2024-06-06 20:00:05 +07:00
kleonc 91e995e704 Fix creating cursor image from AtlasTexture 2024-06-05 01:44:05 +07:00
Riteo 8f69f29694 EGL: Use EGL_EXT_platform_base whenever possible
This avoids any assumption from the driver, which would otherwise select
a specific platform and potentially mess up everything, resulting
usually in a display server failure.
2024-06-04 08:43:34 +07:00
bruvzg 5168647530
Use current mouse button state instead of saved values. 2024-05-31 15:50:14 +07:00
Rémi Verschelde 1dab521f2d
Merge pull request #92208 from Calinou/linuxbsd-use-nanosleep
Use `OS::delay_usec()` to avoid using deprecated `usleep()` on Linux
2024-05-30 11:47:51 +07:00
Rémi Verschelde c98fef08bf
Merge pull request #89033 from bruvzg/doc_end_err
[DisplayServer] Add error messages and descriptions to callbacks.
2024-05-28 17:48:42 +07:00
bruvzg 714effdf07
[DisplayServer] Add error messages and descriptions to callbacks. 2024-05-28 17:36:54 +07:00