Commit graph

730 commits

Author SHA1 Message Date
Thaddeus Crews cc6dd8d02c
Style: Optimize .svg files with svgo 2024-06-23 08:15:19 -05:00
bruvzg b5e3238109
[TextServer] Fix get_word_breaks and it uses. 2024-06-21 14:56:57 +03:00
Rémi Verschelde 4e01d8663e
Merge pull request #93021 from bruvzg/wl_ime
[Wayland] Implement IME support.
2024-06-19 10:10:09 +02: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 +02: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 +02:00
bruvzg 3cabf51325
[X11] Detect XWayland and disable screen capture support. 2024-06-12 10:05:17 +03:00
bruvzg be25e60f61
[Wayland] Implement IME support. 2024-06-11 12:24:54 +03: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 +02: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 +02: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 +03:00
kleonc 91e995e704 Fix creating cursor image from AtlasTexture 2024-06-05 01:44:05 +02: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 +02:00
bruvzg 5168647530
Use current mouse button state instead of saved values. 2024-05-31 15:50:14 +03: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 +02: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 +02:00
bruvzg 714effdf07
[DisplayServer] Add error messages and descriptions to callbacks. 2024-05-28 17:36:54 +03:00
Rémi Verschelde cc6a7b97d6
Merge pull request #92458 from bruvzg/dup_cl
[macOS, X11] Fix duplicate close requests.
2024-05-28 15:50:05 +02:00
Rémi Verschelde f98c259131
Merge pull request #92353 from Riteo/you-cant-see-me
Wayland: Implement `is_window_transparency_available`
2024-05-28 15:49:33 +02:00
Rémi Verschelde 981ac9bfeb
Merge pull request #92324 from jwinarske/jw/wayland_sowrap
Linux: Enable build config `wayland=yes use_sowrap=no`
2024-05-28 15:49:16 +02:00
bruvzg 1a40cda95e
[macOS, X11] Fix duplicate close requests. 2024-05-28 09:41:04 +03:00
Riteo 9734feb449 Wayland: Implement is_window_transparency_available 2024-05-26 00:05:47 +02:00
bruvzg fc89a0c118
Fix build with vuklan=no and d3d12=no after #91505. 2024-05-25 21:08:50 +03:00
Joel Winarske f06dd46eb7 Enable build config wayland=yes use_sowrap=no
-wayland-egl.h was missing if opengl3=yes (default)

Signed-off-by: Joel Winarske <joel.winarske@gmail.com>
2024-05-25 07:15:57 -07:00
bruvzg 628c81d2d9
[DisplayServer] Add method to check if window transparency is supported and enabled. 2024-05-23 15:23:18 +03:00
Rémi Verschelde 7870b28ed3
Merge pull request #92252 from poiati/fix-wayland-window-class
Properly set window class in Wayland
2024-05-23 08:59:23 +02:00
Thaddeus Crews 896b003cc8
SCons: Convert platform get_flags to dictionary 2024-05-22 13:53:20 -05:00
Paulo Poiati a3769c0edc Properly set window class in Wayland 2024-05-22 10:42:12 -03:00
Jakub Marcowski d9f8ef68df
Update pre-commit hooks configuration to use ruff instead of black 2024-05-21 18:02:29 -05:00
Hugo Locurcio a008896f70
Use OS::delay_usec() to avoid using deprecated usleep() on Linux
usleep(3) was declared obsolete in POSIX.1-2001 and removed in POSIX.1-2008.
nanosleep(2) was recommended to be used instead.

`OS::delay_usec()` internally uses `nanosleep()`.

