diff --git a/src/platform_impl/windows/window.rs b/src/platform_impl/windows/window.rs index 7cc6b3c52..c88b18b52 100644 --- a/src/platform_impl/windows/window.rs +++ b/src/platform_impl/windows/window.rs @@ -1267,7 +1267,9 @@ unsafe fn taskbar_mark_fullscreen(handle: HWND, fullscreen: bool) { unsafe fn force_window_active(handle: HWND) { // Try to focus the window without the hack first. - SetForegroundWindow(handle); + if SetForegroundWindow(handle).as_bool() { + return; + } // In some situations, calling SetForegroundWindow could not bring up the window, // This is a little hack which can "steal" the foreground window permission.