mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
JBR-1795 Project opened from Welcome screen goes to backgound after loading
(cherry picked from commit 322526458a)
This commit is contained in:
committed by
alexey.ushakov@jetbrains.com
parent
a6e8cb8297
commit
e4ba1ebe2f
@@ -786,6 +786,24 @@ AwtFrame::Show()
|
||||
} else {
|
||||
::ShowWindow(hwnd, SW_SHOWMAXIMIZED);
|
||||
}
|
||||
|
||||
// [tav] Workaround for unclear platform behaviour.
|
||||
// When a custom decor frame is being shown maximized at the moment
|
||||
// some another AWT window is still foreground - the frame can go
|
||||
// in background when shown if:
|
||||
// 1) the other AWT window is closed the moment after frame's show
|
||||
// 2) some another maximized window is behind the frame, it steals activation
|
||||
if (HasCustomDecoration()) {
|
||||
HWND fgHWnd = ::GetForegroundWindow();
|
||||
if (fgHWnd != NULL &&
|
||||
GetComponent(fgHWnd) != NULL && // it's awt window
|
||||
IsFocusableWindow() &&
|
||||
IsAutoRequestFocus() &&
|
||||
!::IsWindow(GetModalBlocker(GetHWnd())))
|
||||
{
|
||||
::SetForegroundWindow(GetHWnd());
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (m_isInputMethodWindow) {
|
||||
// Don't activate input methow window
|
||||
|
||||
Reference in New Issue
Block a user