mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2025-01-20 07:19:18 +01:00
CA-245546 - Only the active RDP console is resized when the main XenCenter window is resized
This commit is contained in:
parent
27918a1c02
commit
29a683afc3
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1800,6 +1800,7 @@ namespace XenAdmin
|
||||
ConsolePanel.setCurrentSource((Host)SelectionManager.Selection.First);
|
||||
UnpauseVNC(e != null && sender == TheTabControl);
|
||||
}
|
||||
ConsolePanel.UpdateRDPResolution();
|
||||
}
|
||||
else if (t == TabPageCvmConsole)
|
||||
{
|
||||
@ -3289,13 +3290,17 @@ namespace XenAdmin
|
||||
FormWindowState lastState = FormWindowState.Normal;
|
||||
private void MainWindow_Resize(object sender, EventArgs e)
|
||||
{
|
||||
SetSplitterDistance();
|
||||
if(WindowState != lastState && WindowState != FormWindowState.Minimized)
|
||||
TabPage t = TheTabControl.SelectedTab;
|
||||
if (t == TabPageConsole)
|
||||
{
|
||||
lastState = WindowState;
|
||||
ConsolePanel.UpdateRDPResolution();
|
||||
if (WindowState != lastState && WindowState != FormWindowState.Minimized)
|
||||
{
|
||||
lastState = WindowState;
|
||||
ConsolePanel.UpdateRDPResolution();
|
||||
}
|
||||
mainWindowResized = true;
|
||||
}
|
||||
mainWindowResized = true;
|
||||
SetSplitterDistance();
|
||||
}
|
||||
|
||||
private void SetSplitterDistance()
|
||||
@ -3318,14 +3323,20 @@ namespace XenAdmin
|
||||
|
||||
private void MainWindow_ResizeEnd(object sender, EventArgs e)
|
||||
{
|
||||
if (mainWindowResized)
|
||||
ConsolePanel.UpdateRDPResolution();
|
||||
mainWindowResized = false;
|
||||
TabPage t = TheTabControl.SelectedTab;
|
||||
if (t == TabPageConsole)
|
||||
{
|
||||
if (mainWindowResized)
|
||||
ConsolePanel.UpdateRDPResolution();
|
||||
mainWindowResized = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void splitContainer1_SplitterMoved(object sender, SplitterEventArgs e)
|
||||
{
|
||||
ConsolePanel.UpdateRDPResolution();
|
||||
TabPage t = TheTabControl.SelectedTab;
|
||||
if (t == TabPageConsole)
|
||||
ConsolePanel.UpdateRDPResolution();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user