Skip to content

Fix: Apps list scrollbar on Windows 10 when content fits window - #104

Merged
G-Stas merged 3 commits into
G-Stas:mainfrom
ElektroStudios:fix/win10-mixer-scrollbar
Oct 28, 2026
Merged

G-Stas merged 3 commits into
G-Stas:mainfrom
ElektroStudios:fix/win10-mixer-scrollbar

Conversation

@ElektroStudios

@ElektroStudios ElektroStudios commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR addresses a visual glitch specifically occurring on Windows 10, where a vertical scrollbar consistently appears in the apps list when multiple applications (2 or more) are active, even though there is enough theoretical space to display them without scrolling.

It appears related to how borderless WindowChrome calculates the client area on Windows 10, which might slightly truncate available space due to invisible resizing borders, possibly related to the WPF behavior noted in issue #3887:

First, the sizes for the window frame are not correct... the transparent side non-client frames are not being taken into account.

To work around this potential discrepancy:

  • Added a +2 pixel compensation to the apps height calculation in MixerView.MeasureHeights to absorb sub-pixel rendering discrepancies.
  • Wrapped this adjustment in an OS version check (Build < 22000) so it applies to Windows 10, keeping the native Windows 11 rendering behavior completely untouched.

Visual Comparison (Windows 10)

❌ Before ✅ After
before after

@G-Stas G-Stas left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks for catching this! I’m not sure about a hardcoded value +2 though. The gap probably changes with display scaling, and the pop-up and window modes have different borders too. Could you measure the actual difference in MainView.FitHeight instead (window Height minus the content’s ActualHeight) and add that? Then you wouldn’t need the Windows version check either. And please keep the old comment in MeasureHeights.

@G-Stas G-Stas added the bug Something isn't working label Oct 27, 2026
@ElektroStudios

ElektroStudios commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks for catching this! I’m not sure about a hardcoded value +2 though. The gap probably changes with display scaling, and the pop-up and window modes have different borders too. Could you measure the actual difference in MainView.FitHeight instead (window Height minus the content’s ActualHeight) and add that? Then you wouldn’t need the Windows version check either. And please keep the old comment in MeasureHeights.

You were absolutely right, thanks. I've reverted MixerView.MeasureHeights to its original state (old comment kept) and moved the fix into MainView.FitHeight.

FitHeight now measures the gap between the window and its content (Height minus content.ActualHeight) and adds it to the target height, so the hardcoded +2 and the Windows version check are gone. At 125% scaling the gap I measured is 1.6 DIPs (2 physical pixels), the same in both pop-up and window modes. Since it is a fixed number of physical pixels, a constant in DIPs can't match it at every scale. The gap is read before Height is overwritten: afterwards Height already holds the new target while content.ActualHeight still reflects the previous layout pass, so the difference would be meaningless.

While testing at 125% I found that this gap was not the only cause of the scrollbar. In window mode the title bar (48 DIPs) counted against the max limit (workAreaHeight * MaxShareOfWorkArea). The requested height (527.2) exceeded the limit (494.4), so the window was clamped and the apps list was left without enough room (viewport 229.6 vs. extent 262.4). The limit now applies to the content, with the title bar added on top. In pop-up mode there is no title bar, so nothing changes there.

Tested on Windows 10 in both pop-up and window modes:

  • 96 DPI (100% scaling)
  • 120 DPI (125% scaling)
  • Custom OS text scale factor (105% and 110%)
  • 1, 2, 3, 4 and 5 apps in the list

With 1, 2, 3 and 4 apps there is no scrollbar in any of these. With 5 apps there is none at 96 DPI, but there is one at 125%. That one is expected: the requested height (592.8 DIPs) exceeds the cap (542.4 DIPs, 60% of the work area plus the title bar), and a given screen has fewer DIPs at 125%, so the list scrolls instead of growing past the limit.

@ElektroStudios
ElektroStudios requested a review from G-Stas October 28, 2026 00:15
@G-Stas
G-Stas merged commit f697c29 into G-Stas:main Oct 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants