Skip to content

Commit

Permalink
b/280783689 Skip rearranging controls when restoring fullscreen (#976)
Browse files Browse the repository at this point in the history
After minimizing and restoring a fullscreen view, we receive
a bogus resize event. If that happens, skip rearranging control.

This fixes a regression introduced in 7105dd6.
  • Loading branch information
jpassing authored May 8, 2023
1 parent 74a6273 commit b3c6d1a
Showing 1 changed file with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -561,13 +561,6 @@ public bool IsConnecting
// Window events.
//---------------------------------------------------------------------

protected override void OnSizeChanged(EventArgs e)
{
base.OnSizeChanged(e);

UpdateLayout(this.Mode);
}

private void RemoteDesktopPane_SizeChanged(object sender, EventArgs e)
{
using (ApplicationTraceSources.Default.TraceMethod().WithParameters(
Expand All @@ -592,11 +585,21 @@ private void RemoteDesktopPane_SizeChanged(object sender, EventArgs e)
return;
}

//
// Rearrange controls based on new size.
//
// NB. If any of the above conditions applied, we must skip
// this step since the size data might be inaccurate.
//
UpdateLayout(this.Mode);

if (this.autoResize)
{
// Do not resize immediately since there might be another resitze
//
// Do not resize immediately since there might be another resize
// event coming in a few miliseconds. Instead, delay the operation
// by deferring it to a timer.
//
this.reconnectToResizeTimer.Start();
}
}
Expand Down

0 comments on commit b3c6d1a

Please sign in to comment.