CA-245546 - Only the active RDP console is resized when the main XenCenter window is resized

This commit is contained in:
Letsibogo Ramadi 2017-03-03 17:29:19 +00:00
parent 27918a1c02
commit 29a683afc3
3 changed files with 26 additions and 11 deletions

View File

@ -1050,7 +1050,7 @@ namespace XenAdmin.ConsoleView
fullscreenForm.Hide();
fullscreenForm.Dispose();
fullscreenForm = null;
UpdateRDPResolution();
UpdateRDPResolution(true);
}
//Everytime we toggle full screen I'm going to force an unpause to make sure we don't acidentally undock / dock a pause VNC

View File

@ -1384,12 +1384,13 @@ namespace XenAdmin.ConsoleView
return false;
}
private Size oldSize;
public void UpdateRDPResolution(bool fullscreen = false)
{
if (rdpClient == null)
return;
//remove offsets because there is no focus border to accomodate in fullscreen
//no offsets in fullscreen mode because there is no need to accomodate focus border
if (fullscreen)
{
rdpClient.rdpLocationOffset = new Point(0, 0);
@ -1397,8 +1398,11 @@ namespace XenAdmin.ConsoleView
}
else
{
if (oldSize.Equals(this.Size))
return;
rdpClient.rdpLocationOffset = new Point(2, 2);
rdpClient.Reconnect(this.Size.Width - CONSOLE_SIZE_OFFSET, this.Size.Height - CONSOLE_SIZE_OFFSET);
oldSize = new Size(this.Size.Width, this.Size.Height);
}
}
}

View File

@ -1800,6 +1800,7 @@ namespace XenAdmin
ConsolePanel.setCurrentSource((Host)SelectionManager.Selection.First);
UnpauseVNC(e != null && sender == TheTabControl);
}
ConsolePanel.UpdateRDPResolution();
}
else if (t == TabPageCvmConsole)
{
@ -3289,7 +3290,9 @@ namespace XenAdmin
FormWindowState lastState = FormWindowState.Normal;
private void MainWindow_Resize(object sender, EventArgs e)
{
SetSplitterDistance();
TabPage t = TheTabControl.SelectedTab;
if (t == TabPageConsole)
{
if (WindowState != lastState && WindowState != FormWindowState.Minimized)
{
lastState = WindowState;
@ -3297,6 +3300,8 @@ namespace XenAdmin
}
mainWindowResized = true;
}
SetSplitterDistance();
}
private void SetSplitterDistance()
{
@ -3317,14 +3322,20 @@ namespace XenAdmin
}
private void MainWindow_ResizeEnd(object sender, EventArgs e)
{
TabPage t = TheTabControl.SelectedTab;
if (t == TabPageConsole)
{
if (mainWindowResized)
ConsolePanel.UpdateRDPResolution();
mainWindowResized = false;
}
}
private void splitContainer1_SplitterMoved(object sender, SplitterEventArgs e)
{
TabPage t = TheTabControl.SelectedTab;
if (t == TabPageConsole)
ConsolePanel.UpdateRDPResolution();
}
}