mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Adjust Flickering code
This commit is contained in:
parent
f3a5365c24
commit
07412313a0
2 changed files with 25 additions and 20 deletions
|
|
@ -244,6 +244,8 @@ namespace Flow.Launcher
|
||||||
{
|
{
|
||||||
_settings.WindowLeft = Left;
|
_settings.WindowLeft = Left;
|
||||||
_settings.WindowTop = Top;
|
_settings.WindowTop = Top;
|
||||||
|
ClockPanel.Opacity = 0;
|
||||||
|
SearchIcon.Opacity = 0;
|
||||||
//This condition stops extra hide call when animator is on,
|
//This condition stops extra hide call when animator is on,
|
||||||
// which causes the toggling to occasional hide instead of show.
|
// which causes the toggling to occasional hide instead of show.
|
||||||
if (_viewModel.MainWindowVisibilityStatus)
|
if (_viewModel.MainWindowVisibilityStatus)
|
||||||
|
|
@ -252,6 +254,7 @@ namespace Flow.Launcher
|
||||||
// This also stops the mainwindow from flickering occasionally after Settings window is opened
|
// This also stops the mainwindow from flickering occasionally after Settings window is opened
|
||||||
// and always after Settings window is closed.
|
// and always after Settings window is closed.
|
||||||
if (_settings.UseAnimation)
|
if (_settings.UseAnimation)
|
||||||
|
|
||||||
await Task.Delay(100);
|
await Task.Delay(100);
|
||||||
|
|
||||||
if (_settings.HideWhenDeactivated && !_viewModel.ExternalPreviewVisible)
|
if (_settings.HideWhenDeactivated && !_viewModel.ExternalPreviewVisible)
|
||||||
|
|
|
||||||
|
|
@ -1410,26 +1410,6 @@ namespace Flow.Launcher.ViewModel
|
||||||
SelectedResults = Results;
|
SelectedResults = Results;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Application.Current.MainWindow is MainWindow mainWindow)
|
|
||||||
{
|
|
||||||
// 📌 아이콘과 시계 Opacity를 0으로 설정하고 Visibility.Hidden 적용
|
|
||||||
Application.Current.Dispatcher.Invoke(() =>
|
|
||||||
{
|
|
||||||
mainWindow.ClockPanel.Opacity = 0;
|
|
||||||
mainWindow.SearchIcon.Opacity = 0;
|
|
||||||
mainWindow.ClockPanel.Visibility = Visibility.Hidden;
|
|
||||||
//mainWindow.SearchIcon.Visibility = Visibility.Hidden;
|
|
||||||
SearchIconVisibility = Visibility.Hidden;
|
|
||||||
|
|
||||||
// 강제 UI 업데이트
|
|
||||||
mainWindow.ClockPanel.UpdateLayout();
|
|
||||||
mainWindow.SearchIcon.UpdateLayout();
|
|
||||||
}, DispatcherPriority.Render);
|
|
||||||
|
|
||||||
// 📌 DWM Cloak 적용 (창을 완전히 숨김)
|
|
||||||
Win32Helper.DWMSetCloakForWindow(mainWindow, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 📌 텍스트 초기화 즉시 적용 + UI 강제 업데이트
|
// 📌 텍스트 초기화 즉시 적용 + UI 강제 업데이트
|
||||||
if (Settings.LastQueryMode == LastQueryMode.Empty)
|
if (Settings.LastQueryMode == LastQueryMode.Empty)
|
||||||
{
|
{
|
||||||
|
|
@ -1468,7 +1448,29 @@ namespace Flow.Launcher.ViewModel
|
||||||
// ShowWindow(hWnd, SW_HIDE);
|
// ShowWindow(hWnd, SW_HIDE);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
if (Application.Current.MainWindow is MainWindow mainWindow)
|
||||||
|
{
|
||||||
|
// 📌 아이콘과 시계 Opacity를 0으로 설정하고 Visibility.Hidden 적용
|
||||||
|
Application.Current.Dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
|
mainWindow.ClockPanel.Opacity = 0;
|
||||||
|
mainWindow.SearchIcon.Opacity = 0;
|
||||||
|
mainWindow.ClockPanel.Visibility = Visibility.Hidden;
|
||||||
|
//mainWindow.SearchIcon.Visibility = Visibility.Hidden;
|
||||||
|
SearchIconVisibility = Visibility.Hidden;
|
||||||
|
|
||||||
|
// 강제 UI 업데이트
|
||||||
|
mainWindow.ClockPanel.UpdateLayout();
|
||||||
|
mainWindow.SearchIcon.UpdateLayout();
|
||||||
|
}, DispatcherPriority.Render);
|
||||||
|
|
||||||
|
// 📌 DWM Cloak 적용 (창을 완전히 숨김)
|
||||||
|
Win32Helper.DWMSetCloakForWindow(mainWindow, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
await Task.Delay(50);
|
||||||
// WPF 속성 업데이트
|
// WPF 속성 업데이트
|
||||||
|
//MainWindowOpacity = 0;
|
||||||
MainWindowVisibilityStatus = false;
|
MainWindowVisibilityStatus = false;
|
||||||
MainWindowVisibility = Visibility.Collapsed;
|
MainWindowVisibility = Visibility.Collapsed;
|
||||||
VisibilityChanged?.Invoke(this, new VisibilityChangedEventArgs { IsVisible = false });
|
VisibilityChanged?.Invoke(this, new VisibilityChangedEventArgs { IsVisible = false });
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue