Skip to content

Commit bdfe76b

Browse files
committed
Windows: Fix mouse handling regression
1 parent e5b4ef8 commit bdfe76b

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

platform/windows/display_server_windows.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3930,7 +3930,7 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
39303930
}
39313931
mm->set_relative_screen_position(mm->get_relative());
39323932

3933-
if ((windows[window_id].window_has_focus || windows[window_id].is_popup) && mm->get_relative() != Vector2()) {
3933+
if ((windows[window_id].window_focused || windows[window_id].is_popup) && mm->get_relative() != Vector2()) {
39343934
Input::get_singleton()->parse_input_event(mm);
39353935
}
39363936
}
@@ -3978,7 +3978,7 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
39783978
windows[window_id].last_pen_inverted = inverted;
39793979

39803980
// Don't calculate relative mouse movement if we don't have focus in CAPTURED mode.
3981-
if (!windows[window_id].window_has_focus && mouse_mode == MOUSE_MODE_CAPTURED) {
3981+
if (!windows[window_id].window_focused && mouse_mode == MOUSE_MODE_CAPTURED) {
39823982
break;
39833983
}
39843984

@@ -4028,7 +4028,7 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
40284028
mm->set_relative_screen_position(mm->get_relative());
40294029
old_x = mm->get_position().x;
40304030
old_y = mm->get_position().y;
4031-
if (windows[window_id].window_has_focus || window_get_active_popup() == window_id) {
4031+
if (windows[window_id].window_focused || window_get_active_popup() == window_id) {
40324032
Input::get_singleton()->parse_input_event(mm);
40334033
}
40344034
}
@@ -4114,7 +4114,7 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
41144114
}
41154115

41164116
// Don't calculate relative mouse movement if we don't have focus in CAPTURED mode.
4117-
if (!windows[window_id].window_has_focus && mouse_mode == MOUSE_MODE_CAPTURED) {
4117+
if (!windows[window_id].window_focused && mouse_mode == MOUSE_MODE_CAPTURED) {
41184118
break;
41194119
}
41204120

@@ -4177,7 +4177,7 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
41774177
mm->set_relative_screen_position(mm->get_relative());
41784178
old_x = mm->get_position().x;
41794179
old_y = mm->get_position().y;
4180-
if (windows[window_id].window_has_focus || window_get_active_popup() == window_id) {
4180+
if (windows[window_id].window_focused || window_get_active_popup() == window_id) {
41814181
Input::get_singleton()->parse_input_event(mm);
41824182
}
41834183

@@ -4229,7 +4229,7 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
42294229
}
42304230

42314231
// Don't calculate relative mouse movement if we don't have focus in CAPTURED mode.
4232-
if (!windows[window_id].window_has_focus && mouse_mode == MOUSE_MODE_CAPTURED) {
4232+
if (!windows[window_id].window_focused && mouse_mode == MOUSE_MODE_CAPTURED) {
42334233
break;
42344234
}
42354235

@@ -4725,7 +4725,7 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
47254725
} break;
47264726
case WM_SETCURSOR: {
47274727
if (LOWORD(lParam) == HTCLIENT) {
4728-
if (windows[window_id].window_has_focus && (mouse_mode == MOUSE_MODE_HIDDEN || mouse_mode == MOUSE_MODE_CAPTURED || mouse_mode == MOUSE_MODE_CONFINED_HIDDEN)) {
4728+
if (windows[window_id].window_focused && (mouse_mode == MOUSE_MODE_HIDDEN || mouse_mode == MOUSE_MODE_CAPTURED || mouse_mode == MOUSE_MODE_CONFINED_HIDDEN)) {
47294729
// Hide the cursor.
47304730
if (hCursor == nullptr) {
47314731
hCursor = SetCursor(nullptr);

platform/windows/display_server_windows.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,6 @@ class DisplayServerWindows : public DisplayServer {
391391
bool was_maximized = false;
392392
bool always_on_top = false;
393393
bool no_focus = false;
394-
bool window_has_focus = false;
395394
bool exclusive = false;
396395
bool context_created = false;
397396
bool mpass = false;

0 commit comments

Comments
 (0)