Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tooltip after closing window, update ManagedShell #709

Merged
merged 2 commits into from
Nov 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion RetroBar/RetroBar.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

<ItemGroup>
<PackageReference Include="gong-wpf-dragdrop" Version="3.1.1" />
<PackageReference Include="ManagedShell" Version="0.0.225" />
<PackageReference Include="ManagedShell" Version="0.0.231" />
<PackageReference Include="System.Net.Http.Json" Version="6.0.0" />
</ItemGroup>

Expand Down
1 change: 1 addition & 0 deletions RetroBar/Taskbar.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
LocationChanged="Taskbar_OnLocationChanged"
SizeChanged="Taskbar_OnSizeChanged"
MouseLeftButtonDown="Taskbar_OnMouseLeftButtonDown"
Deactivated="Taskbar_Deactivated"
AllowDrop="True"
Style="{DynamicResource TaskbarWindow}">
<Window.Resources>
Expand Down
17 changes: 16 additions & 1 deletion RetroBar/Taskbar.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,16 @@ private void Taskbar_OnSizeChanged(object sender, SizeChangedEventArgs e)
StartButton?.UpdateFloatingStartCoordinates();
}

private void Taskbar_Deactivated(object sender, EventArgs e)
{
if (AppBarMode != AppBarMode.AutoHide)
{
// Prevent focus indicators and tooltips while not the active window
// When auto-hide is enabled, this is performed by auto-hide events instead
ResetControlFocus();
}
}

private void DateTimeMenuItem_OnClick(object sender, RoutedEventArgs e)
{
ShellHelper.StartProcess("timedate.cpl");
Expand Down Expand Up @@ -334,6 +344,11 @@ private void ExitMenuItem_OnClick(object sender, RoutedEventArgs e)
}
}

private void ResetControlFocus()
{
FocusDummyButton.MoveFocus(new TraversalRequest(FocusNavigationDirection.Left));
}

protected override bool ShouldAllowAutoHide()
{
return (!_startMenuOpen || !Screen.Primary) && base.ShouldAllowAutoHide();
Expand Down Expand Up @@ -376,7 +391,7 @@ protected override void OnAutoHideAnimationBegin(bool isHiding)
base.OnAutoHideAnimationBegin(isHiding);

// Prevent focus indicators and tooltips while hidden
FocusDummyButton.MoveFocus(new TraversalRequest(FocusNavigationDirection.Left));
ResetControlFocus();
}

private void ContextMenu_Opened(object sender, RoutedEventArgs e)
Expand Down