Commit Graph

664 Commits

Author SHA1 Message Date
Riteo 3960c6b8f9 Allow building X11 without Vulkan
This limit was likely introduced when Vulkan was the only option.
2022-12-27 21:47:26 +01:00
Rémi Verschelde f8f496ec3b
Merge pull request #69678 from Sauermann/fix-slider-button-up
Fix colorpicker slider bug with mouse-up outside of popup
2022-12-16 13:47:53 +01:00
Haoyu Qiu 207e52c161 Fix String::word_wrap() for long words
- Changes `TextServer.string_get_word_breaks()`
  - Returns pairs of boundary start and end offsets
  - Accepts `chars_per_line` to return line breaks
- Removes `String::word_wrap()`

Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
2022-12-16 13:18:57 +08:00
Rémi Verschelde 346efd29e0
Fix typos with codespell 2022-12-15 12:24:08 +01:00
nikitalita 4fec34808d fix dbus and fontconfig links 2022-12-09 09:05:06 -08:00
Rémi Verschelde 0a3f66471e
Merge pull request #69712 from bruvzg/real_size
Rename `window_get_real_size`, add position counterpart.
2022-12-07 14:29:46 +01:00
bruvzg edf13eb5a6
Rename `window_get_real_size` to `window_get_size_with_decorations`, add `window_get_position_with_decorations`. 2022-12-07 11:07:30 +02:00
bruvzg ad0f6ff85b
[Linux/X11] Split fullscreen mode into `WINDOW_MODE_EXCLUSIVE_FULLSCREEN` and `WINDOW_MODE_FULLSCREEN` to improve multi-window handling. 2022-12-07 09:54:02 +02:00
Markus Sauermann b44e6bb42b Fix colorpicker slider bug with mouse-up outside of popup
When releasing the mouse button outside of the popup while dragging
a slider, the slider still gets adjusted by mouse-move events.

The reason for this bug is that the mouse-up event is sent to the
focused window (main editor window) instead of the colorpicker
popup window.

This PR adjusts the linuxbsd X11 DisplayServer to send the event to the
correct expected window.
2022-12-06 19:30:13 +01:00
Markus Sauermann ada4761181 Fix that mouse-button-up event is parsed twice for drag-and-drop
Currently Input::get_singleton()->parse_input_event(mb); is
called twice for mouse-button-up events when dropping in a different
window on linuxbsd.
2022-12-05 19:31:22 +01:00
Rémi Verschelde 14f23df1a3
Merge pull request #69563 from nyanpasu64/patch-1
Fix burning CPU with udev disabled on Flatpak
2022-12-05 18:07:02 +01:00
bruvzg 89db7f8e7c
[Linux/BSD] Fix build without fontconfig. 2022-12-05 07:56:44 +02:00
bruvzg ecec415988
Use system fonts as fallback and improve system font handling.
Add support for font weight and stretch selection when using system fonts.
Add function to get system fallback font from a font name, style, text, and language code.
Implement system font support for Android.
Use system fonts as a last resort fallback.
2022-12-04 18:44:20 +02:00
nyanpasu64 0cbd1c85a9
Fix burning CPU with udev disabled on Flatpak
Fixes #67355.
2022-12-03 20:10:48 -08:00
Riteo 2dd5a792bb Load X11 dynamically
The loaders have been generated through hpvb's dynload-wrapper, although
they had to be heavily handpatched to workaround some already reported
issues with it. I added a note to each generated file to account for
that.

As GLAD uses X11 stuff directly, I had to define the GLAD_GLX_NO_X11
macro to not let do it that, and handle myself the display loading and
screen handling part myself, which wasn't that hard but it's still
something worth saying.

I plan to improve greatly the X11 backend (including this aspect) but,
as the release isn't that far and I'm also working on the Wayland
backend, this will do for now, I hope.
2022-12-03 19:23:43 +01:00
Rémi Verschelde 13280f1874
X11: Don't override glxSwapInterval function pointers loaded by GLAD
Fixes #68722.

Co-authored-by: alcomposer <alex.w.mitchell@gmail.com>
2022-11-16 10:05:52 +01:00
clayjohn 58a9cfee80 Set vsync on window creation when using GLES3.
Add vsync to Windows platform
2022-11-15 14:14:21 -08:00
Riteo Siuga dc2919d57b Load GLX dynamically with GLAD
This is accomplished through the addition of a GLAD GLX loader in the
`thirdparty` directory.

This is another step towards a nice Wayland/X11 interoperation.
2022-11-15 13:55:30 +01:00
Rémi Verschelde 696740fe38
Merge pull request #68680 from bruvzg/fc_no_font_sub
[fontconfig] Reject font substitutes if non-alias name was used.
2022-11-15 11:56:31 +01:00
Rémi Verschelde dbf6ff0cb6
Merge pull request #68372 from Riteo/glad2
Regenerate GL loader code with GLAD 2
2022-11-15 11:56:16 +01:00
bruvzg 40832cc670
[fontconfig] Reject font substitutes if non-alias name was used. 2022-11-15 11:17:44 +02:00
Rémi Verschelde 98e0d59952
Merge pull request #68504 from dzil123/cache_system_dir_xdg2
Cache OS_LinuxBSD::get_system_dir
2022-11-15 00:18:09 +01:00
Riteo f6397bffb1 Regenerate GL loader code with GLAD 2
GLAD 1 creates unusable loaders for EGL, while the newly released GLAD 2
does not, so for consistency I thought that it would be a good idea to
uniform things beforehand. While it had some API changes some renames
were all that was needed and everything works like before, at least on
the Wayland branch.

I've kept the structure identical, although this new generator has quite
a few hefty features, such as a single header mode.

I've also added GLAD to `thirdparty/README.md`, but I haven't specified
that in the commit title because it's a very small "fix".
2022-11-14 21:48:01 +01:00
dzil123 d22ab7c85b Cache OS_LinuxBSD::get_system_dir(SYSTEM_DIR_DESKTOP) 2022-11-12 22:38:32 -08:00
Markus Sauermann ed5c9a07d7 Fix gl_manager nullptr crash
Add a nullptr-check, before accessing gl_manager
2022-11-13 00:48:45 +01:00
Markus Sauermann 52d75c9b35 Fix unsent WINDOW_EVENT_MOUSE_ENTER event on mouse_mode-change
coauthor: @bruvzg

On linuxbsd and macOS the WINDOW_EVENT_MOUSE_ENTER was not sent,
when the mouse became visible again after a mouse_mode-change.
2022-11-11 07:52:16 +01:00
Rémi Verschelde 29de658c29
Merge pull request #68345 from Abdul-AZ/master
Fix static object destructors being called on gpu selection with X11
2022-11-09 09:16:04 +01:00
David Snopek 23603e409c Add support for OpenGL to OpenXR 2022-11-08 18:47:11 -06:00
Abdulrahman Al Zeidi 5860f81c18 Fix static object destructors being called on gpu selection with X11 2022-11-07 12:08:52 +00:00
Rémi Verschelde 879aac9db4
Merge pull request #67695 from Sauermann/fix-filedrop-space
Do not strip spaces at the end of file names of dropped files
2022-11-03 12:08:08 +01:00
Markus Sauermann 5d0aade322 Do not strip spaces at the end of file names of dropped files on linuxbsd 2022-11-03 11:38:42 +01:00
Markus Sauermann 8fb4b5998e Fix unwanted popup closing by mouse-move while holding mouse-button 2022-11-03 11:36:58 +01:00
Rémi Verschelde 889868cbbc
Merge pull request #68182 from Riteo/x11-folder
linuxbsd: move all X11 stuff in its own directory
2022-11-03 00:32:30 +01:00
Riteo 593c571d6a linuxbsd: move all X11 stuff in its own directory
This allows implementing `DisplayServer`s like Wayland without making a
mess in the source tree.
2022-11-02 20:48:46 +01:00
bruvzg 060d62e0dc
Load and use system emoji font in the editor. 2022-11-01 11:04:58 +02:00
Rémi Verschelde 9188bc7341
Merge pull request #67879 from bruvzg/fix_no_vlk
Fix build with Vulkan disabled and no Vulkan headers installed.
2022-10-31 14:29:05 +01:00
Rémi Verschelde 5947f22be9
Merge pull request #67578 from KoBeWi/GEDITOR
Unify usage of GLOBAL/EDITOR_GET
2022-10-31 13:15:58 +01:00
Clay John 04ac91f786
Merge pull request #67790 from kdada/fix-flash-window
Make creating window do not flicker when specify custom position
2022-10-28 13:02:58 -07:00
Max Hilbrunner 028db9f2b5
Merge pull request #67914 from Calinou/displayserverx11-no-native-icon
Fix `DisplayServer.has_feature()` claiming X11 has native icon support
2022-10-28 12:46:57 +02:00
zCubed3 e7091d07cd
Fix OS.get_video_adapter_driver_info crash 2022-10-27 15:45:21 -07:00
Clay John 9ffa86357d
Merge pull request #67421 from Sauermann/fix-failure-exit-code
Fix Godot exiting with unexpected failure code
2022-10-27 11:58:50 -07:00
Hugo Locurcio 82a575dff4
Fix `DisplayServer.has_feature()` claiming X11 has native icon support
Native icons are not supported by the X11 DisplayServer, unlike
Windows and macOS.
2022-10-26 20:39:31 +02:00
bruvzg 4dd8f68120
Fix build with Vulkan disabled and no Vulkan headers installed. 2022-10-26 08:55:05 +03:00
Wei Guo d7e39e313b Make window creation with custom position do not flash 2022-10-24 13:50:25 +08:00
clayjohn c4ba1565d0 Update the DisplayServer video driver error message
to be more accurate and friendly
2022-10-18 10:15:11 -07:00
kobewi e48c5daddf Unify usage of GLOBAL/EDITOR_GET 2022-10-18 19:01:48 +02:00
Markus Sauermann 7d59a14db8 Fix Godot exiting with unexpected failure code
The exit code is initialized as EXIT_FAILURE to indicate failures during
startup. Closing the Game window via the window manager does not
change the exit code, so the program exists with EXIT_FAILURE.

This PR set the exit code to EXIT_SUCCESS when initialization was
successful just before starting the main loop.
2022-10-15 03:17:40 +02:00
Rémi Verschelde 261b9da77f
Merge pull request #67281 from Nidjo123/x11-window-resize
Keep rendering context window size in sync when resizing
2022-10-12 22:53:49 +02:00
Nikola Bunjevac 882d40fa11 Keep rendering context window size in sync when resizing
On X11 we rely on ConfigureNotify event to update rendering context
window size, but we don't get such event when resizing
programmatically, only when done "manually" by resizing the window
etc.
2022-10-11 23:27:21 +02:00
Riteo a3b5353892 Actually set the execinfo flag on non-glibc systems 2022-10-11 21:45:29 +02:00
Rémi Verschelde 5aadc618b6 Merge pull request #66102 from MJacred/feature/getvideoadapterdriverinfo
Fetch video adapter driver name and version from OS
2022-10-11 13:59:53 +02:00
MJacred de768afbdc Fetch video adapter driver name and version from OS on Linux/*BSD and Windows 2022-10-11 12:39:41 +02:00
Rémi Verschelde 8017827144 SCons: Re-enable treating `#warning` as error with `werror`
Replace all TODO uses of `#warning` by proper TODO comments, and will open
matching bug reports to keep track of them.

We don't have a great track record fixing TODOs, but I'd wager we're even
worse for fixing these "TODO #warning" so we should prohibit this usage.
2022-10-10 16:12:26 +02:00
Amor Iqbal 43264bff23 Changed the conditions for firing 'No such file or directory' error 2022-10-10 08:28:04 +05:30
Rémi Verschelde 5b6ccf2fd2 Merge pull request #66720 from qarmin/unintialized_memory
Remove usage of unitialized variables
2022-10-05 11:42:47 +02:00
Rémi Verschelde 2c94470dd1 Merge pull request #63983 from Calinou/scons-linux-execinfo-musl
Automatically use execinfo for crash handler on *BSD and musl-based Linux
2022-10-05 08:29:59 +02:00
Hugo Locurcio 8e04bffbcf
Automatically use execinfo for crash handler on *BSD and musl-based Linux
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2022-10-04 19:40:19 +02:00
Rémi Verschelde 4eaa59d0ed Merge pull request #66773 from MladoniSzabi/numpad-no-numlock-bug-linux
Remapped the numpad keys on linux when numlock is off
2022-10-04 11:29:01 +02:00
MladoniSzabi cc0fd7e783 Remapped the numpad keys on linux when numlock is off
On Linux, when using the numpad while numlock is off doesn't do
anything. Made the numpad keys map to the correct control keys.

Resolves: #54814.
2022-10-03 12:53:42 +01:00
Rémi Verschelde f501e4f665 Unix: Remove now unnecessary I/O defines, cleanup
- `LIBC_FILEIO_ENABLED` wasn't defined anywhere, even in _other platforms_.
- `NO_NETWORK` is also never defined. It probably isn't enough anyway to
  disable network APIs in the current codebase.
- `UNIX_SOCKET_UNAVAILABLE` is never defined in this code but used by some
  other platforms, clarify that.
- `NO_STATVFS` can be removed as Android supports it since API level 19,
  which is our current min SDK level. It's also only used for
  `DirAccessUnix::get_space_left()` which is anyway overridden by
  `DirAccessJAndroid::get_space_left()` so it shouldn't make a difference.
  * Fixed documentation for `DirAccess.get_space_left()`.
- `NO_FCNTL` is likely also a remnant of early Android days, in current NDK
  r23 it seems to be available. Also cleaned up unused `fcntl.h` includes.
- `NO_ALLOCA` is never defined, and we use alloca in many places now.
2022-10-03 12:33:41 +02:00
Matthew Munro (mam552) 0f5b448a9c Fix inconsistent window state on X11.
Fixes #66413.
DisplayServerX11 tracks some internal state about whether the window is
fullscreen, minimized, maximized or none. This commit queries the
display server when the window changes, so that this internal state can
be correctly updated.
2022-10-01 16:01:28 -06:00
Rafał Mikrut 2233624152 Remove usage of unitialized variables 2022-10-01 21:09:22 +02:00
Rémi Verschelde ef8834a642 Merge pull request #64784 from yedpodtrzitko/yed/ci-add-mypy
ci: add Python static analysis check via mypy
2022-09-30 17:44:39 +02:00
Rémi Verschelde 166df0896c Fix typos with codespell
Using codespell 2.3-dev from current git.

And fix typo in `methods.py` for `vsproj=yes` option (still won't work
though).
2022-09-30 14:23:36 +02:00
Jiri Suchan c5bd2f9dce ci: add Python static analysis check via mypy 2022-09-30 19:03:17 +07:00
Rémi Verschelde 39facb35a0 SCons: Unify tools/target build type configuration
Implements https://github.com/godotengine/godot-proposals/issues/3371.

New `target` presets
====================

The `tools` option is removed and `target` changes to use three new presets,
which match the builds users are familiar with. These targets control the
default optimization level and enable editor-specific and debugging code:

- `editor`: Replaces `tools=yes target=release_debug`.
  * Defines: `TOOLS_ENABLED`, `DEBUG_ENABLED`, `-O2`/`/O2`
- `template_debug`: Replaces `tools=no target=release_debug`.
  * Defines: `DEBUG_ENABLED`, `-O2`/`/O2`
- `template_release`: Replaces `tools=no target=release`.
  * Defines: `-O3`/`/O2`

New `dev_build` option
======================

The previous `target=debug` is now replaced by a separate `dev_build=yes`
option, which can be used in combination with either of the three targets,
and changes the following:

- `dev_build`: Defines `DEV_ENABLED`, disables optimization (`-O0`/`/0d`),
  enables generating debug symbols, does not define `NDEBUG` so `assert()`
  works in thirdparty libraries, adds a `.dev` suffix to the binary name.

Note: Unlike previously, `dev_build` defaults to off so that users who
compile Godot from source get an optimized and small build by default.
Engine contributors should now set `dev_build=yes` in their build scripts or
IDE configuration manually.

Changed binary names
====================

The name of generated binaries and object files are changed too, to follow
this format:

`godot.<platform>.<target>[.dev][.double].<arch>[.<extra_suffix>][.<ext>]`

For example:
- `godot.linuxbsd.editor.dev.arm64`
- `godot.windows.template_release.double.x86_64.mono.exe`

Be sure to update your links/scripts/IDE config accordingly.

More flexible `optimize` and `debug_symbols` options
====================================================

The optimization level and whether to generate debug symbols can be further
specified with the `optimize` and `debug_symbols` options. So the default
values listed above for the various `target` and `dev_build` combinations
are indicative and can be replaced when compiling, e.g.:

`scons p=linuxbsd target=template_debug dev_build=yes optimize=debug`
will make a "debug" export template with dev-only code enabled, `-Og`
optimization level for GCC/Clang, and debug symbols. Perfect for debugging
complex crashes at runtime in an exported project.
2022-09-26 16:31:46 +02:00
Rémi Verschelde 49fcf4ffad Style: Cleanup header guards for consistency
Fix file names for {Static,Lightmap}RaycasterEmbree.
2022-09-26 13:51:17 +02:00
Rémi Verschelde 35a15e6191 SCons: Refactor handling of `production` flag and per-platform LTO defaults
Fixup to #63288.
See #65583 for the bug report.

Co-authored-by: Cyberrebell <chainsaw75@web.de>
2022-09-19 18:11:29 +02:00
MJacred ac9786c525 Add get_distribution_name() and get_version() to OS
supports: LinuxBSD, Windows, macOS, iOS, Android, UWP

Co-authored-by: bruvzg
2022-09-16 11:17:36 +02:00
Rémi Verschelde d79040e7eb Merge pull request #65496 from MinusKube/popup-capture-mouse-bug
Fix MOUSE_MODE_CAPTURED not working correctly with popups
2022-09-16 09:23:40 +02:00
Rémi Verschelde ff824b6f9d Merge pull request #65509 from gotnospirit/master-os-get_datetime
get_datetime_* functions can return wrong values
2022-09-13 11:01:12 +02:00
clayjohn 96b7cb66df Fix multiwindow support in GLES3 for X11, Windows, and MacOS.
Instead of updating all viewports, then blitting all viewports
to the backbuffer, then swapping all buffers, we run through
all viewports and render, blit, and swap backbuffer before
going to the next viewport.
2022-09-12 17:30:50 -07:00
James 0aecfc9254 Fixes #65377: get_datetime_* functions can return wrong values 2022-09-10 07:58:38 +08:00
Rémi Verschelde c2c659db32 SCons: Refactor LTO options with `lto=<none|thin|full>`
Adds support for LTO on macOS and Android. We don't have much experience
with LTO on these platforms so for now we keep it disabled by default
even when `production=yes` is set.

Similarly for iOS where we ship object files for the user to link in
Xcode so LTO makes builds extremely slow to link.

`production=yes` defaults to full LTO.
ThinLTO is much faster for LLVM-based compilers but seems to produce
bigger binaries (at least for the Web platform).
2022-09-08 10:00:02 +02:00
MinusKube 06b86fad0d Fix MOUSE_MODE_CAPTURED not working correctly with popups 2022-09-07 19:31:57 +02:00
Rémi Verschelde 5062aafc2d Merge pull request #64417 from aaronfranke/has-space
Replace AABB/Rect2/Rect2i has_no_* methods with has_* methods
2022-09-06 17:00:44 +02:00
Aaron Franke 995b9f94e8
Replace Rect2(i) has_no_area with has_area 2022-09-04 23:03:36 -05:00
MatthewZelriche ef02f06b8c Fix XSendEvent crash & bootsplash.
Fixes a crash due to an Xlib error, as well as ensures that Godot
holds the correct size of the window after window modes have been
applied, before exiting the DisplayServerX11 constructor. This ensures
the bootsplash will be displayed with the correct dimensions.

Fixes #65320
2022-09-04 16:46:37 -06:00
Rémi Verschelde 042050a47c
Merge pull request #65283 from bruvzg/reenable_per_pix_transp
Re-enable per-pixel transparency support on Linux, macOS, and Windows.
2022-09-03 23:52:18 +02:00
Rémi Verschelde 7ced3a6e37
Merge pull request #65111 from MatthewZelriche/DroppedXEventFix
Fix dropped XEvents early in main window lifetime.
2022-09-03 20:36:39 +02:00
bruvzg 57829b7cc4
Re-enable per-pixel transparency support on Linux, macOS, and Windows (for Vulkan and OpenGL rendering drivers). 2022-09-03 19:16:03 +03:00
Raul Santos 471c9c2969
Add support for system dark mode (Linux)
- Use `org.freedesktop.appearance color-scheme` to support system dark mode.
2022-09-02 16:49:21 +02:00
MatthewZelriche 91ba9bcb03 Fix dropped XEvents early in main window lifetime.
The DisplayServerX11 constructor processes pending events shortly
after constructing the main window. However, it discards pending events
on the event queue that it is not interested in. This results in these
events never making it to the main events thread and as a result are
never processed. We need to save the events we don't handle in
DisplayServerX11 so that they can be resent for later handling by the
events thread.
2022-09-01 07:42:03 -06:00
MatthewZelriche 87937bcf87 Fix minimize/maximize not taking effect in X11.
Attempts to construct an X11 window in an initial state of
minimized/maximized would fail due to the window being unmapped.
We simply check for failed mode changes during an unmap and reapply
them if necessary.
2022-08-30 12:52:24 -06:00
Rémi Verschelde 432b25d364
Merge pull request #65066 from aaronfranke/str-path-join 2022-08-30 10:01:11 +02:00
MatthewZelriche 37f3b9f1ef Fix fullscreen on X11.
Attempts to set a Godot window to fullscreen prior to the window being
mapped would silently fail. This commit uses
_window_fullscreen_check to test if a window had been set to fullscreen
while unmapped, and if so, resets it to fullscreen once the window has
been successfully mapped.

Fixes #54065
2022-08-29 19:11:20 -06:00
Aaron Franke 10a56981dc
Rename String `plus_file` to `path_join` 2022-08-29 19:38:13 -05:00
Rémi Verschelde c08e84af0d
Merge pull request #64943 from MatthewZelriche/FixUnMappedAncestor 2022-08-29 08:19:50 +02:00
Rémi Verschelde 67e731d450
Merge pull request #64507 from RandomShaper/remove_unused
Remove unused `force_quit` variable from many OS abstractions
2022-08-27 18:42:20 +02:00
MatthewZelriche 93af2993f0 Fix X11 menu window bug.
Fixes an issue where XSetInputFocus fails due to the window not
being viewable.

Fixes #62635
Fixes #60690
2022-08-27 07:38:09 -06:00
Pedro J. Estébanez 6e647dea24 Remove unused force_quit variable from many OS abstractions 2022-08-27 13:41:53 +02:00
Rémi Verschelde fce3602a1e Linux: Fix GNU ld detection for pck_embed linker script 2022-08-26 14:06:56 +02:00
Hugo Locurcio ce56743aa1
Improve platform-specific READMEs to add useful links
This also adds READMEs for all platforms.
2022-08-25 17:50:53 +02:00
Aaron Franke 27b0f18275 Unify bits, arch, and android_arch into env["arch"]
Fully removes the `bits` option and adapts the code that relied on it.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2022-08-25 11:19:20 +02:00
kobewi 8be27dc59e Replace Array return types with TypedArray 2022-08-22 22:42:36 +02:00
bruvzg 6510e11ae9
Fix memory leak when accessing/listing system fonts. 2022-08-09 12:57:53 +03:00
RedMser c939f336d6 Only define `keep_screen_on` project setting once 2022-08-06 22:10:24 +02:00
Rémi Verschelde 33258d850c
Merge pull request #61315 from lawnjelly/variant_bucket_pools
Variant memory pools
2022-08-02 15:54:18 +02:00
Rémi Verschelde 3e5ad8213f
Merge pull request #63563 from aaronfranke/export-arch 2022-07-30 11:22:25 +02:00
bruvzg d6a9384a32
[Linux] Fix build with missing DBUS. 2022-07-29 22:16:21 +03:00
Rémi Verschelde 7199314eb3
Merge pull request #63595 from reduz/remove-signal-connect-binds
Remove Signal connect binds
2022-07-29 18:10:39 +02:00
Aaron Franke 17c4cd6412
Update export dialog to handle many architectures 2022-07-29 10:24:58 -05:00
Juan Linietsky d4433ae6d3 Remove Signal connect binds
Remove the optional argument p_binds from `Object::connect` since it was deprecated by Callable.bind().
Changed all uses of it to Callable.bind()
2022-07-29 16:26:13 +02:00
bruvzg f973069afb
[Linux] Load dbus libraries dynamically. 2022-07-29 11:19:19 +03:00
bruvzg 51c5ba9da7
[Linux] Replace fontconfig wrapper with a one generated from the older library version (2.12.6, Ubuntu 18.04 LTS). 2022-07-29 08:55:19 +03:00
bruvzg 9ced8bcca3
Load fontconfig libraries dynamically. 2022-07-27 21:07:21 +03:00
bruvzg f86448520a
Fix Linux build without fontconfig. 2022-07-27 17:21:04 +03:00
Rémi Verschelde cc5135959b
Merge pull request #62973 from bruvzg/sysfont_support 2022-07-27 13:38:30 +02:00
Aaron Franke e53ae13178
Split up editor export code into multiple files 2022-07-26 08:28:19 -05:00
Rémi Verschelde ba2cffc575
Merge pull request #63096 from aaronfranke/exp-template-names 2022-07-26 10:28:25 +02:00
bruvzg 36ef8f29dc
Implement support for loading system fonts on Linux, macOS / iOS and Windows. 2022-07-26 08:38:05 +03:00
Rémi Verschelde 90019676b0 Code quality: Fix header guards consistency
Adds `header_guards.sh` bash script, used in CI to validate future
changes. Can be run locally to fix invalid header guards.
2022-07-25 11:17:40 +02:00
Aaron Franke 8b5c744f95
Update export template names for Windows, Mac, and Linux 2022-07-22 18:40:59 -05:00
Rémi Verschelde f37990ed77
Merge pull request #63278 from akien-mga/scons-linux-refactor-linker 2022-07-22 11:40:10 +02:00
Rémi Verschelde ed926c4ec1
Merge pull request #63303 from hansemro/x11-eraser-case-insensitive
[X11] Do case-insensitive search for pen inversion detection
2022-07-22 09:17:04 +02:00
Hansem Ro 0f5436098b [X11] Do case-insensitive search for pen inversion detection 2022-07-21 19:25:22 -07:00
Rémi Verschelde c8479c0d4d SCons: Refactor Linux linker options with `linker=<bfd|gold|lld|mold>`
The new option is `linker` and lets the user specify the argument to
the`-fuse_ld=` linker flag directly. The supported options are:

- `default`: No change, typically uses GNU ld (bfd) unless the user or
  distro picked a different default `/usr/bin/ld`.
- `bfd`: GNU ld from binutils
- `gold`: GNU gold from binutils
- `lld`: lld from LLVM
- `mold`: mold, an extremely fast modern linker, not (yet) intended for
  use in production but great for development speed. Provided by distro
  `mold` package or needs to be compiled from source and installed to
  `/usr` otherwise.

Removes the `use_lld=yes` option, and make lld actually usable with GCC
too.

Not all the above are compatible or recommend for LTO, we recommend
using GNU ld with GCC LTO, or lld with LLVM ThinLTO.
2022-07-22 01:00:35 +02:00
Riteo a21f8b7c13 Improve `linuxbsd` headless building, cleanup build scripts
Now the `linuxbsd` platform can be built headlessly (e.g. without X11
development libraries).

I also cleaned up some weird (old?) usages of the `env` variable which
seem to make no difference and are used nowhere else.
2022-07-20 19:48:35 +02:00
Riteo f035e7844f Remove `-pipe` from `LINKFLAGS`
For some reason this fixes the CI from going OOM.
2022-07-20 19:04:31 +02:00
bruvzg 7c005ba723
Improve DisplayServer.window_set_current_screen
Prevent unnecessary fullscreen toggle animation on macOS, when screen is not changed
Fix window position on Linux/X11
2022-07-19 12:26:11 +03:00
kobewi d2900429e8 Add static methods for creating Image and ImageTexture 2022-07-08 13:40:47 +02:00
bruvzg a194043ea8
Check if GL manager exist to prevent crash when using multithreaded renderer with Vulkan. 2022-07-06 09:56:47 +03:00
Rémi Verschelde 344b42703b
Merge pull request #62212 from hansemro/eraser-detect-4
Add inversion/eraser-end property for tablet pens
2022-07-04 21:48:19 +02:00
Hansem Ro 6dcc9d1131 [macOS, Windows, X11] Add stylus inverted/eraser support to
InputEventMouseMotion event
2022-07-04 10:36:53 -07:00
lawnjelly b221eab426 Variant memory pools
Memory pools via PagedAllocator for Transform2D, Transform3D, Basis and AABB.
2022-07-04 12:01:46 +01:00
Jan Haller d38d76d039 Fix exit code of --help and --version, and test them in CI
Corrects prior regression which caused ERROR output and exit code of 1.
2022-07-02 01:17:35 +02:00
Wilson E. Alvarez aadf831a67 Properly check for fullscreen toggle made through the Window Manager
Fixes #40007.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2022-06-30 12:14:46 +02:00
gregcsokas 42e619c01e Adding function key support from F17 to F35
OSX supports everything by default,
Linux is also capable of supporting every function key,
Windows as I know support only up to F24
2022-06-16 19:38:21 +02:00
bruvzg e00571b194
Add readable export errors. 2022-06-08 17:55:46 +03:00
bruvzg 40b3be7912
Remove mouse events that closed the popup from queue, to fix pop-up reopening. 2022-06-02 08:35:27 +03:00
Fabio Alessandrelli 9c2b5ae5ce [Editor] LinuxBSD export reports Linux as OS name.
This is in line with what's reported by the `OS` class on GNU/Linux, and
is required by the extension exporter to identify the correct library.

For BSD, we should either finish splitting the platform (into
platform/bsd) or register a separate exporter with OS name BSD and
proper templates detection.
2022-05-24 12:01:34 +02:00
reduz 45af29da80 Add a new HashSet template
* Intended to replace RBSet in most cases.
* Optimized for iteration speed
2022-05-20 22:40:38 +02:00
reduz 746dddc067 Replace most uses of Map by HashMap
* Map is unnecessary and inefficient in almost every case.
* Replaced by the new HashMap.
* Renamed Map to RBMap and Set to RBSet for cases that still make sense
  (order matters) but use is discouraged.

There were very few cases where replacing by HashMap was undesired because
keeping the key order was intended.
I tried to keep those (as RBMap) as much as possible, but might have missed
some. Review appreciated!
2022-05-16 10:37:48 +02:00
clayjohn 652adcd5bf Basic 3D rendering 2022-05-12 10:37:27 -07:00
Rémi Verschelde c366f8d2d4 Crash handler: Use `print_error` to include backtrace in logs 2022-05-05 12:22:56 +02:00
Marcel Admiraal c893302ca1 Read and store joypad events in a separate thread on x11 platform 2022-05-05 07:51:54 +02:00
Hugo Locurcio 180e5d3028
Remove `RES` and `REF` typedefs in favor of spelled out `Ref<>`
These typedefs don't save much typing compared to the full `Ref<Resource>`
and `Ref<RefCounted>`, yet they sometimes introduce confusion among
new contributors.
2022-05-03 01:43:50 +02:00
Rémi Verschelde c273ddc3ee Style: Partially apply clang-tidy's `cppcoreguidelines-pro-type-member-init`
Didn't commit all the changes where it wants to initialize a struct
with `{}`. Should be reviewed in a separate PR.

Option `IgnoreArrays` enabled for now to be conservative, can be
disabled to see if it proposes more useful changes.

Also fixed manually a handful of other missing initializations / moved
some from constructors.
2022-05-02 16:28:25 +02:00
bruvzg 652f78785b
[Linux] Disable speech-dispatcher, pulse audio and udev wrapper builds, when library is not found. 2022-04-28 18:13:34 +03:00
bruvzg 6ab672d1ef Implement text-to-speech support on Android, iOS, HTML5, Linux, macOS and Windows.
Implement TextServer word break method.
2022-04-28 14:35:41 +03:00
Rémi Verschelde 504708ae21
Merge pull request #56093 from bruvzg/pck_section_load
Improve embedded PCK loading and exporting.
2022-04-27 14:29:21 +02:00
Rémi Verschelde 8dfa12cae7
Merge pull request #59979 from bruvzg/cpp_check2 2022-04-27 10:08:26 +02:00
Rémi Verschelde a300fb6665
Merge pull request #60523 from akien-mga/linux-pkgconfig-nixos 2022-04-27 09:41:58 +02:00
Rémi Verschelde e89fc52ec6
Merge pull request #58272 from bruvzg/x11_backup_screen_info 2022-04-27 09:34:25 +02:00
Rémi Verschelde 07ad066420 Linux: Use pkg-config for alsa, libudev and GL too
It's not needed on most distros as those are found in standard lib
and include paths, but on NixOS they're all in non-standard prefixes,
so we need to rely on information provided by pkg-config.

Fixes #59913.

Co-authored-by: David Lewis <davidalewis00@gmail.com>
2022-04-26 09:37:28 +02:00
bruvzg c0cc41d6c1
Improve embedded PCK loading and exporting.
Windows export process:
  Limit size of executable with embedded PCK to 4 GB.
  Use "rcedit" before embedding PCK.
  Capture and process "rcedit" errors.

Windows, Linux:
  Add support for PCK loading from executable "pck" section.
2022-04-20 11:09:59 +03:00
bruvzg de4c97758a
Fix more issues found by cppcheck. 2022-04-20 10:34:00 +03:00
bruvzg 8b0761d1fd
Fix sub-menu keyboard navigation. 2022-04-13 09:58:38 +03:00
bruvzg 4bf99f4af2 Narrow FileAccess scope to prevent deadlocks. 2022-04-12 10:54:39 +03:00
bruvzg 9381acb6a4
Make FileAccess and DirAccess classes reference counted. 2022-04-11 13:28:51 +03:00
bruvzg f851c4aa33
Fix some issues found by cppcheck. 2022-04-06 14:34:37 +03:00
Rémi Verschelde b79721fede
Merge pull request #59908 from bruvzg/fix_popup_close_race
Fix a possible race condition on popup close, that might cause multiple deletions of the same list item.
2022-04-06 08:35:56 +02:00
Rémi Verschelde 77843355a0 CI: Update black formatter and apply changes 2022-04-05 17:43:12 +02:00
bruvzg daa42e0e50
Fix a possible race condition on popup close, that might cause multiple deletions of the same list item. 2022-04-05 12:44:29 +03:00
Rémi Verschelde f8ab79e68a Zero initialize all pointer class and struct members
This prevents the pitfall of UB when checking if they have been
assigned something valid by comparing to nullptr.
2022-04-04 19:49:50 +02:00
bruvzg ba0317be04
Add CI build with clang sanitizers, increase stack size to 30 MB for builds with sanitizers. 2022-04-01 13:15:35 +03:00
ConteZero 2eb36b8bdb Fix X11 is_window_maximized 2022-03-31 23:21:32 +02:00
Markus Sauermann 0494e024d8 Rename warp mouse functions to warp_mouse 2022-03-27 14:12:01 +02:00
Aaron Franke 13392a96e9
Generate export template file names instead of having a fixed set 2022-03-22 10:16:03 -05:00
Aaron Franke ac3ecec58e
Change extension for Linux 32-bit x86 exports to x86_32 2022-03-21 14:56:27 -05:00
Aaron Franke f301451fa3
Move extension logic to EditorExportPlatformLinuxBSD 2022-03-21 12:50:31 -05:00
Aaron Franke e5e697564d
Move fixup_embedded_pck to EditorExportPlatform classes 2022-03-20 21:04:22 -05:00
bruvzg f0315c28a8
[Export] Add "export console script" option for Linux, macOS, and Windows exports. 2022-03-14 17:19:18 +02:00
Rémi Verschelde 768f9422bc Convert uses of `DirAccess *` to `DirAccessRef` to prevent memleaks
`DirAccess *` needs to be deleted manually, and this is often forgotten
especially when doing early returns with `ERR_FAIL_COND`.
`DirAccessRef` is deleted automatically when it goes out of scope.

Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
2022-03-11 09:13:11 +01:00
Rémi Verschelde 7866c98479
Merge pull request #58335 from maiself/fix-directory-delete-linux 2022-03-10 21:29:40 +01:00
Rémi Verschelde 3d7f155586 Remove unused Bullet module and thirdparty code
It has been disabled in `master` since one year (#45852) and our plan
is for Bullet, and possibly other thirdparty physics engines, to be
implemented via GDExtension so that they can be selected by the users
who need them.
2022-03-09 21:45:47 +01:00
MmAaXx500 eda3180395
Add missing header for headless builds 2022-03-09 09:58:20 +01:00
bruvzg 3cc37342c4
[X11] Do not try to focus unmapped window. 2022-03-08 11:46:44 +02:00
Haoyu Qiu 29e45d4fa0 Fix X11 memory leak after drag & drop file into the editor 2022-03-04 17:50:24 +08:00
bruvzg 74ff5921d6 Improve popup window handling.
Add window FLAG_POPUP and a platform specific routines to control popup auto-hiding and event forwarding.
2022-02-25 09:33:27 +02:00
Mai Lavelle dfdc1c1642 Fix deleting of directories on Linux
Trailing slash of directories was mishandled, and incorrect derived paths
were formed. Stripping the slash fixes this.
2022-02-20 08:38:59 -05:00
bruvzg 372e24265a
[Linux/X11] Fallback to the X server root window to get screen rects, if Xinerama is not available. 2022-02-18 13:29:10 +02:00
Rémi Verschelde b8b4580448
Style: Cleanup single-line blocks, semicolons, dead code
Remove currently unused implementation of TextureBasisU, could be re-added
later on if needed and ported.
2022-02-16 14:06:29 +01:00
Hugo Locurcio ee7cd9a3a1
Add an `OS.get_processor_name()` method
This method can be used to get the CPU model name.
It can be used in conjunction with
`RenderingServer.get_video_adapter_name()` and
`RenderingServer.get_video_adapter_vendor()` for annotating benchmarks
and automatic graphics quality configuration.
2022-02-15 20:55:53 +01:00
Hendrik Brucker b396fd4eef Improve compilation speed (forward declarations/includes cleanup) 2022-02-12 02:46:22 +01:00
Rémi Verschelde 1bdb82c64e
Fix typos with codespell
Using codespell 2.2-dev from current git.

Added `misc/scripts/codespell.sh` to make it easier to run it once in a
while and update the skip and ignore lists.
2022-02-10 12:30:19 +01:00
Rémi Verschelde 90162851a7
Core: Move generated `VERSION_HASH` to a `.cpp` file
This lets us have its definition in `core/version.h` and avoid
rebuilding a handful of files every time the commit hash changes.
2022-02-09 09:20:17 +01:00
Rémi Verschelde 2a39a1c221
Merge pull request #57612 from maiself/improve-gamepad-detection 2022-02-08 15:22:31 +01:00
bruvzg 4fcc35bdfa
[X11] Fix decoration reset when returning from fullscreen mode. 2022-02-08 11:01:24 +02:00
jordi 635da44ef8 Snap refresh rate to hundreths place on X11 2022-02-06 13:24:57 +01:00
Rémi Verschelde 225a3b2545
Merge pull request #57341 from bruvzg/win_multiwin_fs 2022-02-04 13:28:56 +01:00
Rémi Verschelde 2e320dcf87
Merge pull request #57617 from bruvzg/char_cleanup 2022-02-04 13:06:38 +01:00
Rémi Verschelde d235c1bb19
Merge pull request #57335 from jordigcs/display-refresh-rate 2022-02-04 11:51:07 +01:00
bruvzg f4ea9cd9f3
[Windows] Add WS_BORDER flag to windows in WINDOW_MODE_FULLSCREEN mode to allow multi-window interface in full-screen.
[Windows] Add WINDOW_MODE_EXCLUSIVE_FULLSCREEN without WS_BORDER flag enabled (no multi-window support).
2022-02-04 12:08:46 +02:00
bruvzg 244db37508
Cleanup and move char functions to the `char_utils.h` header. 2022-02-04 11:35:01 +02:00
Mai Lavelle b966ca6167 Improve detection of gamepads on Linux
Some devices (Nintendo Switch Right Joy-Con) report only a right stick.
2022-02-03 22:56:43 -05:00
jordi 54dec44dba Add screen_get_refresh_rate to DisplayServer 2022-02-03 21:50:32 -06:00
Rémi Verschelde ea12094f19
Merge pull request #57497 from Geometror/fix-mouse-mode 2022-02-01 14:46:30 +01:00
Hendrik Brucker c058361a23 Fix captured mouse mode 2022-02-01 03:49:51 +01:00
Rémi Verschelde f14b1441e7
Merge pull request #56548 from madmiraal/fix-53894 2022-01-31 18:08:48 +01:00
Nathan Franke 8a0a3accee
simplify formatting scripts, add a clang-tidy script, and run clang-tidy 2022-01-29 04:41:03 -06:00
Rémi Verschelde 4b36b6e92a
Merge pull request #56785 from bruvzg/nat_handles_4 2022-01-27 12:12:34 +01:00
Haoyu Qiu 8be49838b3 Fix memory leak when move to trash fails on Linux 2022-01-25 18:38:13 +08:00
Rémi Verschelde 57a057f7ff
Merge pull request #56754 from madmiraal/fix-45592 2022-01-24 10:05:42 +01:00
Omar Polo bd448e5535 Rename or refactor macros to avoid leading underscores
These are not used consistently and some can conflict with
system-specific defines.  While here, also delete some unused macros.
2022-01-20 20:29:15 +01:00
bruvzg d62ca0c9c0 Window management improvements.
[macOS] Fix transient windows not working in the full-screen mode.
[macOS] Fix moving transient windows to the other screen than parent window.
[macOS] Fix popup menu switch on hover.
[macOS] Use content origin rect for windows position (to ensure `DS.mouse_get_position` is equal to `DS.window_get_position` + mouse position from the input events).
[macOS] Fix incorrect input coordinates, when external display with different scaling in connected/disconnected.
[macOS/Windows] Fix moving fullscreen windows between the screens.
Add auto refocusing of the parent window, when the focused transient window is closed.
Remove redundant `DS.mouse_get_absolute_position` function (returns mouse position in the screen coordinates, same as `DS.mouse_get_position`).
2022-01-18 11:47:03 +02:00
Marcel Admiraal f41c72c538 Fix Actions mapped to triggers not using the full range 2022-01-14 15:36:20 +00:00
bruvzg 89f37d4105
Add support for getting native display, window, and view handles. 2022-01-14 13:36:32 +02:00
luz paz 858bcd5058 Fix various typos
Found via `codespell -q 3 -S ./thirdparty,*.po,./DONORS.md -L ackward,ang,ans,ba,beng,cas,childs,childrens,dof,doubleclick,expct,fave,findn,gird,hist,inh,inout,leapyear,lod,nd,numer,ois,ony,paket,ro,seeked,sinc,switchs,te,uint,varn,vew`
2022-01-13 23:20:01 -05:00
Marcel Admiraal 5250cdd150 Use mouse event relative motion to calculate mouse velocity 2022-01-13 15:23:21 +00:00
Rémi Verschelde 585231a172
Merge pull request #56492 from akien-mga/remove-author-docstrings 2022-01-12 15:24:17 +01:00
clayjohn 99064d57db New OpenGL batching canvas renderer 2022-01-11 22:26:18 -08:00
Rémi Verschelde 46624388d4
Merge pull request #56322 from madmiraal/fix-42450 2022-01-11 11:33:59 +01:00
bruvzg c69e0d16bc
Fix multiple missing UTF-8 decoding. 2022-01-06 14:35:22 +02:00
Marcel Admiraal ac1e7e10eb Set window to focused when created 2022-01-06 08:04:59 +00:00
Rémi Verschelde ba2bdc478b
Style: Remove inconsistently used `@author` docstrings
Each file in Godot has had multiple contributors who co-authored it over the
years, and the information of who was the original person to create that file
is not very relevant, especially when used so inconsistently.

`git blame` is a much better way to know who initially authored or later
modified a given chunk of code, and most IDEs now have good integration to
show this information.
2022-01-04 20:42:50 +01:00
Rémi Verschelde 1d6f8ad837
Merge pull request #56438 from madmiraal/fix-56428
Fix tablet tilt values returning bad values
2022-01-03 23:48:46 +01:00
Rémi Verschelde fe52458154
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
Marcel Admiraal 75a58360fd Fix tablet tilt values returning bad values 2022-01-02 12:15:14 +00:00
Marcel Admiraal 3105d9b1f3 Rename speed to velocity when it's a directional Vector 2021-12-29 15:35:26 +00:00
Rémi Verschelde 51c5fa48ab
Merge pull request #56039 from Rubonnek/update-detect-prime-formatting-master 2021-12-20 10:28:16 +01:00
Bastiaan Olij d08b28aeb0 Fix initialising of gl_manager and checking gl_manager and context_vulkan preventing crash issues. 2021-12-18 12:21:16 +11:00
Wilson E. Alvarez 3c198aecaa
Sync detect_prime_x11.cpp formatting changes from 3.x branch 2021-12-17 16:08:13 -05:00
Aaron Franke 368c0bc0ac
Misc build system fixes 2021-12-10 12:14:27 -06:00
Nathan Franke 49403cbfa0
Replace String comparisons with "", String() to is_empty()
Also:
- Adds two stress tests to test_string.h
- Changes to .empty() on std::strings
2021-12-09 04:48:38 -06:00
Lightning_A e078f970db Rename `remove()` to `remove_at()` when removing by index 2021-11-23 18:58:57 -07:00
Aaron Franke 3c0fdcc8ac
Use "enum class" for input enums 2021-11-12 15:37:54 -06:00
Rémi Verschelde 2beaae4b6f
String: Remove `erase` method, bindings can't mutate String 2021-11-11 11:23:32 +01:00
Rémi Verschelde 43ff899fa7
Merge pull request #54315 from nekomatata/x11-key-events-log 2021-11-09 00:03:12 +01:00
PouleyKetchoupp 4215d694f8 Fix BadWindow X11 errors when a window is closed while processing struts
A window can be closed on the server side while processing results from
_NET_CLIENT_LIST, which causes BadWindow fatal errors by default in
XGetWindowProperty.

The only way to safely catch this case is to set an error handler to
ignore BadWindow errors while these commands are processed.
2021-11-04 09:47:18 -07:00
Daniel Kolesa 3a84a64d2f Add support for PowerPC family 2021-11-01 22:25:53 +01:00
Rémi Verschelde a000186de4
Merge pull request #41565 from nekomatata/x11-usable-screen-size 2021-11-01 18:11:57 +01:00
Clay John 8a10bb7d0d
Use OpenGL 3.3 core profile instead of compatibility profile
- Rename OpenGL to GLES3 in the source code per community feedback.
  - The renderer is still exposed as "OpenGL 3" to the user.
- Hide renderer selection dropdown until OpenGL support is more mature.
  - The renderer can still be changed in the Project Settings or using
    the `--rendering-driver opengl` command line argument.
- Remove commented out exporter code.
- Remove some OpenGL/DisplayServer-related debugging prints.
2021-10-31 15:56:45 +01:00
Hugo Locurcio ce97ddbcb1
Rename GLES2 driver to OpenGL to prepare for the upgrade to GLES3
- Use lowercase driver names for the `--rendering-driver`
  command line argument.
2021-10-30 02:05:49 +02:00
lawnjelly e3491a3744
Add GLES2 2D renderer + Linux display manager
First implementation with Linux display manager.

- Add single-threaded mode for EditorResourcePreview (needed for OpenGL).

Co-authored-by: clayjohn <claynjohn@gmail.com>
Co-authored-by: Fabio Alessandrelli <fabio.alessandrelli@gmail.com>
2021-10-30 02:05:48 +02:00
PouleyKetchoupp 85a934954d Implemented screen_get_usable_rect for X11 Display Server
Helps with fixing issues with scrolling popups not respecting screen
decorations on the display server side.

Reproduction steps for a simple use case:
- Start the editor project list
- Open the language selection popup

Support for multi-screen:
Handling decorations is supported in different ways depending on the
information the window manager provides:
- _GTK_WORKAREAS is used when available from the WM to get accurate rect
for the different screens directly (available on Gnome).
- Alternatively, strut information is used to calculate available space
for a given desktop manually (XFCE, KDE).
- As last resort _NET_WORKAREA is used. It provides one full rect for all
screens, which doesn't handle decorations on the secondary screen in all
cases.
2021-10-29 11:56:08 -07:00
Rémi Verschelde 9fb9b99cab
Merge pull request #42117 from nekomatata/x11-get-window-screen
Fix window_get_current_screen for X11 display server
2021-10-28 20:57:24 +02:00
PouleyKetchoupp b34480b645 Fix window_get_current_screen for X11 display server
This method used to check which screen contains the top-left corner of
the window (and default to the first screen in case none is found),
which is not accurate in some cases.

Now the area of overlap with each screen is calculated, so we can get
the best candidate based on the window's position.

This makes window_get_current_screen consistent with Windows platform,
and fixes an issue where popups appear on the main screen when the main
window is slightly moved outside of the desktop on the top or left.
2021-10-28 10:26:05 -07:00
Rémi Verschelde 3a6be64c12
clang-format: Various fixes to comments alignment from `clang-format` 13
All reviewed manually and occasionally rewritten to avoid bad auto formatting.
2021-10-28 15:43:36 +02:00
Rémi Verschelde 3b11e33a09
clang-format: Disable alignment of operands, too unreliable
Sets `AlignOperands` to `DontAlign`.

`clang-format` developers seem to mostly care about space-based indentation and
every other version of clang-format breaks the bad mismatch of tabs and spaces
that it seems to use for operand alignment. So it's better without, so that it
respects our two-tabs `ContinuationIndentWidth`.
2021-10-28 15:19:35 +02:00
PouleyKetchoupp ba96fc6a4d Fix input events random delay on X11
The new system based on a thread gathering events from the X11 server
was causing delays in some scenarios where some events have just been
missed at the time of processing and we're waiting for a whole frame to
check them again.

Solved by flushing again and checking for pending events at the
beginning of the process loop, in addition to events already gathered
on the event thread.
2021-10-27 15:24:09 -07:00
PouleyKetchoupp 0b17d4e57d Add KeyPress & KeyRelease events to X11 debug events logging
Compiled out by default, just used for debugging local builds.
2021-10-27 10:08:09 -07:00
Rémi Verschelde b2ab5cb504
Merge pull request #54045 from ConteZero/primary_clipboard_linux_fix_warning 2021-10-23 19:13:34 +02:00
ConteZero 8c48b4a7e0 Fix primary clipboard warning 2021-10-23 15:50:01 +02:00
Aaron Franke 474d0f58f5
Add support for the RISC-V architecture
Supports RV64GC (RISC-V 64-bit with general-purpose and compressed-instruction extensions)
2021-10-22 12:51:10 -05:00
Rémi Verschelde 8748247d6f
Merge pull request #53702 from ConteZero/primary_clipboard_linux 2021-10-20 16:35:04 +02:00
ConteZero 838c9d37b4 Added primary clipboard for Linux 2021-10-18 14:01:06 +02:00
Rémi Verschelde 1efe7093be
Merge pull request #53833 from akien-mga/remove-webm-support 2021-10-15 17:33:06 +02:00
Rémi Verschelde ae74e78909
Remove WebM support (and deps libvpx and opus)
We've had many issues with WebM support and specifically the libvpx library
over the years, mostly due to its poor integration in Godot's buildsystem,
but without anyone really interested in improving this state.

With the new GDExtensions in Godot 4.0, we intend to move video decoding to
first-party extensions, and this would likely be done using something like
libvlc to expose more codecs.

Removing the `webm` module means we can remove libsimplewebm, libvpx and
opus, which we were only used for that purpose. Both libvpx and opus were
fairly complex pieces of the buildsystem, so this is a nice cleanup.

This also removes the compile-time dependency on `yasm`.

Fixes lots of compilation or non-working WebM issues which will be linked
in the PR.
2021-10-15 12:09:11 +02:00
Rémi Verschelde cd21cc683a
SCons: Set `DEBUG_ENABLED` and `DEV_ENABLED` in SConstruct
They're the same for all platforms so they don't need to be repeated in all
platform definitions.
2021-10-15 10:26:58 +02:00
Rémi Verschelde e2dfb656f4
SCons: Add `DEV_ENABLED` defines for `target=debug` builds
This will allow adding developer checks which will be fully compiled out in
user builds, unlike `DEBUG_ENABLED` which is included in debug tempates and
the editor builds.

This define is not used yet, but we'll soon add code that uses it, and change
some existing `DEBUG_ENABLED` checks to be performed only in dev builds.

Related to godotengine/godot-proposals#3371.
2021-10-14 12:01:28 +02:00
Mark Riedesel f0dd693a08 free dbus errors when inhibiting freedesktop screensaver (prevents small memory leak) 2021-10-12 21:11:56 -04:00
Rémi Verschelde 1f192c43b0
Merge pull request #51429 from omar-polo/fix-basename 2021-10-09 10:34:21 +02:00
Omar Polo a3384b7461 use .get_file() instead of basename(3)
On OpenBSD the compiler complains that calling basename(3) would lose
const qualifier.  basename(3) is defined as

	char *basename(char *);

and can, accorgindly to the POSIX.1, modify the passed string.

This uses the .get_file() method.  The check is necessary because
file_name could be a directory, in which case .get_file() would return
an empty string.  The .get_base_dir().get_file() idiom is already used.

The usage of get_file() and the check were suggested by theraot, thanks!
2021-10-08 20:10:26 +02:00
Rémi Verschelde a7011fa294
Merge pull request #52684 from Frixuu/master 2021-10-01 11:53:01 +02:00
Lightning_A c63b18507d Use range iterators for `Map` 2021-09-30 15:09:12 -06:00
Frixuu 650e63a7ca Allow for mapping keycodes to current layout 2021-09-21 00:03:02 +02:00
Hugo Locurcio 7486fa9b16
Mention that rebooting is required after updating graphics driver on Linux 2021-09-15 18:34:10 +02:00
Rémi Verschelde 13d2928490
Merge pull request #52282 from Calinou/scons-improve-linuxbsd-build-messages
Improve messages when compiling for Linux/*BSD
2021-09-15 12:50:39 +02:00
Hugo Locurcio 065c79f0df
Re-enable building position-independent executables on Linux/*BSD
This provides better security at the cost of having misleading
binary icons on some file managers.

Now that recent Linux distributions no longer allow executing
binaries by double-clicking them in a file manager (even if the
binary is set to be executable), the usability cost of PIE is lowered.
You have to use a terminal or install a `.desktop` file nowadays.
2021-09-15 01:05:27 +02:00
Hugo Locurcio 1513aa9b26
Add logo attribution for Android, HTML5 and Linux platform icons
- Tweak the Android platform logo to remove the Android wordmark,
  as it can't be used without explicit permission.
2021-09-11 19:34:10 +02:00
Hugo Locurcio 2daaf0fdc3
Make platform feature tag names lowercase
Feature tag names are still case-sensitive, but this makes built-in
feature tags more consistent.

- `Windows` -> `windows`
- `OSX` -> `osx`
- `LinuxBSD` -> `linuxbsd`
- `Android` -> `android`
- `iOS` -> `ios`
- `HTML5` -> `html5`
- `JavaScript` -> `javascript`
- `UWP` -> `uwp`
2021-08-31 20:34:44 +02:00
Hugo Locurcio 4c5deea83e
Improve messages when compiling for Linux/*BSD
- Don't display messages when enabling PulseAudio/ALSA/D-Bus/udev
  as these become noisy in incremental builds.
- Improve warning and error messages to be more descriptive
  and consistent.
2021-08-31 16:21:42 +02:00
Hugo Locurcio 3db8359324
Merge pull request #47829 from Calinou/improve-crash-handler-display
Improve crash handler message display
2021-08-25 08:03:10 +02:00
ne0fhyk 3a00ff1cce Add partial support for Android scoped storage.
This is done by providing API access to app specific directories which don't have any limitations and allows us to bump the target sdk version to 30.
In addition, we're also bumping the min sdk version to 19 as version 18 is no longer supported by Google Play Services and only account of 0.3% of Android devices.
2021-08-16 23:11:56 -07:00
Pedro J. Estébanez dc187324be Add input buffering framework
Input buffering is implicitly used by event accumulation, but this commit makes it more generic so it can be enabled for other uses.

For desktop OSs it's currently not feasible given main and UI threads are the same).
2021-08-13 11:19:19 +02:00
Pedro J. Estébanez 7c864d41c9 Improve input event accumulation
- API has been simplified: all events now go through `parse_input_event()`. Whether they are accumulated or not depends on the `use_accumulated_input` flag.
- Event accumulation is now thread-safe (it was not needed so far, but it prepares the ground for the following changes).
- Touch drag events now support accumulation.
2021-08-13 11:19:19 +02:00
Pedro J. Estébanez 7b7e17a626 Upgrade Vulkan memory allocator 2021-08-13 00:05:41 +02:00
bruvzg d7957a2a20 Use "volk" instead of statically linked Vulkan loader. 2021-08-12 14:25:15 +03:00
Aaron Franke fa3a32a2d6
Use Key enum instead of plain integers 2021-08-10 16:26:55 -05:00
luz paz 3564c16cb8
Fix various typos with codespell
Found via `codespell -q 3 -S ./thirdparty,*.po,./DONORS.md -L ackward,ang,ans,ba,beng,cas,childs,childrens,dof,doubleclick,fave,findn,hist,inout,leapyear,lod,nd,numer,ois,ony,paket,seeked,sinc,switchs,te,uint`
2021-07-25 11:21:51 +02:00
bruvzg 618eb27e8b Move `alert` function from `DisplayServer` to `OS`. 2021-07-22 21:50:35 +03:00
PouleyKetchoupp e030360b88 Fix popup closing immediately after showing on some Linux WMs
When a popup is going to be closed, switch focus to the parent only if
the popup is still being focused.

Fixes some cases with specific WMs where due to the order of events, a
new popup could be immediately unfocused because a previously opened
and closed popup is switching focus to the parent.
2021-07-21 12:28:39 -07:00
Hendrik Brucker 38578a8095 Modernize Display server to use override keyword 2021-07-16 21:39:13 +02:00
joe b627fcd2cd Fix for ambiguous variant error during build on Debian 10(Buster) using clang v7 2021-07-13 03:44:03 +01:00
Hugo Locurcio a2d5f191d8
Merge pull request #48622 from Geometror/reimplement-disableable-vsync 2021-07-10 01:02:23 +02:00
likeich 0314e04939 Fix linux use after free
Fixes #50032
2021-07-08 22:34:07 -04:00
Hendrik Brucker 043ae91560 Restructure and reimplement vsync options
-Add a v-sync mode setting which allows to choose between DISABLED, ON, ADAPTIVE and MAILBOX
-Removed the V-Sync via Compositor option
2021-07-06 16:34:26 +02:00
Niklas Higi 0c83a23ab5
Add "Keep screen on" feature to `DisplayServerX11` 2021-06-20 21:57:33 +02:00
Aaron Franke 0ce49800ac
Use mouse and joypad enums instead of plain integers
Also MIDIMessage
2021-06-20 11:54:24 -04:00
Aaron Franke e919d894f8
Move many input enums to their own file 2021-06-20 11:53:01 -04:00
Lightning_A e28fd07b2b Rename `instance()`->`instantiate()` when it's a verb 2021-06-19 20:49:18 -06:00
Hugo Locurcio 8556dd1bef
Improve crash handler message display
- State the Godot version and full hash in the backtrace.
- Add decoration around the crash backtrace, both to make it stand out
  from other messages and help the user figure out what they should copy.
2021-06-17 20:05:16 +02:00
Rémi Verschelde ac73059b56
Merge pull request #49123 from aaronfranke/it-is-time
Add a Time singleton
2021-06-12 22:55:25 +02:00
Rémi Verschelde 8d4046929c
Merge pull request #49511 from akien-mga/core-diraccess-fileaccess-io
Core: Move DirAccess and FileAccess to `core/io`
2021-06-11 16:51:10 +02:00
Rémi Verschelde 6b0183ec89
Merge pull request #49279 from Calinou/rename-string-is-abs-path-method
Rename `String.is_abs_path()` to `String.is_absolute_path()`
2021-06-11 15:58:16 +02:00
Aaron Franke f64fea1b23
Add Time singleton 2021-06-11 09:32:39 -04:00
Rémi Verschelde 9e328bb5b7
Core: Move DirAccess and FileAccess to `core/io`
File handling APIs are typically considered part of I/O, and we did have most
`FileAccess` implementations in `core/io` already.
2021-06-11 14:52:39 +02:00
Aaron Franke 98aa3b669e
Add MOUSE_MODE_CONFINED_HIDDEN
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2021-06-03 11:44:28 -04:00
Hugo Locurcio 5ea1c75d63
Rename `String.is_abs_path()` to `String.is_absolute_path()`
This is more consistent with `NodePath.is_absolute()`.
2021-06-03 16:00:06 +02:00
Fabio Alessandrelli 8594613f94 LinuxBSD now compiles without vulkan/x11. 2021-06-01 16:27:54 +02:00
Omar Polo 3bff838cee add OpenBSD to OS_LinuxBSD::get_name() 2021-05-21 21:35:31 +02:00
Hugo Locurcio 011a99316a
Only allow absolute paths in XDG environment variables
The XDG Base Directory specification does not allow using relative paths
(which broke things in Godot anyway). If a relative path is detected,
it should be ignored.
2021-05-20 18:37:28 +02:00
Rémi Verschelde 6c367f8e0d
Merge pull request #48168 from LightningAA/control-to-ctrl-4.0 2021-05-17 17:38:02 +02:00
Pedro J. Estébanez 469fa47e06
Make all file access 64-bit (uint64_t)
This changes the types of a big number of variables.

General rules:
- Using `uint64_t` in general. We also considered `int64_t` but eventually
  settled on keeping it unsigned, which is also closer to what one would expect
  with `size_t`/`off_t`.
- We only keep `int64_t` for `seek_end` (takes a negative offset from the end)
  and for the `Variant` bindings, since `Variant::INT` is `int64_t`. This means
  we only need to guard against passing negative values in `core_bind.cpp`.
- Using `uint32_t` integers for concepts not needing such a huge range, like
  pages, blocks, etc.

In addition:
- Improve usage of integer types in some related places; namely, `DirAccess`,
  core binds.

Note:
- On Windows, `_ftelli64` reports invalid values when using 32-bit MinGW with
  version < 8.0. This was an upstream bug fixed in 8.0. It breaks support for
  big files on 32-bit Windows builds made with that toolchain. We might add a
  workaround.

Fixes #44363.
Fixes godotengine/godot-proposals#400.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2021-05-17 15:06:19 +02:00
Hugo Locurcio 064ca9adae
Remove debugging prints in the Linux DisplayServer
Some Vulkan debugging prints were also changed to be printed only
in verbose mode.
2021-05-08 19:07:50 +02:00
Lightning_A 97fecd1b69 Rename "Control" key to "Ctrl" and add "_pressed" suffix to all InputEventWithModifiers properties/methods 2021-05-07 14:00:50 -06:00
Rémi Verschelde dfbabcdaeb
Merge pull request #48453 from JFonS/improve_raycast_module_scsub
Port changes to the "raycast" module build files from 3.x
2021-05-04 17:55:25 +02:00
jfons 575543ce53 Port changes to the "raycast" module build files from 3.x 2021-05-04 17:21:41 +02:00
Aaron Franke 0de9a7d803
Rename `doubleclick` to `double_click` 2021-05-04 04:38:08 -04:00
Rémi Verschelde aa15ad72ee
Linux: Remove use_static_cpp override on x86_32
After further testing it seems to work fine now when building binaries with GCC 5
on Ubuntu 16.04 (previously we were using GCC 9 on Ubuntu 14.04).

Follow-up to #45629.
2021-04-26 13:34:55 +02:00
bruvzg a79cc0d772
Fix macOS build with all sanitizers enabled. 2021-04-16 08:27:00 +03:00
Rafał Mikrut f827bcd2f3 Add more sanitizer flags to shows more bugs 2021-04-15 20:16:28 +02:00
Rémi Verschelde d83761ba80
Style: Apply clang-tidy's `readability-braces-around-statements` 2021-04-05 14:09:59 +02:00
Rémi Verschelde 9bbe51dc27
Style: Apply clang-tidy's `modernize-use-nullptr` 2021-04-05 14:05:07 +02:00
Marcel Admiraal fd30c36985 Rename Texture.get_data() to get_image() 2021-03-28 13:00:46 +01:00
Aaron Franke a5324787c8
Rename some more global enums (Key, Joy, MIDI) 2021-03-23 07:13:23 -04:00
Aaron Franke 10d7fccb54
Rename ButtonList enum and members to MouseButton 2021-03-23 07:13:23 -04:00
Rafał Mikrut 0b298d201e Allow to not optimize release build 2021-03-14 15:51:05 +01:00
Rémi Verschelde ae850177a3 Linux: Fix PRIME detection on Steam
To avoid trying to do PRIME detection on fake `libGL.so` as used by e.g.
Renderdoc or Primus, we skip detection if there's a `libGL.so` in
`LD_LIBRARY_PATH`... and our luck is that Steam defines it and includes
system paths too, thus the actual system `libGL`... 🤦

So if we detect Steam, we skip this check.

Co-authored-by: Hein-Pieter van Braam-Stewart <hp@tmm.cx>
2021-03-08 15:51:14 +01:00