The previous implementation for signals mouse_entered and mouse_exited
had shortcomings that relate to focused windows and pressed mouse buttons.
For example a Control can be hovered by mouse, even if it is occluded by
an embedded window.
This patch changes the behavior, so that Control and Viewport send
their mouse-enter/exit-notifications based solely on mouse position,
visible area, and input restrictions and not on which window has
focus or which mouse buttons are pressed. This implicitly also
changes when the mouse_entered and mouse_exited signals are sent.
This functionality can not be implemented as a part of
Viewport::_gui_input_event, because of its interplay with Windows and
because Viewport::_gui_input_event is based on input and not on
visibility.
Currently the window receives a focus-out notification, directly after
it popup, because currently the signal is sent deferred.
The original intention was that the previously focused window must
receive a focus-out notification.
This change makes the notification more precise by only sending the
focus-out to the previously focused window.
When a Viewport is not directly attached to the screen, the
function `Viewport::get_mouse_position` can't rely on
`get_screen_transform`, because that function is ambiguous in
these situations.
In these cases it is necessary to use the mouse position from
the most recent mouse IputEvent.
* Make placeholder in editor layout dialog translatable.
* Make messages in scene import settings dialog translatable.
* Mark theme override property categories for translation.
Fixes#75084.
The clamp_to_embedder setting was added in 8be16e0704,
but was not set on any of the in-editor dialogs.
This patch sets `clamp_to_embedder` on editor dialogs so they cannot be dragged out of the frame.
This also modifies `clamp_to_embedder` so a window is clamped to the bounds of an embedder when
it pops up and when the parent is resized.
This solves the problem, that mouse events get sent to SubViewports
even if they are outside of the visible area of the SubViewport.
This changes makes SubViewportContainer::unhandled_input redundand.
Shortcut Events now need to be distributed via push_input, in order for
them to be able to reach SubViewports.
After a scene reload a mouse cursor updates is performed via a
InputEventMouseMotion, that is exposed to the user.
The state of Input is however not adjusted to this InputEventMouseMotion
which can lead to inconsistencies.
This PR makes sure, that it is not exposed to the user.
It utilizes the method of Viewport::_process_picking for marking
events that are not sent to the user, so that this function doesn't
need to be changed.
With the 4.x-introduction of Windows the previous method for
color picking was no longer working.
This PR uses the following approach to reintroduce color-picking.
When the Color-Picking-Button is pressed, a quasi-screenshot of the
Window-content is created and displayed in a new Popup-Window.
This new Window allows selecting colors by Mouse-Click.
A Preview of the targeted Color is also displayed.
Some internally created emulated/instantiated events didn't have a
device id. This PR sets for these cases a device id.
Also rename `DEVICE_ID_TOUCH_MOUSE` to the more generic
`DEVICE_ID_EMULATION`.
`Viewport.to_screen_rect` is used only in a single location to compare it
to `Rect2i()`.
When called from `SubViewport`, `to_screen_rect` is always equal to `Rect2i()`.
When called from `Window`, `to_screen_rect` is always different from `Rect2i()`.
So the comparison `to_screen_rect != Rect2i()` can be replaced by
`Object::cast_to<Window>(this)`.
This allows the removal of `Viewport.to_screen_rect` and the simplification of
`Viewport::_set_size`.