Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions Source/App/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,6 @@ private void _MonitorFGWindowName() {
}
}


public void MonitorFocusedWindow() {
var thread = new Thread(new ThreadStart(_monitorFocusedWindow));
thread.Start();
Expand Down Expand Up @@ -544,11 +543,24 @@ public void SetupHotKeys() {
this._keyboardHooks.KeyPressed += new EventHandler<KeyPressedEventArgs>(_hotKeyPressed);

// Register all the hotkeys in _keyboardHooksHotKeysAndActions
List<string> hotkeyRegistrationErrors = new List<string>();
foreach(var hotkeyAction in _keyboardHooksHotKeysAndActions) {
this._keyboardHooks.RegisterHotKey(hotkeyAction.Modifiers, hotkeyAction.Keys);
try {
this._keyboardHooks.RegisterHotKey(hotkeyAction.Modifiers, hotkeyAction.Keys);
} catch (InvalidOperationException) {
hotkeyRegistrationErrors.Add($"{hotkeyAction.HotKeyAndAction}");
}
}


if (hotkeyRegistrationErrors.Any()) {
List<string> message = new List<string>();
message.Add("Could not register hotkeys:");
message.Add(Environment.NewLine);
message.AddRange(hotkeyRegistrationErrors);
message.Add(Environment.NewLine);
message.Add("Maybe this hotkey is already registered in another application??");
MessageBox.Show(string.Join(Environment.NewLine, message), "Hotkey Registration Error", MessageBoxButtons.OK);
}
}

private void _hotKeyPressed(object sender, KeyPressedEventArgs e) {
Expand Down Expand Up @@ -649,7 +661,6 @@ public void UIUpdateIcons() {
this.AppForm.notifyIconNumber.Visible = Settings.GetBool("feature.showDesktopNumberInIconTray");
}


public void UIUpdateIconForVDDisplayNumber(string theme, uint number, string name) {
number++;
this.AppForm.notifyIconNumber.Icon = Util.Icons.GenerateNotificationIcon(number.ToString(), theme, this.AppForm.DeviceDpi, false, FontStyle.Bold);
Expand Down
Loading