Skip to content

Commit 8baf1d4

Browse files
committed
Prevent window height updates when exiting snap state and adjust border brush style
1 parent 2b4e95e commit 8baf1d4

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -495,19 +495,20 @@ private async void OnContextMenusForSettingsClick(object sender, RoutedEventArgs
495495
private const int SC_MAXIMIZE = 0xF030;
496496
private const int SC_RESTORE = 0xF120;
497497
private const int SC_MINIMIZE = 0xF020;
498-
499-
private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
500-
{
501-
if (msg == Win32Helper.WM_ENTERSIZEMOVE)
502-
{
503-
_initialWidth = (int)Width;
498+
private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
499+
{
500+
if (msg == Win32Helper.WM_ENTERSIZEMOVE)
501+
{
502+
_initialWidth = (int)Width;
504503
_initialHeight = (int)Height;
505-
506504
handled = true;
507505
}
508506
else if (msg == Win32Helper.WM_EXITSIZEMOVE)
509507
{
510-
if (_initialHeight != (int)Height)
508+
//Prevent updating the number of results when the window height is below the height of a single result item.
509+
//This situation occurs not only when the user manually resizes the window, but also when the window is released from a side snap, as the OS automatically adjusts the window height.
510+
//(Without this check, releasing from a snap can cause the window height to hit the minimum, resulting in only 2 results being shown.)
511+
if (_initialHeight != (int)Height && Height> (_settings.WindowHeightSize + _settings.ItemHeightSize))
511512
{
512513
if (!_settings.KeepMaxResults)
513514
{
@@ -533,6 +534,11 @@ private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref b
533534

534535
SizeToContent = SizeToContent.Height;
535536
}
537+
else
538+
{
539+
// Update height when exiting maximized snap state.
540+
SizeToContent = SizeToContent.Height;
541+
}
536542

537543
if (_initialWidth != (int)Width)
538544
{

Flow.Launcher/Themes/Win11Light.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,9 @@
7373
BasedOn="{StaticResource BaseWindowBorderStyle}"
7474
TargetType="{x:Type Border}">
7575
<Setter Property="BorderThickness" Value="1" />
76-
<Setter Property="BorderBrush" Value="{DynamicResource SystemThemeBorder}" />
76+
<Setter Property="BorderBrush" Value="{m:DynamicColor SystemControlBackgroundChromeMediumBrush}" />
7777
<Setter Property="Background" Value="{DynamicResource Color01B}" />
78+
<Setter Property="CornerRadius" Value="8" />
7879
<Setter Property="UseLayoutRounding" Value="True" />
7980
</Style>
8081
<Style

0 commit comments

Comments
 (0)