mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-06 05:05:42 +13:00
Workaround for tray menu close issue
This commit is contained in:
parent
f23202d7ff
commit
1b51f42024
2 changed files with 12 additions and 7 deletions
1
ShareX/Forms/MainForm.Designer.cs
generated
1
ShareX/Forms/MainForm.Designer.cs
generated
|
@ -1804,6 +1804,7 @@ private void InitializeComponent()
|
||||||
this.tsmiTrayExit.Image = global::ShareX.Properties.Resources.cross_button;
|
this.tsmiTrayExit.Image = global::ShareX.Properties.Resources.cross_button;
|
||||||
this.tsmiTrayExit.Name = "tsmiTrayExit";
|
this.tsmiTrayExit.Name = "tsmiTrayExit";
|
||||||
resources.ApplyResources(this.tsmiTrayExit, "tsmiTrayExit");
|
resources.ApplyResources(this.tsmiTrayExit, "tsmiTrayExit");
|
||||||
|
this.tsmiTrayExit.Click += new System.EventHandler(this.tsmiTrayExit_Click);
|
||||||
this.tsmiTrayExit.MouseDown += new System.Windows.Forms.MouseEventHandler(this.tsmiTrayExit_MouseDown);
|
this.tsmiTrayExit.MouseDown += new System.Windows.Forms.MouseEventHandler(this.tsmiTrayExit_MouseDown);
|
||||||
//
|
//
|
||||||
// timerTraySingleClick
|
// timerTraySingleClick
|
||||||
|
|
|
@ -43,7 +43,7 @@ public partial class MainForm : HotkeyForm
|
||||||
{
|
{
|
||||||
public bool IsReady { get; private set; }
|
public bool IsReady { get; private set; }
|
||||||
|
|
||||||
private bool forceClose, firstUpdateCheck = true;
|
private bool forceClose, trayMenuSaveSettings = true, firstUpdateCheck = true;
|
||||||
private UploadInfoManager uim;
|
private UploadInfoManager uim;
|
||||||
private ToolStripDropDownItem tsmiImageFileUploaders, tsmiTrayImageFileUploaders, tsmiTextFileUploaders, tsmiTrayTextFileUploaders;
|
private ToolStripDropDownItem tsmiImageFileUploaders, tsmiTrayImageFileUploaders, tsmiTextFileUploaders, tsmiTrayTextFileUploaders;
|
||||||
private System.Threading.Timer updateTimer;
|
private System.Threading.Timer updateTimer;
|
||||||
|
@ -1317,19 +1317,23 @@ private void tsmiTrayShow_Click(object sender, EventArgs e)
|
||||||
|
|
||||||
private void tsmiTrayExit_MouseDown(object sender, MouseEventArgs e)
|
private void tsmiTrayExit_MouseDown(object sender, MouseEventArgs e)
|
||||||
{
|
{
|
||||||
forceClose = true;
|
trayMenuSaveSettings = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void cmsTray_Closed(object sender, ToolStripDropDownClosedEventArgs e)
|
private void cmsTray_Closed(object sender, ToolStripDropDownClosedEventArgs e)
|
||||||
{
|
{
|
||||||
if (forceClose)
|
if (trayMenuSaveSettings)
|
||||||
{
|
|
||||||
Close();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
Program.SaveAllSettingsAsync();
|
Program.SaveAllSettingsAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
trayMenuSaveSettings = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void tsmiTrayExit_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
forceClose = true;
|
||||||
|
Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Tray events
|
#endregion Tray events
|
||||||
|
|
Loading…
Reference in a new issue