Commit Graph

150 Commits

Author SHA1 Message Date
25de53e147 X11: Fix creating RenderingDevice after #93706
The line was removed by mistake.
2024-06-29 14:03:29 +02:00
32d9c93af3 Improve handling of rendering startup errors 2024-06-28 19:31:50 +02:00
1289298b5e Fix text editor stealing focus from "Find in Files" dialog on X11 2024-06-27 17:27:21 -05:00
3cabf51325 [X11] Detect XWayland and disable screen capture support. 2024-06-12 10:05:17 +03:00
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
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
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
91e995e704 Fix creating cursor image from AtlasTexture 2024-06-05 01:44:05 +02:00
5168647530 Use current mouse button state instead of saved values. 2024-05-31 15:50:14 +03:00
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
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
714effdf07 [DisplayServer] Add error messages and descriptions to callbacks. 2024-05-28 17:36:54 +03:00
1a40cda95e [macOS, X11] Fix duplicate close requests. 2024-05-28 09:41:04 +03:00
fc89a0c118 Fix build with vuklan=no and d3d12=no after #91505. 2024-05-25 21:08:50 +03:00
628c81d2d9 [DisplayServer] Add method to check if window transparency is supported and enabled. 2024-05-23 15:23:18 +03:00
a3769c0edc Properly set window class in Wayland 2024-05-22 10:42:12 -03:00
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
1f8e69ddec [X11] Fallback to root window size, when Xinerama extension is available, but return zero screens. 2024-05-14 11:08:10 +03:00
fc08eca524 DisplayServer: Avoid deadlocks while issuing input events and recursive main loop iterations 2024-05-08 17:41:40 +02:00
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
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
67d6be30a0 [DBus] Process file dialog callback in the main event loop instead of using deferred call. 2024-04-23 19:32:35 +03:00
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
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
d28fb26ab0 Merge pull request #89716 from theromis/master
[X11] Add more details to large icon size warning
2024-03-28 10:47:08 +01:00
dc01658ee9 [DisplayServer] Add separate feature flags for different native dialog types. 2024-03-26 15:18:06 +02:00
ece8685b3b Add icon source size to warning about "too large icon dimensions" to help faster find it 2024-03-22 12:53:57 -07:00
79ba22a73f Use Vector* component-wise min/max/clamp functions where applicable 2024-03-20 13:47:42 +01:00
058202e960 Merge pull request #86101 from GrammAcc/partial-fix-68305
[X11] Partial fix for Editor and Project Manager stealing focus on some window managers
2024-03-11 23:48:07 +01:00
c65a667924 Move global_menu_* methods to a separate NativeMenu class. 2024-03-04 23:41:41 +02:00
3aeb4a5542 Improve cursor_set_custom_image() method 2024-02-28 20:32:25 +01:00
ee53ae28df Add method to get "base" system UI color (macOS/Windows) and system theme change callback. 2024-02-13 18:38:53 +02:00
73eff10c76 Finish splitting functionality of the Vulkan and D3D12 backends into RenderingDeviceDriver. 2024-02-12 10:02:18 -03:00
74b03edf1e Merge pull request #82800 from Sauermann/fix-screen-mousemotion
Add screen-related attributes to mouse input events
2024-02-09 18:08:58 +01:00
4f478a55cc Merge pull request #86843 from RandomShaper/fix_null_ptr
Avoid several null-dereferences of ApiContextRD
2024-02-07 10:58:01 +01:00
d5a5dd52e8 Avoid several null-dereferences of ApiContextRD 2024-02-06 19:55:01 +01:00
8a2e4409e6 [X11] Partial Fix Godot Editor and Project Manager steals focus on a window manager on Linux
This is a workaround for the most critical portion of the WM focus bug
described in #68305. On some specific X11 WM configurations, the
editor's main window and any popups it creates will fight for focus,
which causes a total system lockup due to mouse and keyboard input being
stolen as well. Getting out of this infinite loop requires force
restarting the system.

It can be tested with the following shell script:

```bash
	!#/bin/sh

	godot4 &
	sleep 30
	pkill -x godot4
```

The workaround identified in #68305 is to remove the call to
XSetInputFocus in the ConfigureNotify event handler, so I have removed
the conditional block that calls this as well as the setup code above it
since there is no need to allocate the memory for the variables if they
won't be used in that call anymore.

This is just a hack and is not a complete fix for #68305. Multiple
developers are collaborating on a proper fix in the discussion in that
issue, but time is a valuable resource that no one has enough of, so I
am committing this workaround as a stop-gap to prevent the most critical
problem while we work on a full solution for the underlying cause.
2024-02-05 17:00:24 -06:00
2235a1cbd0 Add screen-related attributes to mouse input events 2024-02-05 23:30:15 +01:00
f220d46cdc Merge pull request #80231 from romlok/input-key-location
Support detecting and mapping ctrl/alt/shift/meta by their left/right physical location
2024-01-29 13:15:42 +01:00
8406e60522 Add InputEventKey.location to tell left from right
This adds a new enum `KeyLocation` and associated property
`InputEventKey.location`, which indicates the left/right location of key
events which may come from one of two physical keys, eg. Shift, Ctrl.

It also adds simulation of missing Shift KEYUP events for Windows.
When multiple Shifts are held down at the same time, Windows natively
only sends a KEYUP for the last one to be released.
2024-01-26 14:42:28 +01:00
a8f521bcad [Native File Dialog] Add support for adding custom options to the dialogs.
Add support for adding custom options (checkboxes and optionboxes) to the dialogs (both native and built-in).
2024-01-24 15:00:31 +02:00
64a52e08fe [X11] Don't re-set input focus if the given window already has it 2024-01-18 08:52:03 -06:00
4aff0ab5d5 Merge pull request #86441 from dsnopek/mequam-x11-focus-grab
[X11] Fix Godot stealing focus on alternative window managers
2024-01-18 09:34:18 +01:00
03767fbf3b Merge pull request #86446 from reduz/transient-to-focused
Implement a `transient_to_focused` Window mode
2024-01-15 13:25:00 +01:00
15144c24bd Implement a transient_to_focused mode
This intends to be the correct way to handle non-child windows becoming covered by the current window when becoming focused.
Enabling this property on select windows, they will become transient to the currently focused one when becoming visible.

This deprecates the "unparent_when_invisible" function introduced by #76025.
2024-01-14 18:51:44 +01:00
0e8f90f4c8 Update deferred calls to use Callables 2024-01-09 16:11:47 +01:00
40d69c25d5 [X11] Fix Godot stealing focus on alternative Window Managers 2024-01-09 08:58:59 -06:00
3a8524dd92 Merge pull request #83452 from RandomShaper/rd_common
Split `RenderingDevice` into API-agnostic and `RenderingDeviceDriver` parts
2023-12-20 20:09:18 +01:00
12a519bae2 Split RenderingDevice into API-agnostic and RenderingDeviceDriver parts
Credit and thanks to @bruzvg for multiple build fixes, update of 3rd-party items and MinGW support.

Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
2023-12-20 19:18:08 +01:00
aee8a3bada Merge pull request #75489 from bruvzg/init_pos_usable
[DisplayServer] Use screen "usable rect" instead of full rect to calculate initial window rect.
2023-12-19 20:32:10 +01:00