summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-02-19 11:16:46 +0100
committerGitHub <noreply@github.com>2022-02-19 11:16:46 +0100
commit3b3916f4f0eafcd65f7d97bd0ef974766741da37 (patch)
treeb5025282344b0116c56af66b8c7dcd2ae92283f0
parent417698c2023397f801951358565c6016fd6202f4 (diff)
parent27aab7f7cadb1316e3e475848f342de09063321f (diff)
Merge pull request #58311 from Sauermann/fix-mouse-in-window-variable-name
Update variable name to reflect usage
-rw-r--r--scene/main/viewport.cpp10
-rw-r--r--scene/main/viewport.h2
2 files changed, 6 insertions, 6 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index 691482808a..ca817b17bc 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -497,16 +497,16 @@ void Viewport::_notification(int p_what) {
} break;
case NOTIFICATION_VP_MOUSE_ENTER: {
- gui.mouse_in_window = true;
+ gui.mouse_in_viewport = true;
} break;
case NOTIFICATION_VP_MOUSE_EXIT: {
- gui.mouse_in_window = false;
+ gui.mouse_in_viewport = false;
_drop_physics_mouseover();
_drop_mouse_over();
- // When the mouse exits the window, we want to end mouse_over, but
+ // When the mouse exits the viewport, we want to end mouse_over, but
// not mouse_focus, because, for example, we want to continue
- // dragging a scrollbar even if the mouse has left the window.
+ // dragging a scrollbar even if the mouse has left the viewport.
} break;
case NOTIFICATION_WM_WINDOW_FOCUS_OUT: {
@@ -1683,7 +1683,7 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
Control *over = nullptr;
if (gui.mouse_focus) {
over = gui.mouse_focus;
- } else if (gui.mouse_in_window) {
+ } else if (gui.mouse_in_viewport) {
over = gui_find_control(mpos);
}
diff --git a/scene/main/viewport.h b/scene/main/viewport.h
index 3a71745f44..93e42f1838 100644
--- a/scene/main/viewport.h
+++ b/scene/main/viewport.h
@@ -335,7 +335,7 @@ private:
// info used when this is a window
bool forced_mouse_focus = false; //used for menu buttons
- bool mouse_in_window = true;
+ bool mouse_in_viewport = true;
bool key_event_accepted = false;
Control *mouse_focus = nullptr;
Control *last_mouse_focus = nullptr;