Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Window border not always shown on all sides (when using high DPI) #6698

Closed
srirambv opened this issue Jan 17, 2017 · 7 comments
Closed

Window border not always shown on all sides (when using high DPI) #6698

srirambv opened this issue Jan 17, 2017 · 7 comments
Labels
bug/dpi/monitor bug fixed-with-brave-core This issue will automatically resolved with the replacement of Muon with Brave Core. OS/Windows priority/P5 Cosmetic. Spelling, copy, layout. New features (which should also be part of an initiative). wontfix

Comments

@srirambv
Copy link
Collaborator

Did you search for similar issues before submitting this one?
yes

Describe the issue you encountered:
Window border not shown on all sides

Expected behavior:
Should show the blue window border on all sides when browser is in focus

  • Platform (Win7, 8, 10? macOS? Linux distro?):
    Windows 10 x64

  • Brave Version (revision SHA):
    Brave 0.13.0
    rev 105a1a7
    Same on preview 8 as well

  • Steps to reproduce:

    1. Do a clean install of 0.13.0 Preview 8/Preview 9
    2. Ensure the browser window is active
    3. Not all sides of the browser window has blue border
    4. Restart the browser, chances are three out of four sides have blue border
  • QA Steps

    1. Do a clean install of 0.13.0 build
    2. Ensure browser window is active
    3. Ensure all sides of the browser window has blue border
    4. Close and restart ensure all sides still has blue border
  • Screenshot if needed:
    Preview 8
    image
    image

Preview 9
image

@srirambv
Copy link
Collaborator Author

Resizing the window causes the blue border to be not shown. Captured here
blueborder

@bsclifton
Copy link
Member

Able to repro and it may be related to #6462

Here's what my best guess is (which may be wrong, but hear me out).

Frameless windows should NOT have any non-client area... but for some (in Muon) reason they do. When an approach is taken to disregard non-client area, we saw with #4216 that at 200% DPI, the top right / top left borders become rounded.

When the DPI is NOT 100% (or another round number, like 200%), you have an odd number of pixels. What I believe is happening is that the width/height of the window... when calculated... is not adding up to the actual width/height of the Window

I have a pretty good idea of where to look. Stay tuned...

@bsclifton
Copy link
Member

This is a fairly complex problem and will take some time to solve. Although high DPI Windows users may have some ugliness, Brave is still very usable; I don't believe this should be a blocker for 0.13.0. I'm going to move this to 0.13.1 😄

@bsclifton
Copy link
Member

My findings so far

  • Problem only happens at 125%, 150%, 175%
  • HWND in native_window_views.cc (in electron) maps to the parent window
  • there are child windows… one of which is the webview (which internally is a chromium webcontents object)
  • the webview window handle (HWND) has different dimensions than the parent window handle (HWND; parent being the one created in native_window_views)

I ran a quick demo with logging and observed that:

  • the parent HWND is 1467x900 (I’m at 125% DPI)
  • the webcontents HWND is 1468x900 (bigger than the parent)
  • the “internal” unscaled size to Windows is 1174x720 which is correct (ex: you can multiply by 1.25 and you’ll get “roughly" 1467x900)

When I’m inside the layout object, I can output the size of the view itself (I believe this is the webcontents) and the parent (the “host”). These sizes are:
HOST: 1174,720
view: 1172,718

@bsclifton
Copy link
Member

Some data I collected when reproducing

  • My DPI is set at 125%
  • The unscaled bounds are 809x598
  • Parent window is 1011x747
  • Child window (RenderWidgetHostViewAura) is 1012x748

If you manually work out the conversion to 125%, it would be 1011.25 x 747.5. It seems that any non-integer value is rounding up for the size of the HWND?

In this situation:

  • Right border is present
  • Bottom border is missing

@bsclifton bsclifton changed the title Window border not shown on all sides Window border not always shown on all sides (when using high DPI) Jan 30, 2017
@bsclifton
Copy link
Member

This one is solvable, but low priority

  • only one pixel is lost on right or bottom
  • problem does not exist in fullscreen or when maximized

I'm going to push it back; please feel free to re-assign milestone if you disagree

@bsclifton bsclifton modified the milestones: 1.2.0, 0.13.2 Jan 31, 2017
@bsclifton bsclifton modified the milestones: Backlog, 1.2.0 Mar 2, 2017
@bsclifton bsclifton removed their assignment Mar 30, 2017
@luixxiul luixxiul added the bug label Jun 4, 2017
@bbondy bbondy removed this from the Backlog milestone Oct 19, 2017
@bsclifton bsclifton added priority/P5 Cosmetic. Spelling, copy, layout. New features (which should also be part of an initiative). and removed priority/low (deprecated) labels Nov 22, 2017
@bsclifton bsclifton added this to the Backlog (Prioritized) milestone Nov 22, 2017
@bsclifton bsclifton added wontfix fixed-with-brave-core This issue will automatically resolved with the replacement of Muon with Brave Core. labels Aug 7, 2018
@bsclifton bsclifton removed this from the Backlog (Prioritized) milestone Aug 7, 2018
@bsclifton
Copy link
Member

Closing as wontfix since this is already fixed in brave-core

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug/dpi/monitor bug fixed-with-brave-core This issue will automatically resolved with the replacement of Muon with Brave Core. OS/Windows priority/P5 Cosmetic. Spelling, copy, layout. New features (which should also be part of an initiative). wontfix
Projects
None yet
Development

No branches or pull requests

4 participants