Fix unnecessary pixel ratio calculations on macOS #267
No reviewers
Labels
No labels
area/accessibility
area/dependency
Confirmed
Crash Report
Delayed
Design Issue
Duplicate
Feedback required
Good first issue
kind/bug
kind/cleanup
kind/enhancement
platform/linux
platform/macos
platform/windows
priority/high
Question
Request for Comments
Seeking Other Contributors
Seeking Testers
Won't Fix / By Design
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-obsproject/obs-browser!267
Loading…
Reference in a new issue
No description provided.
Delete branch "macos-hidpi-fix"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Disables unnecessary pixel ratio calculations on macOS which led to CEF window size and Qt window size mismatches.
Fixes https://github.com/obsproject/obs-browser/issues/265.
Motivation and Context
Window sizes in macOS are automatically translated to actual pixel sizes internally by macOS, applications are required to work with "logical" sizes (aka "dots") instead. Thus applying pixel ratios as multipliers is not necessary.
How Has This Been Tested?
Types of changes
Checklist:
I'll be honest, I'm not a fan of how much code gets duplicated. The browser code is hard enough to navigate.
I know, but the alternative would've been even less readable imo:
If you'd prefer this style, I can adapt the PR as such.
I think the alternative is ok, it's not that much less readable. Matt probably does have a good point. If it's okay, could you use that instead?
Also, could you put the motivation and context into the commit message? It's good to have commit messages with details about the commit so it's easier to know the context of the commit if there's by some chance a bug or something in that code that we only discover later.
I just force-pushed another update that removed the duplication - funnily enough the diff looks "worse".
Also ran some tests if we could get away with less of those macOS-specific changes, but this (no sub-window, getting the size within the CEF task, disabling the resize function entirely) seems to be the safest way to get it to work on macOS. From what I could tell the container and sub-window were necessary for resizing support, which works out-of-the-box on macOS.
Yeah, sometimes you have to sacrifice a good diff in favour of a more readable end result.
@WizardCM Looks like the Ubuntu-fix for clang-format hasn't been applied on this project yet?
Verified this does not break Windows or Linux panels. I think this is good to merge.