Skip to content

Plus Edition. Incorrect window position restoration after returning from the maximized state. #1804

@Alex564Alex

Description

@Alex564Alex

Sequence of actions:

  1. Child window. Left > 0 and Top > 0.
  2. Maximize the window to full screen.
  3. Restore the window position to the previous state.
    Left = 0 and Top = 0. That is, the previous position is not restored.

Source code:

        private void Child_MaximizedChanged(object sender, EventArgs e) {
		...
                WindowContainerChildData initialData = (WindowContainerChildData)windowControl.InitialData;
                windowControl.Left = initialData.Left;
                windowControl.Top = initialData.Top;
                windowControl.Width = initialData.Width;
                windowControl.Height = initialData.Height;
                windowControl.UpdateLayout();
                windowControl.Left = this.GetRestrictedLeft(windowControl);
                windowControl.Top = this.GetRestrictedTop(windowControl);
            }
        }

Corrected code:

        private void Child_MaximizedChanged(object sender, EventArgs e) {
		...
                WindowContainerChildData initialData = (WindowContainerChildData)windowControl.InitialData;
                windowControl.Width = initialData.Width;
                windowControl.Height = initialData.Height;
                windowControl.UpdateLayout();
                windowControl.Left = initialData.Left;
                windowControl.Top = initialData.Top;
                windowControl.Left = this.GetRestrictedLeft(windowControl);
                windowControl.Top = this.GetRestrictedTop(windowControl);
            }
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions