Skip to content
This repository was archived by the owner on Aug 23, 2025. It is now read-only.

Commit 05b77cc

Browse files
committed
Fixed the tray icon Exit option as well
1 parent 8d6c6f3 commit 05b77cc

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

86BoxManager/frmMain.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,25 +1130,27 @@ private void trayIcon_MouseDoubleClick(object sender, MouseEventArgs e)
11301130

11311131
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
11321132
{
1133-
List<ListViewItem> vms = new List<ListViewItem>();
1133+
//List<ListViewItem> vms = new List<ListViewItem>();
1134+
int vmCount = 0;
11341135
foreach (ListViewItem item in lstVMs.Items)
11351136
{
11361137
VM vm = (VM)item.Tag;
11371138
if (vm.Status != VM.STATUS_STOPPED)
11381139
{
1139-
vms.Add(item);
1140+
vmCount++;
11401141
}
11411142
}
11421143

11431144
//If there are running VMs, display the warning and stop the VMs if user says so
1144-
if (vms.Count > 0)
1145+
if (vmCount > 0)
11451146
{
11461147
DialogResult = MessageBox.Show("It appears some virtual machines are still running. It's recommended you stop them first before closing 86Box Manager. Do you want to stop them now?", "Virtual machines are still running", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning);
11471148
if (DialogResult == DialogResult.Yes)
11481149
{
1149-
foreach (ListViewItem lvi in vms)
1150+
foreach (ListViewItem lvi in lstVMs.Items)
11501151
{
11511152
lvi.Focused = true;
1153+
lvi.Selected = true;
11521154
VMStop();
11531155
}
11541156
Thread.Sleep(1000); //Wait just a bit to make sure everything goes as planned

0 commit comments

Comments
 (0)