Viewport used get_global_transform().xform_inv(mpos) to convert the mouse position to the control's local coordinates when getting the control's tooltip, which does not handle scale correctly. This impacted tooltips for any controls that depended on the position to determine what tooltip to show, including RichTextLabel, ItemList, Tree, and probably some others. This change is for Viewport to use get_global_transform_with_canvas().affine_inverse().xform(mpos) for tooltips instead, to match what we do for Viewport::_gui_call_input.
Fixes#91984
In `Viewport::_gui_force_drag` currently `Viewport::gui.mouse_focus`
gets cleared, but `Viewport::gui.mouse_focus_mask` doesn't get cleared.
This is an inconsistency which can cause a crash.
With the change of this PR, `mouse_focus_mask` also gets cleared.
This is in alignment with how regular drag and drop clears both variables.
In certain situations it is possible that in a `Viewport` the same
mouse button is pressed twice in series without releasing it in
between.
In this case, focus stealing should happen to ensure, that the
mouse button is not sent unintentionally to the previously focused
Control node.
Make sure, that a windows initial state is `mouse_in_viewport = false`.
This makes sure, that the mouse entered notification is sent when the
mouse hovers a window for the first time.
For embedded Windows, `NOTIFICATION_WM_MOUSE_ENTER` is currently sent
twice in a row. Remove one of the places where it is sent.
`Window::_update_mouse_over()` is the correct one, because there it is
also called for native windows.
* Disabled 2D navigation tests as they do not work
* Disabled tests for primitive meshes
* Unbound some `Mesh` methods that rely on 3D resources
* Unexposed `World3D` as it depends on physics (and isn't useful)
* Unexposed some `Viewport` vrs related properties that had unexposed
methods
Changing `gui_embed_subwindows` while a child window is displayed can lead
to crashes or other unintended behavior.
This PR adds checks to prevent the change while child windows are
displayed.
`NOTIFICATION_MOUSE_ENTER` and `NOTIFICATION_MOUSE_EXIT` now includes
the areas of children control nodes if the mouse filters allow it.
In order to check if a Control node itself was entered/exited, the newly
introduced `NOTIFICATION_MOUSE_ENTER_SELF` and
`NOTIFICATION_MOUSE_EXIT_SELF` can be used.
Co-authored-by: Markus Sauermann <6299227+Sauermann@users.noreply.github.com>