summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorMeriipu <Meriipu@users.noreply.github.com>2020-08-06 15:05:43 +0200
committerMeriipu <Meriipu@users.noreply.github.com>2020-09-07 04:11:27 +0200
commit44657db3e21faddcf111696d3a05d93046fcea5a (patch)
treea4168e89afd28c557ff5b121097d88dacd53840f /scene
parent6831da630f5609e1b659d65425d9da07e25df616 (diff)
If the mouse is held on notification_wm_mouse_exit, do not drop focus
This fixes a bug where users of the scrollbar had to be very careful not to move the mouse outside the viewport, otherwise the scrollbar would drop its drag-action and stop scrolling until clicked again. The existing behaviour had the side-effect of also dropping the cosmetic highlighting of the scrollbar (in addition to the dragging), for the specific case where the mouse was move outside the window. The previous behaviour did nothing to remove the highlight if the mouse was released (but not moved) inside the viewport. This separate issue with the lingering highlight of the scrollbar (until a mouse-movement action is performed inside the viewport) is fixed in an immediate followup to this commit. Closes bug #39634
Diffstat (limited to 'scene')
-rw-r--r--scene/main/viewport.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index d962171555..08a212d58b 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -814,7 +814,14 @@ void Viewport::_notification(int p_what) {
}
} break;
- case NOTIFICATION_WM_MOUSE_EXIT:
+ case NOTIFICATION_WM_MOUSE_EXIT: {
+ _drop_physics_mouseover();
+
+ // Unlike on loss of focus (NOTIFICATION_WM_WINDOW_FOCUS_OUT), do not
+ // drop the gui mouseover here, as a scrollbar may be dragged while the
+ // mouse is outside the window (without the window having lost focus).
+ // See bug #39634
+ } break;
case NOTIFICATION_WM_WINDOW_FOCUS_OUT: {
_drop_physics_mouseover();