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

HighDPI problem: SizeGrip of dialogs vanishes, when ... #13

Open
0ric1 opened this issue Aug 22, 2019 · 8 comments
Open

HighDPI problem: SizeGrip of dialogs vanishes, when ... #13

0ric1 opened this issue Aug 22, 2019 · 8 comments

Comments

@0ric1
Copy link
Contributor

0ric1 commented Aug 22, 2019

moving the dialog (resizablelib\ResizableDialog) demo application from a monitor (main) with 150% scaling to a monitor (secondary) with 100% scaling and the demo application has "Per Monitor High DPI Aware V2" enabled.
The application is started from 150% monitor.
With the setting "No theme" is is partly visible.

Used Manifest:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- https://docs.microsoft.com/en-us/windows/win32/sbscs/application-manifests -->
<!-- https://blogs.windows.com/windowsdeveloper/2017/04/04/high-dpi-scaling-improvements-desktop-applications-windows-10-creators-update/ -->
<!--   MFC: Although we ve added per-monitor DPI scaling support to Win32, WPF and WinForms, MFC does not natively support this functionality. -->
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">

  <!-- Declare this application as DPI aware and Per-Monitor V2 DPI ready -->
  <application xmlns="urn:schemas-microsoft-com:asm.v3">
    <!-- https://docs.microsoft.com/en-us/windows/desktop/sbscs/application-manifests -->
    <!-- https://stackoverflow.com/questions/46428510/enhanced-system-dpi-scaling-with-vs2017 -->
    <windowsSettings>
        <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
        <!-- Un-comment the line below to enable GDI-scaling in this project. This will enable text -->
        <!-- to render crisply in DPI-unaware contexts --> 
        <!-- <gdiScaling xmlns="http://schemas.microsoft.com/SMI/2017/WindowsSettings">true</gdiScaling> -->
    </windowsSettings>
  </application>

</assembly>
@ppescher
Copy link
Owner

What version of Windows did you test on? Does it happen also with both monitors having 100% or both 150% scaling settings?
If you have Microsoft Spy++, could you check if the sizegrip is still where it's supposed to be?
The dialog window should have a Scrollbar child window in its sizing corner. Is this window in the correct position and not showing anything, or is it outside the client area of the parent dialog window?

@0ric1
Copy link
Contributor Author

0ric1 commented Aug 22, 2019

I am on Windows 10 1803 Prof. DE, using Visual Studio 2019 16.2.3 with PlatformToolset v142 and Windows SDK Version 10.0.18362.0.
Spy++ did not find the window when moved over the grip, but it does appear in the Windows list as ScrollBar but when using Highlight it does not highlight it. It seems to be in the correct position, because it does appear partially when switching the SizeGrip modus between Visible and Hidden and chaning the Theme Properties.

@0ric1
Copy link
Contributor Author

0ric1 commented Aug 22, 2019

20190822_Resizable_HighDPI_Problem

@ppescher
Copy link
Owner

Not sure if the Scrollbar control has the correct position and size... it seems not.
Could you capture a screenshot of the Spy++ properties window relative to the scrollbar (where rect coord are shown)?

@0ric1
Copy link
Contributor Author

0ric1 commented Aug 22, 2019

20190822_Resizable_HighDPI_Problem4

@ppescher
Copy link
Owner

Could you show me the Rect coordinates of both the Scrollbar child window and the parent dialog window?

@0ric1
Copy link
Contributor Author

0ric1 commented Aug 23, 2019

20190823_Resizable_HighDPI_Problem6

20190823_Resizable_HighDPI_Problem5

@ppescher
Copy link
Owner

It seems the sizegrip is not where it should be: for example, the rightmost coordinate is -879, while the dialog rightmost coordinate is -854. That's an offset of 25px horizontally (and 27px vertically), that seems too much to account only for the window border.

Anyway, like I said the library is not "DPI aware" so anything weird can happen.

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

No branches or pull requests

2 participants