`vp_pending` is a flag indicating to wait for `ViewportTexture::_setup_local_to_scene`
to be called. Once this method is called, no matter whether the setup will fail or not,
it needs to be reset to `false`.
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.
SceneTree overrides the virtual `process` and `physics_process` methods
that it inherits from MainLoop. These methods return a boolean that
determines if the main loop should end.
The SceneTree was ignoring the returned boolean, so scripts inheriting
from SceneTree that override these methods and return true didn't exit
the main loop. Now the boolean is checked.
When changing `viewport_path`, the `proxy`'s target is changed to a new placeholder.
Add a flag `vp_changed` to prevent calling `setup_local_to_scene` (mainly called by toggling `resource_local_to_scene`) when the target viewport has not changed.
Currently mouse hovering doesn't update the state, when collision objects
or the camera move.
This PR fixes this problem by taking the mouse position from the viewport
and not from a nonexistent previous event.
Since previous events could potentially be a long time ago, their
modifier-key state might be outdated. This PR fetches the current
status of modifier-keys from `Input`.
These changes allow the removal of some class-variables and making
additional simplifications.
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.
`NOTIFICATION_CHILD_ORDER_CHANGED` could be triggered, while there
was an inconsistent state:
- parent node no longer had child listed as child
- child node still had parent node listed as parent
Bring these two in sync, before emitting the notification.
AnimationNodeBlendSpace2DEditor:
- `!tree` is always false, because it is checked a few lines above
CurveEdit:
- grabbing != GRAB_NONE is redundant
GradientTexture2DEdit:
- grabbed != HANDLE_FROM is redundant
- grabbed != HANDLE_TO is redundant
Viewport:
- index is not used afterwards
- In these cases `gui.mouse_focus` is always valid. Move check to a DEV_ASSERT
- simplify `stopped` calculation