Skip to content

Commit 624fa0e

Browse files
committed
Fix Hide
1 parent 1bfec0a commit 624fa0e

File tree

1 file changed

+20
-22
lines changed

1 file changed

+20
-22
lines changed

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,9 +1422,6 @@ public async void Hide()
14221422
{
14231423
lastHistoryIndex = 1;
14241424

1425-
// Trick for no delay
1426-
//MainWindowOpacity = 0;
1427-
14281425
if (ExternalPreviewVisible)
14291426
CloseExternalPreview();
14301427

@@ -1433,6 +1430,24 @@ public async void Hide()
14331430
SelectedResults = Results;
14341431
}
14351432

1433+
if (Application.Current.MainWindow is MainWindow mainWindow)
1434+
{
1435+
// 📌 아이콘과 시계 Opacity를 0으로 강제 설정하고 Visibility.Hidden 적용 (쿼리 상태와 관계없이 실행)
1436+
Application.Current.Dispatcher.Invoke(() =>
1437+
{
1438+
mainWindow.ClockPanel.Opacity = 0;
1439+
mainWindow.SearchIcon.Opacity = 0;
1440+
mainWindow.ClockPanel.Visibility = Visibility.Hidden;
1441+
mainWindow.SearchIcon.Visibility = Visibility.Hidden;
1442+
1443+
// 강제 UI 업데이트
1444+
mainWindow.ClockPanel.UpdateLayout();
1445+
mainWindow.SearchIcon.UpdateLayout();
1446+
}, DispatcherPriority.Render);
1447+
1448+
await Task.Delay(10); // UI 반영 대기
1449+
}
1450+
14361451
// 📌 텍스트 초기화 즉시 적용 + UI 강제 업데이트
14371452
if (Settings.LastQueryMode == LastQueryMode.Empty)
14381453
{
@@ -1463,25 +1478,9 @@ public async void Hide()
14631478
break;
14641479
}
14651480

1466-
// 📌 DWM Cloak을 사용하여 창 숨김
1467-
if (Application.Current.MainWindow is MainWindow mainWindow)
1481+
if (Application.Current.MainWindow is MainWindow mainWindow2)
14681482
{
1469-
// 📌 아이콘과 시계 Opacity를 0으로 강제 설정하고 Visibility.Hidden 적용
1470-
Application.Current.Dispatcher.Invoke(() =>
1471-
{
1472-
mainWindow.ClockPanel.Opacity = 0;
1473-
mainWindow.SearchIcon.Opacity = 0;
1474-
mainWindow.ClockPanel.Visibility = Visibility.Hidden;
1475-
mainWindow.SearchIcon.Visibility = Visibility.Hidden;
1476-
1477-
// 강제 UI 업데이트
1478-
mainWindow.ClockPanel.UpdateLayout();
1479-
mainWindow.SearchIcon.UpdateLayout();
1480-
}, DispatcherPriority.Render);
1481-
1482-
await Task.Delay(10); // UI 반영 대기
1483-
1484-
IntPtr hWnd = new WindowInteropHelper(mainWindow).Handle;
1483+
IntPtr hWnd = new WindowInteropHelper(mainWindow2).Handle;
14851484

14861485
// 📌 DWM Cloak 활성화
14871486
int cloak = 1;
@@ -1496,7 +1495,6 @@ public async void Hide()
14961495
VisibilityChanged?.Invoke(this, new VisibilityChangedEventArgs { IsVisible = false });
14971496
}
14981497

1499-
15001498
/// <summary>
15011499
/// Checks if Flow Launcher should ignore any hotkeys
15021500
/// </summary>

0 commit comments

Comments
 (0)