Skip to content

🐛 auto-show main window on first launch for all desktop platforms - #4697

Merged
guiyanakuang merged 2 commits into
mainfrom
fix/issue-4696-first-launch-show-main-window
Jul 30, 2026
Merged

🐛 auto-show main window on first launch for all desktop platforms#4697
guiyanakuang merged 2 commits into
mainfrom
fix/issue-4696-first-launch-show-main-window

Conversation

@guiyanakuang

Copy link
Copy Markdown
Member

Closes #4696

Summary

On Windows and Linux the first launch showed no window at all: the main window starts hidden and the only first-launch auto-show call lived in the macOS tray view (MacTrayView.Tray()). New users saw nothing but a (possibly overflow-collapsed) tray icon and perceived the app as "not opening".

This PR lifts the first-launch logic into the platform-agnostic CrossPasteWindows composable:

  • firstLaunch && !firstLaunchCompletedshowMainWindow(WindowTrigger.SYSTEM) + setFirstLaunchCompleted(true) now runs on macOS, Windows, and Linux
  • The duplicate block and now-unused injections are removed from MacTrayView

Side effect fixed

setFirstLaunchCompleted(true) was previously macOS-only, so firstLaunchCompleted stayed false forever on Windows/Linux and the blinking TutorialButton (gated on firstLaunchCompleted && config.showTutorial) never appeared there. It now works on all platforms.

Behavior notes

  • The effect is placed after the tray section in CrossPasteWindows, preserving the previous macOS ordering (tray init before window show)
  • On macOS the window now shows even if native tray init throws, which previously would have skipped it — a strict improvement
  • Non-first launches are unchanged: the app still starts hidden in the tray

Testing

  • ./gradlew ktlintFormat clean
  • ./gradlew app:compileKotlinDesktop passes
  • ./gradlew app:desktopTest passes

@guiyanakuang
guiyanakuang merged commit f21776b into main Jul 30, 2026
5 checks passed
@guiyanakuang
guiyanakuang deleted the fix/issue-4696-first-launch-show-main-window branch July 30, 2026 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Main window is never auto-shown on first launch on Windows/Linux

1 participant