Skip to content

Fixes #4970 - Dialog arrangement#5033

Merged
tig merged 6 commits intodevelopfrom
fix/dialog-arrangement
Apr 21, 2026
Merged

Fixes #4970 - Dialog arrangement#5033
tig merged 6 commits intodevelopfrom
fix/dialog-arrangement

Conversation

@tig
Copy link
Copy Markdown
Collaborator

@tig tig commented Apr 21, 2026

Fixes

Pull request overview

Addresses #4970 by adjusting how dialogs/views are resized during arrange operations to prevent runaway growth/scrolling behavior.

Changes:

  • Updates ViewManipulator resize paths to set View.Frame atomically (instead of separate X/Y/Width/Height updates) for top/left/right and keyboard resize-from-edge operations.
  • Wraps Dialog scrollbar enabling in Dialog<TResult>.EndInit() with a DIALOG_SCROLLBARS preprocessor guard.

Refactor ViewManipulator to update view geometry by setting the Frame property with C# with-expressions, ensuring atomic position and size changes. Also, defer enabling scrollbars in Dialog<TResult> until after initialization to avoid premature creation.
@tig tig requested a review from Copilot April 21, 2026 01:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Addresses #4970 by adjusting how dialogs/views are resized during arrange operations to prevent runaway growth/scrolling behavior.

Changes:

  • Updates ViewManipulator resize paths to set View.Frame atomically (instead of separate X/Y/Width/Height updates) for top/left/right and keyboard resize-from-edge operations.
  • Wraps Dialog scrollbar enabling in Dialog<TResult>.EndInit() with a DIALOG_SCROLLBARS preprocessor guard.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
Terminal.Gui/Views/DialogTResult.cs Changes when/if dialog scrollbars are enabled after initialization.
Terminal.Gui/ViewBase/Layout/ViewManipulator.cs Adjusts arrange-mode resize logic to update Frame in one operation for certain resize paths.

Comment thread Terminal.Gui/Views/DialogTResult.cs
Comment thread Terminal.Gui/ViewBase/Layout/ViewManipulator.cs
Comment thread Terminal.Gui/ViewBase/Layout/ViewManipulator.cs Outdated
Comment thread Terminal.Gui/ViewBase/Layout/ViewManipulator.cs Outdated
@tig tig requested review from BDisp and YourRobotOverlord April 21, 2026 01:16
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/02a2ce0c-6c9e-450f-b010-c37d3e5a1334

Co-authored-by: tig <585482+tig@users.noreply.github.com>
Copilot finished work on behalf of tig April 21, 2026 01:27
@tig tig merged commit 96dec40 into develop Apr 21, 2026
11 checks passed
@tig tig deleted the fix/dialog-arrangement branch April 21, 2026 02:17
BDisp pushed a commit to BDisp/Terminal.Gui that referenced this pull request Apr 21, 2026
* Refactor view geometry updates to use Frame with-expr

Refactor ViewManipulator to update view geometry by setting the Frame property with C# with-expressions, ensuring atomic position and size changes. Also, defer enabling scrollbars in Dialog<TResult> until after initialization to avoid premature creation.

* Update Terminal.Gui/ViewBase/Layout/ViewManipulator.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fix redundant unary + in ResizeFromTop

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/02a2ce0c-6c9e-450f-b010-c37d3e5a1334

Co-authored-by: tig <585482+tig@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
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.

Resizing of Dialog is broken

4 participants