[Native File Dialogs] Refocus last focused window on close.
This commit is contained in:
parent
6758a7f8c0
commit
2e1f48ff6e
5 changed files with 22 additions and 4 deletions
|
|
@ -239,6 +239,8 @@ Error DisplayServerWindows::file_dialog_show(const String &p_title, const String
|
|||
filters.push_back({ (LPCWSTR)filter_names[i].ptr(), (LPCWSTR)filter_exts[i].ptr() });
|
||||
}
|
||||
|
||||
WindowID prev_focus = last_focused_window;
|
||||
|
||||
HRESULT hr = S_OK;
|
||||
IFileDialog *pfd = nullptr;
|
||||
if (p_mode == FILE_DIALOG_MODE_SAVE_FILE) {
|
||||
|
|
@ -339,6 +341,9 @@ Error DisplayServerWindows::file_dialog_show(const String &p_title, const String
|
|||
}
|
||||
}
|
||||
pfd->Release();
|
||||
if (prev_focus != INVALID_WINDOW_ID) {
|
||||
callable_mp(DisplayServer::get_singleton(), &DisplayServer::window_move_to_foreground).call_deferred(prev_focus);
|
||||
}
|
||||
|
||||
return OK;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue