Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Qt's High-DPI scaling on Windows #4868

Merged
merged 13 commits into from
May 12, 2024
Merged

Conversation

Nerixyz
Copy link
Contributor

@Nerixyz Nerixyz commented Oct 4, 2023

Description

This switches from manual DPI handling to Qt's DPI handling, as Qt 6 disabled the option to opt-out of high DPI scaling through application attributes. Although this PR mainly fixes Windows bugs, it should be tested on all platforms, as the changes will affect everyone.

Windows now mostly uses the display scaling other platforms used.

You can test the scaling for yourself by setting QT_SCALE_FACTOR to something other than 1.

I'm waiting for #3690 to be merged, as that will fix some font-bugs (although I didn't see any on this branch). This PR should be merged first.

I left out "fixes" for some issues, as they might persist on other platforms.

Stuff to test

One major thing to look out for is the size of the window reported to the OS. You can use something like ShareX to measure the size. Make sure the size is exact (not too large, not too small). Previously, the window was 1px too tall. Some of the testing might need to be done on Qt 5.15 or 6.7 (or later).

  • Check borders on Windows 11 (are they needed?, is the window cut off?)
    • There seems to be a 1-2px border, however, due to QTBUG-124250 we can't adjust the border (yet... 🙏)
  • Check resizing on Windows 11 (is it janky?)
  • Dragging a window across screens
  • Saving the position on high-dpi screens (Startup size scaling issue #2348)

@Nerixyz Nerixyz force-pushed the fix/dpi branch 2 times, most recently from 2636eeb to 70dbcc5 Compare October 5, 2023 10:41
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

src/widgets/Label.cpp Outdated Show resolved Hide resolved
src/widgets/dialogs/SettingsDialog.cpp Show resolved Hide resolved
src/widgets/helper/ChannelView.cpp Outdated Show resolved Hide resolved
src/widgets/helper/ChannelView.cpp Outdated Show resolved Hide resolved
src/widgets/helper/ChannelView.cpp Outdated Show resolved Hide resolved
src/widgets/helper/ChannelView.cpp Outdated Show resolved Hide resolved
src/widgets/helper/NotebookTab.cpp Show resolved Hide resolved
src/widgets/helper/NotebookTab.cpp Outdated Show resolved Hide resolved
@pajlada
Copy link
Member

pajlada commented May 12, 2024

Dragging Chatterino between two monitors with different scaling works fine for me on Windows 11

Copy link
Member

@pajlada pajlada left a comment

Choose a reason for hiding this comment

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

Works much better on Windows now 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants