Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update variable name to reflect usage #58311

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions scene/main/viewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion scene/main/viewport.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ class Viewport : public Node {
// 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;
Expand Down