Skip to content
Permalink
Browse files

Fix #1305: "Select device" hides under other program without MTA icon…

… on a taskbar
  • Loading branch information
ccw808 committed Mar 20, 2020
1 parent f3d80a7 commit 2c5251a42a640ccc9ffa928cb2844c9295f47c6c
Showing with 8 additions and 6 deletions.
  1. +6 −5 Client/loader/MainFunctions.cpp
  2. +2 −1 Client/loader/Utils.cpp
@@ -1175,7 +1175,6 @@ int LaunchGame(SString strCmdLine)
BsodDetectionOnGameBegin();
// Show splash until game window is displayed (or max 20 seconds)
DWORD status;
bool bShownDeviceSelectionDialog = false;
for (uint i = 0; i < 20; i++)
{
status = WaitForSingleObject(piLoadee.hProcess, 1000);
@@ -1188,16 +1187,18 @@ int LaunchGame(SString strCmdLine)
break;
}

// Skip stuck process warning if DeviceSelection dialog is still open after 4 seconds
if (i >= 4)
bShownDeviceSelectionDialog |= IsDeviceSelectionDialogOpen(piLoadee.dwThreadId);
// Keep showing splash if the device selection dialog is open
if (IsDeviceSelectionDialogOpen(piLoadee.dwThreadId))
{
i--;
}
}

// Actually hide the splash
HideSplash();

// If hasn't shown the loading screen and gta_sa.exe process memory usage is not changing, give user option to terminate
if (status == WAIT_TIMEOUT && !bShownDeviceSelectionDialog)
if (status == WAIT_TIMEOUT)
{
CStuckProcessDetector stuckProcessDetector(piLoadee.hProcess, 5000);
while (status == WAIT_TIMEOUT && WatchDogIsSectionOpen("L3")) // Gets closed when loading screen is shown
@@ -2155,7 +2155,8 @@ BOOL CALLBACK MyEnumThreadWndProc(HWND hwnd, LPARAM lParam)
{
if (windowInfo.atomWindowType == reinterpret_cast<uint>(WC_DIALOG))
{
SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
// Ensure dialog is not hidden by other applications
SetForegroundWindow(hwnd);
return false;
}
}

0 comments on commit 2c5251a

Please sign in to comment.
You can’t perform that action at this time.