-
Notifications
You must be signed in to change notification settings - Fork 15.8k
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
Fix for issues seen on frameless window (Windows) when at 200% resolution #7416
Fix for issues seen on frameless window (Windows) when at 200% resolution #7416
Conversation
👍 |
When testing this change, I realized this would cause other side effects and I'm now reverting it. The whole purpose of the DIPToScreenRect/ScreenToDIPSize calls is to calculate the window frame: win32 APIs like The problem with this change is, it calls gfx::Rect NativeWindowViews::WindowBoundsToContentBounds(const gfx::Rect& bounds) {
gfx::Rect content_bounds(bounds);
content_bounds.set_size(
display::win::ScreenWin::DIPToScreenSize(hwnd, content_bounds.size()));
content_bounds.set_size(
display::win::ScreenWin::ScreenToDIPSize(hwnd, content_bounds.size()));
return content_bounds;
} which is basically the same with: gfx::Rect NativeWindowViews::WindowBoundsToContentBounds(const gfx::Rect& bounds) {
return bounds
} I don't know the reason of your problem on Windows 10 AU, but this change is fixing it by passing wrong sizes. |
@bsclifton You run
|
I believe this was also a problem on surface devices |
@bridiver It was impacting Surface Books (coincidentally those with the Anniversary Update of Windows?) as they have high-DPI screens, and therefore scale the display up (200% in my case, though 150% and 175% for others) to makeup for the increase in on-screen pixels. |
@zcbenz we did find the root cause for this (and other) issues, which @bridiver addressed here brave/browser-laptop@e8bf42e More details about the issue can be found here: Besides breaking draggability and hit testing, it caused issues for us with regards to scrolling (inside of a guest view though, so regular electron use-cases may not be affected) |
- don't process non-client calcsize/paint - do proper DPI calculations when DPI > 100% Fixes brave/browser-laptop#6258 Reverts 182fe6d Which I believe incorrectly fixed the problem with Chromium 53 (see discussion at electron/electron#7416 for more info) We need to test to confirm, but I believe this change will fix: brave/browser-laptop#4502 brave/browser-laptop#6462 brave/browser-laptop#6468 brave/browser-laptop#6481
- don't process non-client calcsize/paint - do proper DPI calculations when DPI > 100% Auditors: @bbondy, @darkdh Fixes brave/browser-laptop#6258 Reverts 182fe6d Which I believe incorrectly fixed the problem with Chromium 53 (see discussion at electron/electron#7416 for more info) We need to test to confirm, but I believe this change will fix: brave/browser-laptop#4502 brave/browser-laptop#6462 brave/browser-laptop#6468 brave/browser-laptop#6481
First round of DPI issues we saw on Windows with
BrowserWindow => frame:false
were reported with #7347 and fixed with #7362While creating a new release and testing our project with that fix, we ended up seeing more weird behavior on high DPI screens. After more investigation, we realized that the NativeWindowViews class was not calling DIPToScreenRect/ScreenToDIPSize for Frameless windows, which caused several issues (for screenshots / animated gifs, check out brave/browser-laptop#4365)
The symptoms for the original issue were ONLY noticeable / easily reproducible (to my knowledge) by using Windows 10 with the anniversary update (I'm not sure if arch or home vs pro matters- but the issue does not happen unless you have the anniversary update).
Special thanks to @bridiver for finding the issue and @bbondy / @jonathansampson for testing the fix