From 6882ae069f9dc1d907dc34bce9025ddcfc128a05 Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 22 Apr 2025 10:22:02 +0800 Subject: [PATCH] enhance: do not show tooltip if the ower window is deactived (#1218) Signed-off-by: leo --- src/App.axaml.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/App.axaml.cs b/src/App.axaml.cs index 9c1d5087..822084dc 100644 --- a/src/App.axaml.cs +++ b/src/App.axaml.cs @@ -368,6 +368,14 @@ namespace SourceGit { BindingPlugins.DataValidators.RemoveAt(0); + // Disable tooltip if window is not active. + ToolTip.ToolTipOpeningEvent.AddClassHandler((c, e) => + { + var topLevel = TopLevel.GetTopLevel(c); + if (topLevel is not Window { IsActive: true }) + e.Cancel = true; + }); + if (TryLaunchAsCoreEditor(desktop)) return;