Skip to content

Commit 6882ae0

Browse files
committed
enhance: do not show tooltip if the ower window is deactived (#1218)
Signed-off-by: leo <[email protected]>
1 parent 9c53894 commit 6882ae0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/App.axaml.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,14 @@ public override void OnFrameworkInitializationCompleted()
368368
{
369369
BindingPlugins.DataValidators.RemoveAt(0);
370370

371+
// Disable tooltip if window is not active.
372+
ToolTip.ToolTipOpeningEvent.AddClassHandler<Control>((c, e) =>
373+
{
374+
var topLevel = TopLevel.GetTopLevel(c);
375+
if (topLevel is not Window { IsActive: true })
376+
e.Cancel = true;
377+
});
378+
371379
if (TryLaunchAsCoreEditor(desktop))
372380
return;
373381

0 commit comments

Comments
 (0)