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
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
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
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
Hilderin
9eed43d429
Fix NOTIFICATION_WM_CLOSE_REQUEST in Embedded Floating Window
2025-01-21 21:03:15 +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
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
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
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
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
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
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
Pāvels Nadtočajevs
84650f2018
Implement `DisplayServer.beep`.
2024-12-03 12:43:26 +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
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
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
David Snopek
36293a2dbf
Fix renaming nodes on X11
2024-09-25 09:05:51 +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
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
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
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
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
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
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
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
David Snopek
1289298b5e
Fix text editor stealing focus from "Find in Files" dialog on X11
2024-06-27 17:27:21 +07:00
bruvzg
3cabf51325
[X11] Detect XWayland and disable screen capture support.
2024-06-12 10:05:17 +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
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
bruvzg
1a40cda95e
[macOS, X11] Fix duplicate close requests.
2024-05-28 09:41:04 +07:00
bruvzg
fc89a0c118
Fix build with `vuklan=no` and `d3d12=no` after #91505 .
2024-05-25 21:08:50 +07:00
bruvzg
628c81d2d9
[DisplayServer] Add method to check if window transparency is supported and enabled.
2024-05-23 15:23:18 +07:00
Paulo Poiati
a3769c0edc
Properly set window class in Wayland
2024-05-22 10:42:12 +07: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 +07:00
bruvzg
1f8e69ddec
[X11] Fallback to root window size, when Xinerama extension is available, but return zero screens.
2024-05-14 11:08:10 +07:00
Pedro J. Estébanez
fc08eca524
DisplayServer: Avoid deadlocks while issuing input events and recursive main loop iterations
2024-05-08 17:41:40 +07: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 +07: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 +07:00
bruvzg
67d6be30a0
[DBus] Process file dialog callback in the main event loop instead of using deferred call.
2024-04-23 19:32:35 +07: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 +07: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 +07:00
Rémi Verschelde
d28fb26ab0
Merge pull request #89716 from theromis/master
...
[X11] Add more details to large icon size warning
2024-03-28 10:47:08 +07:00
bruvzg
dc01658ee9
[DisplayServer] Add separate feature flags for different native dialog types.
2024-03-26 15:18:06 +07:00
Roman Vasilyev
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
A Thousand Ships
79ba22a73f
Use `Vector*` component-wise `min/max/clamp` functions where applicable
2024-03-20 13:47:42 +07:00
Rémi Verschelde
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 +07:00
bruvzg
c65a667924
Move `global_menu_*` methods to a separate `NativeMenu` class.
2024-03-04 23:41:41 +07:00
kobewi
3aeb4a5542
Improve cursor_set_custom_image() method
2024-02-28 20:32:25 +07:00
bruvzg
ee53ae28df
Add method to get "base" system UI color (macOS/Windows) and system theme change callback.
2024-02-13 18:38:53 +07:00
Dario
73eff10c76
Finish splitting functionality of the Vulkan and D3D12 backends into RenderingDeviceDriver.
2024-02-12 10:02:18 +07:00
Rémi Verschelde
74b03edf1e
Merge pull request #82800 from Sauermann/fix-screen-mousemotion
...
Add screen-related attributes to mouse input events
2024-02-09 18:08:58 +07:00
Rémi Verschelde
4f478a55cc
Merge pull request #86843 from RandomShaper/fix_null_ptr
...
Avoid several null-dereferences of ApiContextRD
2024-02-07 10:58:01 +07:00
Pedro J. Estébanez
d5a5dd52e8
Avoid several null-dereferences of ApiContextRD
2024-02-06 19:55:01 +07:00
Dalton Lang
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 +07:00
Markus Sauermann
2235a1cbd0
Add screen-related attributes to mouse input events
2024-02-05 23:30:15 +07:00
Rémi Verschelde
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 +07:00
Mel Collins
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 +07:00
bruvzg
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 +07:00
David Snopek
64a52e08fe
[X11] Don't re-set input focus if the given window already has it
2024-01-18 08:52:03 +07:00
Rémi Verschelde
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 +07:00
Rémi Verschelde
03767fbf3b
Merge pull request #86446 from reduz/transient-to-focused
...
Implement a `transient_to_focused` Window mode
2024-01-15 13:25:00 +07:00
Juan Linietsky
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 +07:00
kobewi
0e8f90f4c8
Update deferred calls to use Callables
2024-01-09 16:11:47 +07:00
mequam
40d69c25d5
[X11] Fix Godot stealing focus on alternative Window Managers
2024-01-09 08:58:59 +07:00
Yuri Sizov
3a8524dd92
Merge pull request #83452 from RandomShaper/rd_common
...
Split `RenderingDevice` into API-agnostic and `RenderingDeviceDriver` parts
2023-12-20 20:09:18 +07:00
Pedro J. Estébanez
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 +07:00
Yuri Sizov
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 +07:00
bruvzg
b02cf351f3
[DisplayServer] Use screen "usable rect" instead of full rect to calculate initial window rect.
2023-12-04 07:56:33 +07:00
HolonProduction
bf45d3ae24
X11: Send IME update notification deferred
2023-11-24 13:18:50 +07:00
bruvzg
f3d4f5a77e
[X11] Add fallback from desktop GL to GLES, suppress PRIME detector error spam.
2023-11-06 12:40:44 +07:00
Setadokalo
1d9ec3caa3
Fix freeze when requesting clipboard image from our own window
2023-10-25 18:32:40 +07:00
Brayden Harlon
085255bd0e
Improved X11 screen_get_refresh_rate performance
2023-10-24 11:25:51 +07:00