Re-apply "Fixes for windows in X11 tiling WMs"

From PR #38727 which was reverted in #41373 because of regressions in Ubuntu
with Gnome.

Co-authored-by: Lorenzo Cerqua <lorenzocerqua@tutanota.com>
This commit is contained in:
PouleyKetchoupp 2020-08-21 09:39:30 +02:00
parent b0ca859501
commit 2b49cb0b73
9 changed files with 36 additions and 12 deletions

View file

@ -495,13 +495,17 @@ DisplayServer::WindowID DisplayServerWindows::create_sub_window(WindowMode p_mod
_update_window_style(window_id);
ShowWindow(wd.hWnd, (p_flags & WINDOW_FLAG_NO_FOCUS_BIT) ? SW_SHOWNOACTIVATE : SW_SHOW); // Show The Window
if (!(p_flags & WINDOW_FLAG_NO_FOCUS_BIT)) {
return window_id;
}
void DisplayServerWindows::show_window(WindowID p_id) {
WindowData &wd = windows[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
SetFocus(wd.hWnd); // Sets Keyboard Focus To
}
return window_id;
}
void DisplayServerWindows::delete_sub_window(WindowID p_window) {
@ -3139,9 +3143,7 @@ DisplayServerWindows::DisplayServerWindows(const String &p_rendering_driver, Win
}
}
ShowWindow(windows[MAIN_WINDOW_ID].hWnd, SW_SHOW); // Show The Window
SetForegroundWindow(windows[MAIN_WINDOW_ID].hWnd); // Slightly Higher Priority
SetFocus(windows[MAIN_WINDOW_ID].hWnd); // Sets Keyboard Focus To
show_window(MAIN_WINDOW_ID);
#if defined(VULKAN_ENABLED)