This also uses large number separators for improved readability.
2024-05-21 17:32:40 +02:00
bruvzg 1f8e69ddec
[X11] Fallback to root window size, when Xinerama extension is available, but return zero screens. 2024-05-14 11:08:10 +03:00
Hugo Locurcio 7b678b961c
Set execinfo=no by default when compiling for Linux/*BSD
Alpine 3.17 and later no longer provide execinfo in its repositories,
making compilation impossible unless you pass `execinfo=no`.
2024-05-11 00:25:13 +02:00
Pedro J. Estébanez fc08eca524 DisplayServer: Avoid deadlocks while issuing input events and recursive main loop iterations 2024-05-08 17:41:40 +02:00
A Thousand Ships a0dbdcc3ab
Replace find with contains/has where applicable
* Replaces `find(...) != -1` with `contains` for `String`
* Replaces `find(...) == -1` with `!contains` for `String`
* Replaces `find(...) != -1` with `has` for containers
* Replaces `find(...) == -1` with `!has` for containers
2024-05-08 12:37:42 +02:00
Jakub Marcowski 7699d678c4
Fix builtin_embree=no build linking the wrong version of Embree 2024-05-08 00:40:45 +02:00
Rémi Verschelde 039aa28a60
Merge pull request #89574 from Riteo/scale-your-expectations-with-this-one
Wayland: Workaround API limitation in screen/UI scale logic
2024-05-07 21:52:44 +02:00
Riteo 1bb8199342 Wayland: Workaround API limitation in screen/UI scale logic
Mainly, this fixes auto UI scaling with _single-monitor_ fractional
setups (see the comment in `display_server_wayland.cpp` for more info).

This is the result of a bunch of current limitations, mainly the fact
that the UI scale is static (it's probed at startup) and the fact that
Wayland exposes fractional scales only at the window-level, by design.

The `screen_get_scale` special case should help in 99% of cases, while
the auto UI scale part will unfortunately only help with single-screen
situations, as multi-screen fractional scaling requires dynamic UI
scale changing.
2024-05-07 19:50:48 +02:00
A Thousand Ships 955d5affa8
Reduce and prevent unnecessary random-access to List
Random-access access to `List` when iterating is `O(n^2)` (`O(n)` when
accessing a single element)

* Removed subscript operator, in favor of a more explicit `get`
* Added conversion from `Iterator` to `ConstIterator`
* Remade existing operations into other solutions when applicable
2024-05-04 16:08:55 +02:00
Riteo d3279fa552 Wayland: Add support for OpenGL ES driver
Everything was already there, we just had to wire it up in the display
server.
2024-05-03 05:17:13 +02:00
A Thousand Ships 308dbb8c63
[Core] Add scalar versions of Vector* min/max/clamp/snap(ped)
Convenience for a number of cases operating on single values
2024-05-02 10:31:13 +02:00
Rémi Verschelde 947f5a8741
Merge pull request #91247 from AThousandShips/callable_fix
Fix unsafe uses of `Callable.is_null()`
2024-04-29 10:10:32 +02:00
Rémi Verschelde dee1231ce6
Merge pull request #91220 from Repiteo/scons/colorize-warn-error
SCons: Colorize warnings/errors during generation
2024-04-29 10:10:16 +02:00
Thaddeus Crews e0e8ce1fc0
SCons: Colorize warnings/errors during generation 2024-04-28 16:24:48 -05:00
A Thousand Ships 31e7ee63f2
Fix unsafe uses of Callable.is_null()
`Callable.is_null()` is not equivalent to `!Callable.is_valid()` and
doesn't guarantee the call is valid.
2024-04-27 16:22:57 +02:00
Riteo 2b34ba6d4b Wayland: Improve compositor compatibility by allowing older globals
Previously we pretty much hardcoded most of the globals we requested,
causing compatibility issues with certain compositors like Weston, which
support only some pretty old versions or miss some more advanced
protocols.

To put fuel on the fire, we also errored out when certain protocols
weren't available, despite us being able to boot a game just fine (but
obviously with a degraded featureset).

The solution is to simply allow all the way from version 1 to the
current latest, adding some compatibility code (such as for older
`wl_output`s or newer `wl_pointer`s).

While we're at it, this commit also fixes a few typos and naming inconsistencies
I found.
2024-04-26 15:52:10 +02:00
bruvzg 67d6be30a0
[DBus] Process file dialog callback in the main event loop instead of using deferred call. 2024-04-23 19:32:35 +03:00
Pedro J. Estébanez c28f5901c7 Polish interaction between windowing, input and rendering
- Adapt GL make/release API to the current architecture.
- Fix DisplayServer being locked while dispatching input (prevent deadlocks).
2024-04-10 18:47:42 +02:00
bruvzg bf558adcdd
[.NET] Disable output embedding on macOS, move it to the advanced options on other platforms. 2024-04-09 17:47:39 +03:00
sambler 97e95e1750 Make sysctl calls on FreeBSD
The OS module get_unique_id and get_processor_name rely
on linux files which don't exist on a standard FreeBSD install,
make sysctl calls to get the required data.
2024-04-08 19:18:03 +09:30
Rémi Verschelde 06f86e6e37
Merge pull request #89935 from bruvzg/dbus_conn_fix
[Linux/Portal] Fix incorrect DBus connection usage.
2024-04-04 14:35:31 +02:00
Rémi Verschelde 7092230df6
Merge pull request #89907 from bruvzg/nat_dlg_ftr_flags
[DisplayServer] Add separate feature flags for different native dialog types.
2024-03-28 10:47:15 +01:00