Skip to content

Commit b0eac5c

Browse files
committed
refactor: remove unused WaitAndMaximizeWindow function
1 parent 32f2e40 commit b0eac5c

File tree

1 file changed

+1
-37
lines changed

1 file changed

+1
-37
lines changed

winguake.ahk

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -624,42 +624,6 @@ BackupMaximizeWindow(appKey) {
624624
}
625625
}
626626

627-
; 简单的窗口最大化备用方案(适用于不支持启动时最大化的应用)
628-
WaitAndMaximizeWindow(appKey) {
629-
if (!Apps.Has(appKey)) {
630-
return
631-
}
632-
633-
appConfig := Apps[appKey]
634-
windows := GetAppWindows(appConfig.exe)
635-
636-
if (windows.Length > 0) {
637-
firstWindow := windows[1]
638-
try {
639-
WinActivate(firstWindow)
640-
Sleep(100)
641-
WinMaximize(firstWindow)
642-
ShowNotification("" . appConfig.name . " maximized as fallback")
643-
}
644-
catch as e {
645-
ShowNotification("Failed to maximize " . appConfig.name . ": " . e.message)
646-
}
647-
} else {
648-
; 简单重试一次
649-
static retryCount := Map()
650-
if (!retryCount.Has(appKey)) {
651-
retryCount[appKey] := 0
652-
}
653-
654-
retryCount[appKey]++
655-
if (retryCount[appKey] < 2) {
656-
SetTimer(() => WaitAndMaximizeWindow(appKey), -2000)
657-
} else {
658-
retryCount.Delete(appKey)
659-
}
660-
}
661-
}
662-
663627
; 启动应用程序
664628
LaunchApp(appKey, *) {
665629
if (!Apps.Has(appKey)) {
@@ -833,4 +797,4 @@ GenerateStartupNotification() {
833797
}
834798

835799
MsgBox(SCRIPT_NAME . " is running `n`n" . appList, "Startup Notification - " . SCRIPT_NAME, "T15")
836-
}
800+
}

0 commit comments

Comments
 (0)