Fixed issue with the Remote Desktop

Fixed an issue where Remote Desktop would not work (threw infinite
InvalidOperationExceptions) because cbMonitors.SelectedIndex was trying
to be accessed on a different thread.
Moved code that gets the SelectedIndex inside the MethodInvoker.
This commit is contained in:
yankejustin 2015-03-19 11:47:00 -04:00
parent 5855fc9adf
commit 89d661601f
1 changed files with 3 additions and 1 deletions

View File

@ -54,12 +54,14 @@ private void GetDesktop()
if (_connectClient.Value.LastDesktopSeen)
{
int Quality = 1;
int SelectedMonitorIndex = 0;
this.Invoke((MethodInvoker)delegate
{
Quality = barQuality.Value;
SelectedMonitorIndex = cbMonitors.SelectedIndex;
});
new Core.Packets.ServerPackets.Desktop(Quality, cbMonitors.SelectedIndex).Execute(_connectClient);
new Core.Packets.ServerPackets.Desktop(Quality, SelectedMonitorIndex).Execute(_connectClient);
_connectClient.Value.LastDesktopSeen = false;
}
}