유휴 CPU 사용을 줄이도록 전역 훅과 스케줄 타이머 조건부 활성화로 정리
Some checks failed
Release Gate / gate (push) Has been cancelled
Some checks failed
Release Gate / gate (push) Has been cancelled
앱 시작 시 파일 대화상자 통합이 꺼져 있어도 시스템 전역 WinEvent 훅을 항상 걸던 구조를 수정해, 설정이 켜져 있을 때만 FileDialogWatcher가 시작되도록 바꿨다. 설정 저장 시 watcher와 스케줄러 상태를 즉시 다시 계산하도록 App 초기화 경로도 함께 보강했다. SchedulerService는 활성 일정이 하나도 없으면 타이머를 만들지 않고, 실행 중 일정이 모두 비활성화되면 스스로 정지하도록 Refresh 기반 구조로 정리했다. 이 변경으로 런처와 AX Agent 창이 닫힌 유휴 상태에서도 발생하던 불필요한 30초 주기 깨우기와 전역 이벤트 콜백을 줄였다. README와 DEVELOPMENT 문서에 2026-04-06 17:18 (KST) 기준 이력을 반영했고, 표준 검증 빌드(dotnet build src/AxCopilot/AxCopilot.csproj -c Release -v minimal -p:OutputPath=bin\\verify\\ -p:IntermediateOutputPath=obj\\verify\\) 결과 경고 0, 오류 0을 확인했다.
This commit is contained in:
@@ -183,7 +183,7 @@ public partial class App : System.Windows.Application
|
||||
commandResolver.RegisterHandler(new SessionHandler(settings));
|
||||
commandResolver.RegisterHandler(new BatchRenameHandler());
|
||||
_schedulerService = new SchedulerService(settings);
|
||||
_schedulerService.Start();
|
||||
_schedulerService.Refresh();
|
||||
commandResolver.RegisterHandler(new ScheduleHandler(settings));
|
||||
commandResolver.RegisterHandler(new MacroHandler(settings));
|
||||
commandResolver.RegisterHandler(new ContextHandler());
|
||||
@@ -332,7 +332,16 @@ public partial class App : System.Windows.Application
|
||||
() => _launcher.SetInputText("cd "));
|
||||
});
|
||||
};
|
||||
_fileDialogWatcher.Start();
|
||||
UpdateFileDialogWatcherState();
|
||||
|
||||
settings.SettingsChanged += (_, _) =>
|
||||
{
|
||||
Dispatcher.BeginInvoke(() =>
|
||||
{
|
||||
UpdateFileDialogWatcherState();
|
||||
_schedulerService?.Refresh();
|
||||
});
|
||||
};
|
||||
|
||||
// 독 바 자동 표시
|
||||
if (settings.Settings.Launcher.DockBarAutoShow)
|
||||
@@ -621,6 +630,10 @@ public partial class App : System.Windows.Application
|
||||
: System.Windows.Visibility.Collapsed;
|
||||
};
|
||||
|
||||
Dispatcher.BeginInvoke(
|
||||
() => _trayMenu?.PrepareForDisplay(),
|
||||
System.Windows.Threading.DispatcherPriority.ApplicationIdle);
|
||||
|
||||
// 우클릭 → WPF 메뉴 표시, 좌클릭 → 런처 토글
|
||||
_trayIcon.MouseClick += (_, e) =>
|
||||
{
|
||||
@@ -944,6 +957,7 @@ public partial class App : System.Windows.Application
|
||||
_chatWindow?.ForceClose(); // 미리 생성된 ChatWindow 진짜 닫기
|
||||
_inputListener?.Dispose();
|
||||
_clipboardHistory?.Dispose();
|
||||
_fileDialogWatcher?.Dispose();
|
||||
_indexService?.Dispose();
|
||||
_schedulerService?.Dispose();
|
||||
_sessionTracking?.Dispose();
|
||||
@@ -954,4 +968,18 @@ public partial class App : System.Windows.Application
|
||||
LogService.Info("=== AX Copilot 종료 ===");
|
||||
base.OnExit(e);
|
||||
}
|
||||
|
||||
private void UpdateFileDialogWatcherState()
|
||||
{
|
||||
if (_fileDialogWatcher == null || _settings == null)
|
||||
return;
|
||||
|
||||
if (_settings.Settings.Launcher.EnableFileDialogIntegration)
|
||||
{
|
||||
_fileDialogWatcher.Start();
|
||||
return;
|
||||
}
|
||||
|
||||
_fileDialogWatcher.Stop();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user