Fix WINDOW_EVENT_FOCUS_IN for popups on Windows
On Windows, WINDOW_EVENT_FOCUS_IN was never sent by the display server for popups, because WM_ACTIVATE events are received during the call to _update_window_style, which happened before the callbacks were set. This was causing some issues with the way Popup is now handling closing on parent focus. Now _update_window_style is only called during show_window, after Window initialized callbacks.
This commit is contained in:
@@ -493,14 +493,16 @@ DisplayServer::WindowID DisplayServerWindows::create_sub_window(WindowMode p_mod
|
||||
wd.no_focus = true;
|
||||
}
|
||||
|
||||
_update_window_style(window_id);
|
||||
|
||||
return window_id;
|
||||
}
|
||||
|
||||
void DisplayServerWindows::show_window(WindowID p_id) {
|
||||
WindowData &wd = windows[p_id];
|
||||
|
||||
if (p_id != MAIN_WINDOW_ID) {
|
||||
_update_window_style(p_id);
|
||||
}
|
||||
|
||||
ShowWindow(wd.hWnd, wd.no_focus ? SW_SHOWNOACTIVATE : SW_SHOW); // Show The Window
|
||||
if (!wd.no_focus) {
|
||||
SetForegroundWindow(wd.hWnd); // Slightly Higher Priority
|
||||
|
||||
Reference in New Issue
Block a user