Skip to content

Conversation

samuelfessahaye
Copy link

Summary of the Pull Request

This pull request fixes an issue where exiting full-screen mode incorrectly restores the console window to the wrong size. Previously, the window reverted to its outer dimensions, which included the title bar and borders, instead of maintaining the correct viewport dimensions. This caused the visible console area to shrink and display scrollbars unnecessarily.

References and Relevant Issues

#351 — Exiting from Full Screen mode incorrectly restores window size

Detailed Description of the Pull Request / Additional comments

The problem occurred because the window size restoration logic relied on the full outer window bounds rather than the inner console area.
This PR modifies the behavior so that:

The window correctly restores the client (viewport) size instead of the outer size when exiting full screen.

The console buffer and viewport remain properly synchronized, avoiding the cascading shrink issue that previously occurred when toggling full screen multiple times.

The update ensures that scrollbars appear only when the buffer exceeds the viewport dimensions, not because of incorrect window sizing.

This change was verified using the mode 80, 25 command, followed by multiple Alt+Enter toggles to enter and exit full-screen mode, ensuring consistent window restoration to 80×25.

Validation Steps Performed

1.) Start cmd.exe

2.) Run mode 80, 25

3.) Enter full-screen mode using Alt + Enter and exit full-screen mode

4.) Verify in Properties and ensure in Layout that the window size remains 80 x 25 (the original dimensions)

5.) Repeat multiple times to confirm that the viewport size is the same and no scrollbars appear

PR Checklist

  • Closes #xxx
  • Tests added/passed
  • Documentation updated
    • If checked, please file a pull request on our docs repo and link it here: #xxx
  • Schema updated (if necessary)

This comment has been minimized.

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant