Skip to content

Conversation

@Elemecca
Copy link
Contributor

@Elemecca Elemecca commented Dec 6, 2025

This is another attempt to fix the DPI scaling issues seen in #868.

MainWindow::GetFontPref was attempting to apply DPI scaling to the font sizes it returns, which was causing double scaling of everything but the default font since ImGui now handles font scaling on its own in ImGui::PushFont. The double scaling was inconsistent because we sometimes passed the size from GetFontPref to ImDrawList::AddText, which does not perform font scaling, so text drawn that way was only scaled once. That's what was causing the weird headers in the filter graph: the height of the header was scaled twice but the header text was rendered through ImDrawList and so only scaled once.

This PR fixes the double scaling issue by removing all of the application code which attempts to handle font scaling, leaving that responsibility to ImGui. I also removed everything that attempts to pass fonts explicitly to ImGui calls; now we always use the current font set by ImGui::PushFont when drawing or measuring text. Calls to ImDrawList::AddText now either use the overload that uses the current font or, when that's not possible because we need to pass a wrap width, pass the font using ImGui::GetFont() and ImGui::GetFontSize() to achieve the same result.

That seems to have fixed all of the odd scaling, but I'm still seeing the issue where the Stream Browser and Filter Palette panels are too small. It looks like those are set proportional to the window size, so I think the issue there is actually that we're setting the default window size too small (probably not applying DPI scaling at all). I'm still looking into that.

@Elemecca Elemecca changed the title Dpi scaling Fix DPI scaling on X11 and Windows Dec 6, 2025
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