diff --git a/XenAdmin/ConsoleView/XSVNCScreen.cs b/XenAdmin/ConsoleView/XSVNCScreen.cs index 6b77783cf..e5c8ed60e 100644 --- a/XenAdmin/ConsoleView/XSVNCScreen.cs +++ b/XenAdmin/ConsoleView/XSVNCScreen.cs @@ -86,6 +86,7 @@ namespace XenAdmin.ConsoleView private Timer connectionPoller = null; private VM sourceVM = null; + private bool sourceIsPV = false; private readonly Object hostedConsolesLock = new Object(); private List> hostedConsoles = null; @@ -538,7 +539,7 @@ namespace XenAdmin.ConsoleView if (RemoteConsole != null && RemoteConsole.ConsoleControl != null) { RemoteConsole.KeyHandler = this.KeyHandler; - RemoteConsole.SendScanCodes = hasRDP; + RemoteConsole.SendScanCodes = !this.sourceIsPV; RemoteConsole.Scaling = Scaling; RemoteConsole.DisplayBorder = this.displayFocusRectangle; SetKeyboardAndMouseCapture(autoCaptureKeyboardAndMouse); @@ -654,6 +655,8 @@ namespace XenAdmin.ConsoleView if (value != null) { value.PropertyChanged += new PropertyChangedEventHandler(VM_PropertyChanged); + + sourceIsPV = !value.IsHVM; startPolling(); @@ -1009,7 +1012,7 @@ namespace XenAdmin.ConsoleView } else { - v.SendScanCodes = UseSource && hasRDP; + v.SendScanCodes = UseSource && !this.sourceIsPV; v.SourceVM = sourceVM; v.Console = console; v.connect(stream, this.vncPassword); diff --git a/XenAdmin/MainWindow.cs b/XenAdmin/MainWindow.cs index a1776e787..6773be440 100644 --- a/XenAdmin/MainWindow.cs +++ b/XenAdmin/MainWindow.cs @@ -765,6 +765,8 @@ namespace XenAdmin Alert.RemoveAlert(alert => alert.Connection != null && alert.Connection.Equals(connection)); Updates.CheckServerPatches(); Updates.CheckServerVersion(); + + RequestRefreshTreeView(); } void connection_CachePopulated(object sender, EventArgs e) diff --git a/XenModel/XenAPI-Extensions/Role.cs b/XenModel/XenAPI-Extensions/Role.cs index 8c748e812..f483e30eb 100644 --- a/XenModel/XenAPI-Extensions/Role.cs +++ b/XenModel/XenAPI-Extensions/Role.cs @@ -233,12 +233,12 @@ namespace XenAPI if (Helpers.MidnightRideOrGreater(connection)) { - if (connection.Session.IsLocalSuperuser) + if (connection.Session != null && connection.Session.IsLocalSuperuser) return true; foreach (Role role in validRoleList) { - if (connection.Session.Roles.Contains(role)) + if (connection.Session != null && connection.Session.Roles != null && connection.Session.Roles.Contains(role)) return true; } }