Add a separate application focus/in notification out from Window focus notification.
This commit is contained in:
parent
27605769c4
commit
438c380458
20 changed files with 65 additions and 35 deletions
|
|
@ -1790,6 +1790,12 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
|
|||
// Restore mouse mode
|
||||
_set_mouse_mode_impl(mouse_mode);
|
||||
|
||||
if (!app_focused) {
|
||||
if (OS::get_singleton()->get_main_loop()) {
|
||||
OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_APPLICATION_FOCUS_IN);
|
||||
}
|
||||
app_focused = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case WM_KILLFOCUS: {
|
||||
|
|
@ -1805,6 +1811,19 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
|
|||
}
|
||||
touch_state.clear();
|
||||
|
||||
bool self_steal = false;
|
||||
HWND new_hwnd = (HWND)wParam;
|
||||
if (IsWindow(new_hwnd)) {
|
||||
self_steal = true;
|
||||
}
|
||||
|
||||
if (!self_steal) {
|
||||
if (OS::get_singleton()->get_main_loop()) {
|
||||
OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_APPLICATION_FOCUS_OUT);
|
||||
}
|
||||
app_focused = false;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case WM_ACTIVATE: // Watch For Window Activate Message
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue