From 89d661601f15ec03329d2e99bc0fb4244f599884 Mon Sep 17 00:00:00 2001 From: yankejustin Date: Thu, 19 Mar 2015 11:47:00 -0400 Subject: [PATCH] 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. --- Server/Forms/FrmRemoteDesktop.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Server/Forms/FrmRemoteDesktop.cs b/Server/Forms/FrmRemoteDesktop.cs index a57bfcf5..1cd975f1 100644 --- a/Server/Forms/FrmRemoteDesktop.cs +++ b/Server/Forms/FrmRemoteDesktop.cs @@ -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; } }