mirror of
https://github.com/greenshot/greenshot
synced 2025-07-14 00:53:51 -07:00
Fixed a small invisible issue: the context menu is show 2x when clicking the NotifyIcon. This causes some code to be run 2x, decreasing the context-menu performance.
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2193 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
afbe046d3e
commit
703ecbf143
2 changed files with 7 additions and 5 deletions
2
Greenshot/Forms/MainForm.Designer.cs
generated
2
Greenshot/Forms/MainForm.Designer.cs
generated
|
@ -244,7 +244,7 @@ namespace Greenshot {
|
||||||
//
|
//
|
||||||
this.notifyIcon.ContextMenuStrip = this.contextMenu;
|
this.notifyIcon.ContextMenuStrip = this.contextMenu;
|
||||||
this.notifyIcon.Text = "Greenshot";
|
this.notifyIcon.Text = "Greenshot";
|
||||||
this.notifyIcon.Click += new System.EventHandler(this.NotifyIconClick);
|
this.notifyIcon.MouseUp += new System.Windows.Forms.MouseEventHandler(this.NotifyIconClick);
|
||||||
//
|
//
|
||||||
// backgroundWorkerTimer
|
// backgroundWorkerTimer
|
||||||
//
|
//
|
||||||
|
|
|
@ -1084,9 +1084,11 @@ namespace Greenshot {
|
||||||
new BugReportForm(exceptionText).ShowDialog();
|
new BugReportForm(exceptionText).ShowDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void NotifyIconClick(object sender, EventArgs eventArgs) {
|
private void NotifyIconClick(object sender, MouseEventArgs e) {
|
||||||
MethodInfo oMethodInfo = typeof(NotifyIcon).GetMethod("ShowContextMenu", BindingFlags.Instance | BindingFlags.NonPublic);
|
if (e.Button == MouseButtons.Left) {
|
||||||
oMethodInfo.Invoke(notifyIcon, null);
|
MethodInfo oMethodInfo = typeof(NotifyIcon).GetMethod("ShowContextMenu", BindingFlags.Instance | BindingFlags.NonPublic);
|
||||||
|
oMethodInfo.Invoke(notifyIcon, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue