mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Tray icon click fix
This commit is contained in:
@@ -39,6 +39,7 @@ namespace GHelper
|
||||
|
||||
static long lastRefresh;
|
||||
static long lastBatteryRefresh;
|
||||
static long lastLostFocus;
|
||||
|
||||
bool isGpuSection = true;
|
||||
|
||||
@@ -88,6 +89,7 @@ namespace GHelper
|
||||
buttonUpdates.Text = Properties.Strings.Updates;
|
||||
|
||||
FormClosing += SettingsForm_FormClosing;
|
||||
Deactivate += SettingsForm_LostFocus;
|
||||
|
||||
buttonSilent.BorderColor = colorEco;
|
||||
buttonBalanced.BorderColor = colorStandard;
|
||||
@@ -212,6 +214,11 @@ namespace GHelper
|
||||
panelPerformance.Focus();
|
||||
}
|
||||
|
||||
private void SettingsForm_LostFocus(object? sender, EventArgs e)
|
||||
{
|
||||
lastLostFocus = DateTimeOffset.Now.ToUnixTimeMilliseconds();
|
||||
}
|
||||
|
||||
private void ButtonBatteryFull_Click(object? sender, EventArgs e)
|
||||
{
|
||||
BatteryControl.ToggleBatteryLimitFull();
|
||||
@@ -881,7 +888,8 @@ namespace GHelper
|
||||
(extraForm != null && extraForm.ContainsFocus) ||
|
||||
(updatesForm != null && updatesForm.ContainsFocus) ||
|
||||
(matrixForm != null && matrixForm.ContainsFocus) ||
|
||||
this.ContainsFocus;
|
||||
this.ContainsFocus ||
|
||||
Math.Abs(DateTimeOffset.Now.ToUnixTimeMilliseconds() - lastLostFocus) < 300;
|
||||
}
|
||||
|
||||
private void SettingsForm_FormClosing(object? sender, FormClosingEventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user