Commit graph

1113 commits

Author SHA1 Message Date
Markus Sauermann
9cea653457 Fix mouseleave event after drag and drop in different Windows
When dropping in a different window, it is necessary to start tracking
the WM_MOUSELEAVE event again.
2022-11-01 18:58:46 +01:00
Markus Sauermann
88feacdad5 Fix mouse offset for unfocused popups
On Windows, the mouse was offset, when unfocused popups were used,
like the Editor menu.
2022-11-01 00:04:14 +01: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
Clay John
282e50ac88
Merge pull request #67903 from Sauermann/fix-startup-windows-mouse-exit-event
Fix differences between Windows and linuxbsd Display Server
2022-10-28 11:20:36 -07:00
Markus Sauermann
4bd601d82a Fix differences between Windows and linuxbsd Display Server
Fix that Windows receive WINDOW_EVENT_MOUSE_EXIT on startup.

When moving the mouse cursor from one window to a different one, make sure that the first window receives the WINDOW_EVENT_MOUSE_EXIT event before the second window receives the WINDOW_EVENT_MOUSE_ENTER event.

Send Mouse-Move events also for Windows, that are currently not focused.

For determining the currently hovered window, consider not just the currently focused window, but also other windows.

Send mouse move events to focused window instead of hovered window.
2022-10-28 09:32:25 +02:00
zCubed3
e7091d07cd
Fix OS.get_video_adapter_driver_info crash 2022-10-27 15:45:21 -07: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
Clay John
021f524dfd
Merge pull request #67546 from clayjohn/DS-msg
Update the DisplayServer video driver error message to be more accurate and friendly
2022-10-21 16:57:35 -07: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
bruvzg
667a052ed8 Check if Vulkan context for the window exists before resizing it to avoid unnecessary error messages. 2022-10-17 17:26:57 +03:00
bruvzg
ad4cc8682b
[Windows] Fix GCC MinGW warnings. 2022-10-12 20:19:17 +03: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
6ad1a635ee Merge pull request #67242 from akien-mga/cleanup-unused-defines
Cleanup unused defines in platform code
2022-10-11 12:34:10 +02:00
Rémi Verschelde
a92c564a02 Cleanup unused defines in platform code 2022-10-11 11:52:41 +02:00
Pedro J. Estébanez
e14c5186e2 Fix newlines not honored in Windows console
This is relevant when building with `windows_subsystem=console`.
2022-10-11 10:09:50 +02:00
Rémi Verschelde
28f642097a Merge pull request #67183 from akien-mga/gcc-warnings-cleanup
SCons: Cleanup GCC warnings configuration
2022-10-10 17:42:36 +02:00
bruvzg
379df32a98
[Windows] Fix GCC MinGW warnings. 2022-10-10 17:43:49 +03: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
Pedro J. Estébanez
e821e9d2a2 Harmonize return values of window_create() in rendering drivers 2022-10-07 11:31:54 +02:00
Rémi Verschelde
6c58327c69 Merge pull request #66965 from bruvzg/win_llvm
[Windows] Fix LLVM MinGW build.
2022-10-06 08:57:29 +02:00
Rémi Verschelde
c2c9a582da Merge pull request #64815 from RandomShaper/default_cpu_count
Improve default `OS`'s CPU count getter
2022-10-06 08:55:51 +02:00
bruvzg
6afb2d0225
[Windows] Fix LLVM MinGW build. 2022-10-06 09:30:25 +03:00
Pedro J. Estébanez
6bf02c0162 Keep a single, portable implementation of OS::get_processor_count() 2022-10-05 20:10:47 +02:00
Rémi Verschelde
02e9e2d3c0 Merge pull request #66559 from zaevi/fix_ScrollContainer_touch_scroll
Fix ScrollContainer touch-scrolling not working.
2022-10-04 10:30:31 +02: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
Jiri Suchan
c5bd2f9dce ci: add Python static analysis check via mypy 2022-09-30 19:03:17 +07:00
Rémi Verschelde
f47979f087
Merge pull request #66242 from akien-mga/scons-unify-tools-target 2022-09-30 12:28:50 +02:00
Zae
186ca020b3 Fix ScrollContainer touch-scrolling not working. 2022-09-29 01:47:03 +08:00
Rémi Verschelde
0e53dd642c Fix MSVC warning C4706: assignment within conditional expression
Part of #66537.
2022-09-28 16:05:07 +02:00
bruvzg
4421378089
[Windows] Ignore excessive wintab mouse move events. 2022-09-28 10:12:04 +03: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
39be6695d1
Merge pull request #66295 from bruvzg/win_fix_wm_char_keysym
[Windows] Fix WM_CHAR processing code using Unicode char instead of Virtual key.
2022-09-24 22:59:44 +02:00
Rémi Verschelde
26e9145c26 SCons: Cleanup DEBUG, _DEBUG and NDEBUG defines
- `_DEBUG` is MSVC specific so it didn't make much sense to define for
  Android and iOS builds.
- iOS was the only platform to define `DEBUG`. We don't use it anywhere
  outside thirdparty code, which we usually don't intend to debug, so it
  seems better to be consistent with other platforms.
- Consistently define `NDEBUG` to disable assert behavior in both `release`
  and `release_debug` targets. This used to be set for `release` for all
  platforms, and `release_debug` for Android and iOS only.
- Due to the above, I removed the only use we made of `assert()` in Godot
  code, which was only implemented for Unix anyway, should have been
  `DEV_ENABLED`, and is in PoolAllocator which we don't actually use.
- The denoise and recast modules keep defining `NDEBUG` even for the `debug`
  target as we don't want OIDN and Embree asserting all over the place.
2022-09-23 15:21:26 +02:00
bruvzg
54adfb6dfd [Windows] Fix WM_CHAR processing code using Unicode char instead of Virtual key. 2022-09-23 14:16:16 +03:00
Rémi Verschelde
0b06f8b0bd Merge pull request #65816 from bruvzg/proj_settings_missing_flags
Add missing initial window flags and window mode to the project settings.
2022-09-21 18:56:31 +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
bruvzg
d104a4cdbd
Add missing initial window flags and window mode to the project settings. 2022-09-19 12:30:10 +03:00
Rémi Verschelde
d0d22bfa5e Merge pull request #65331 from derammo/derammo_natvis_3
Add more data structures to Natvis for Visual Studio
2022-09-18 00:43:06 +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
5ff8e4ee67 Merge pull request #65133 from bruvzg/win_cursor
[Windows] Simplify cursor handling and add support for fully transparent cursors.
2022-09-14 17:42:53 +02:00
Fredia Huya-Kouadio
9d5e48f873 Disable menus and functionality that are not relevant on the Android Editor port 2022-09-13 20:48:33 -07: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
Rémi Verschelde
5c1ef35def Merge pull request #65262 from bruvzg/win10_dm
Disable dark mode title bar on Windows 10.
2022-09-13 10:58:19 +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