Skip to content

Commit 2c5251a

Browse files
committed
Fix #1305: "Select device" hides under other program without MTA icon on a taskbar
1 parent f3d80a7 commit 2c5251a

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

Client/loader/MainFunctions.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,7 +1175,6 @@ int LaunchGame(SString strCmdLine)
11751175
BsodDetectionOnGameBegin();
11761176
// Show splash until game window is displayed (or max 20 seconds)
11771177
DWORD status;
1178-
bool bShownDeviceSelectionDialog = false;
11791178
for (uint i = 0; i < 20; i++)
11801179
{
11811180
status = WaitForSingleObject(piLoadee.hProcess, 1000);
@@ -1188,16 +1187,18 @@ int LaunchGame(SString strCmdLine)
11881187
break;
11891188
}
11901189

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

11961197
// Actually hide the splash
11971198
HideSplash();
11981199

11991200
// If hasn't shown the loading screen and gta_sa.exe process memory usage is not changing, give user option to terminate
1200-
if (status == WAIT_TIMEOUT && !bShownDeviceSelectionDialog)
1201+
if (status == WAIT_TIMEOUT)
12011202
{
12021203
CStuckProcessDetector stuckProcessDetector(piLoadee.hProcess, 5000);
12031204
while (status == WAIT_TIMEOUT && WatchDogIsSectionOpen("L3")) // Gets closed when loading screen is shown

Client/loader/Utils.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2155,7 +2155,8 @@ BOOL CALLBACK MyEnumThreadWndProc(HWND hwnd, LPARAM lParam)
21552155
{
21562156
if (windowInfo.atomWindowType == reinterpret_cast<uint>(WC_DIALOG))
21572157
{
2158-
SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
2158+
// Ensure dialog is not hidden by other applications
2159+
SetForegroundWindow(hwnd);
21592160
return false;
21602161
}
21612162
}

0 commit comments

Comments
 (0)