런처와 트레이 지연 생성으로 유휴 CPU 추가 절감
Some checks failed
Release Gate / gate (push) Has been cancelled

앱 시작 시 LauncherWindow 전체를 미리 생성하지 않고 실제로 런처를 열 때만 만들도록 변경했습니다.

트레이 메뉴 PrepareForDisplay 사전 렌더도 제거해 사용하지 않는 팝업 레이아웃 계산이 부팅 직후 돌지 않게 정리했습니다.

README와 DEVELOPMENT 문서를 2026-04-06 17:43(KST) 기준으로 갱신했고 Release 빌드에서 경고 0 오류 0을 확인했습니다.
This commit is contained in:
2026-04-06 17:40:39 +09:00
parent 353c5ce471
commit 7889189e41
3 changed files with 18 additions and 9 deletions

View File

@@ -14,6 +14,7 @@ public partial class App : System.Windows.Application
private System.Threading.Mutex? _singleInstanceMutex;
private InputListener? _inputListener;
private LauncherWindow? _launcher;
private LauncherViewModel? _launcherViewModel;
private NotifyIcon? _trayIcon;
private Views.TrayMenuWindow? _trayMenu;
private SettingsService? _settings;
@@ -277,11 +278,7 @@ public partial class App : System.Windows.Application
_pluginHost = pluginHost;
// ─── 런처 윈도우 ──────────────────────────────────────────────────────
var vm = new LauncherViewModel(commandResolver, settings);
_launcher = new LauncherWindow(vm)
{
OpenSettingsAction = OpenSettings
};
_launcherViewModel = new LauncherViewModel(commandResolver, settings);
// ─── 클립보드 히스토리 초기화 (메시지 펌프 시작 직후 — 런처 표시 불필요) ──
Dispatcher.BeginInvoke(
@@ -625,10 +622,6 @@ public partial class App : System.Windows.Application
: System.Windows.Visibility.Collapsed;
};
Dispatcher.BeginInvoke(
() => _trayMenu?.PrepareForDisplay(),
System.Windows.Threading.DispatcherPriority.ApplicationIdle);
// 우클릭 → WPF 메뉴 표시, 좌클릭 → 런처 토글
_trayIcon.MouseClick += (_, e) =>
{
@@ -695,11 +688,22 @@ public partial class App : System.Windows.Application
private void ShowLauncherWindow()
{
EnsureLauncherCreated();
if (_launcher == null) return;
EnsureIndexWarmupStarted();
_launcher.Show();
}
private void EnsureLauncherCreated()
{
if (_launcher != null || _launcherViewModel == null) return;
_launcher = new LauncherWindow(_launcherViewModel)
{
OpenSettingsAction = OpenSettings
};
}
private void OpenAiChat()
{
if (_settings == null) return;