mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 10:16:24 +02:00
[MWB]Update the service's path on a new install (#27361)
* [MWB]Update service path between installs * Show only the new message forcibly
This commit is contained in:
@@ -735,7 +735,7 @@ namespace MouseWithoutBorders
|
||||
SendPackage(src, PackageType.ClipboardCapture);
|
||||
}
|
||||
|
||||
internal static void ShowToolTip(string tip, int timeOutInMilliseconds = 5000, ToolTipIcon icon = ToolTipIcon.Info, bool showBalloonTip = true)
|
||||
internal static void ShowToolTip(string tip, int timeOutInMilliseconds = 5000, ToolTipIcon icon = ToolTipIcon.Info, bool showBalloonTip = true, bool forceEvenIfHidingOldUI = false)
|
||||
{
|
||||
if (!Common.RunOnLogonDesktop && !Common.RunOnScrSaverDesktop)
|
||||
{
|
||||
@@ -752,7 +752,7 @@ namespace MouseWithoutBorders
|
||||
{
|
||||
if (MainForm != null)
|
||||
{
|
||||
MainForm.ShowToolTip(tip, timeOutInMilliseconds);
|
||||
MainForm.ShowToolTip(tip, timeOutInMilliseconds, forceEvenIfHidingOldUI: forceEvenIfHidingOldUI);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -46,6 +46,8 @@ namespace MouseWithoutBorders.Class
|
||||
|
||||
private static readonly string ServiceModeArg = "UseService";
|
||||
|
||||
public static bool ShowServiceModeErrorTooltip;
|
||||
|
||||
[STAThread]
|
||||
private static void Main()
|
||||
{
|
||||
@@ -98,6 +100,7 @@ namespace MouseWithoutBorders.Class
|
||||
{
|
||||
Common.Log("Couldn't start the service. Will try to continue as not a service.");
|
||||
Common.Log(ex);
|
||||
ShowServiceModeErrorTooltip = true;
|
||||
serviceMode = false;
|
||||
Setting.Values.UseService = false;
|
||||
}
|
||||
|
||||
@@ -893,11 +893,23 @@ namespace MouseWithoutBorders
|
||||
}
|
||||
}
|
||||
|
||||
internal void ShowToolTip(string txt, int timeOutInMilliseconds, ToolTipIcon icon = ToolTipIcon.Info)
|
||||
internal void ShowToolTip(string txt, int timeOutInMilliseconds, ToolTipIcon icon = ToolTipIcon.Info, bool forceEvenIfHidingOldUI = false)
|
||||
{
|
||||
if (!Common.RunOnLogonDesktop && !Common.RunOnScrSaverDesktop)
|
||||
{
|
||||
var oldNotifyVisibility = NotifyIcon.Visible;
|
||||
|
||||
// In order to show tooltips, the icon needs to be shown.
|
||||
if (forceEvenIfHidingOldUI)
|
||||
{
|
||||
NotifyIcon.Visible = true;
|
||||
}
|
||||
|
||||
NotifyIcon.ShowBalloonTip(timeOutInMilliseconds, Application.ProductName, txt, icon);
|
||||
if (forceEvenIfHidingOldUI)
|
||||
{
|
||||
NotifyIcon.Visible = oldNotifyVisibility;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -939,6 +951,11 @@ namespace MouseWithoutBorders
|
||||
NotifyIcon.Visible = false;
|
||||
NotifyIcon.Visible = Setting.Values.ShowOriginalUI;
|
||||
}
|
||||
|
||||
if (Program.ShowServiceModeErrorTooltip)
|
||||
{
|
||||
Common.ShowToolTip("Couldn't start the service. Will continue as not a service. Service mode must be enabled in the Settings again.", 10000, forceEvenIfHidingOldUI: true);
|
||||
}
|
||||
}
|
||||
|
||||
private void MenuAbout_Click(object sender, EventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user