Skip to content

Fix InvalidOperationException when resizing the filter splitter on a …#642

Merged
Hirogen merged 2 commits into
Developmentfrom
splitter_exception
Jun 25, 2026
Merged

Fix InvalidOperationException when resizing the filter splitter on a …#642
Hirogen merged 2 commits into
Developmentfrom
splitter_exception

Conversation

@Hirogen

@Hirogen Hirogen commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

…narrow window

Double-clicking or dragging the filter row's splitter while the LogExpert window is narrower than ~730px threw:
InvalidOperationException:
SplitterDistance must be between Panel1MinSize and Width - Panel2MinSize at SplitContainer.set_SplitterDistance at LogWindow.AutoResizeFilterBox

The #560 fix set filterSplitContainer.Panel2MinSize = 726. Under Dock=Fill the parent layout engine forces the container below Panel1MinSize + SplitterWidth + Panel2MinSize, so no splitter distance can honour both minimums. The setter throws (it does not clamp) when handed a value that can't fit, and the old ClampSplitterDistance returned Panel1MinSize anyway via Math.Max.

Replace ClampSplitterDistance with TryClampSplitterDistance, which returns false when both minimums can't fit. AutoResizeFilterBox and OnFilterSplitContainerMouseMove now skip the assignment in that degenerate state, leaving the splitter put.

Tests ported to the Try form plus a regression case pinning the crash geometry (Width 684, Panel2MinSize 726).

BRUNER Patrick and others added 2 commits June 25, 2026 17:06
…narrow window

Double-clicking or dragging the filter row's splitter while the LogExpert window is narrower than ~730px threw:
  InvalidOperationException:
SplitterDistance must be between Panel1MinSize and Width - Panel2MinSize at SplitContainer.set_SplitterDistance at LogWindow.AutoResizeFilterBox

The #560 fix set filterSplitContainer.Panel2MinSize = 726. Under Dock=Fill the parent layout engine forces the container below Panel1MinSize + SplitterWidth + Panel2MinSize, so no splitter distance can honour both minimums.
The setter throws (it does not clamp) when handed a value that can't fit, and the old ClampSplitterDistance returned Panel1MinSize anyway via Math.Max.

Replace ClampSplitterDistance with TryClampSplitterDistance, which returns false when both minimums can't fit. AutoResizeFilterBox and OnFilterSplitContainerMouseMove now skip the assignment in that degenerate state, leaving the splitter put.

Tests ported to the Try form plus a regression case pinning the crash geometry (Width 684, Panel2MinSize 726).
@Hirogen Hirogen merged commit 113ea76 into Development Jun 25, 2026
1 check passed
@Hirogen Hirogen deleted the splitter_exception branch June 25, 2026 15:16
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