If you change the DPI scaling of a screen, while a Purebasic program is running, all of the DPI functions still use the original scaling from when it was originally launched. Closing the program and opening it again will return the new DPI settings.
It's not something that will come up a lot, but I have an application that retains its position in the bottom right of the screen - and I've had to adapt it to use Win32 API functions instead.
DPI Scaling not updating
Re: DPI Scaling not updating
It does not matter anyway, if your scaling is above 100 even before startup it is still all messed up. this has been the case at least since the last LTS
The IDE as well as the applications made, the mouse coordinates do not match the window and control coordinates and sizes.
This causes an extremely obnoxious bug in the ide with the mouse hover over the auto hide tool window option.
The nice little tool someone wrote that shows a blotch of color over code in the ide renders somewhere off screen.
So it's messed up even before you launch PureBasic or any of the apps you make with it. Not sure you can expect it to be good changing the scale while the app is running.
The IDE as well as the applications made, the mouse coordinates do not match the window and control coordinates and sizes.
This causes an extremely obnoxious bug in the ide with the mouse hover over the auto hide tool window option.
The nice little tool someone wrote that shows a blotch of color over code in the ide renders somewhere off screen.
So it's messed up even before you launch PureBasic or any of the apps you make with it. Not sure you can expect it to be good changing the scale while the app is running.
Re: DPI Scaling not updating
PB still doesn't support per-monitor dpi awareness which would fix your issue too.
https://www.purebasic.fr/english/viewto ... pi#p567024
As usual, no comment or updates from the PB creator so don't hold your breath
And yes the IDE still does not properly scale. PB does not scale menu and toolbar icons at all...
https://www.purebasic.fr/english/viewto ... pi#p567024
As usual, no comment or updates from the PB creator so don't hold your breath
And yes the IDE still does not properly scale. PB does not scale menu and toolbar icons at all...
Re: DPI Scaling not updating
Supporting per monitor and dynamic scaling is not straightforward and needs a lot of rework on the PureBasic libraries. It's planned but will requires some time.
Re: DPI Scaling not updating
I've ended up using this for now:
and comparing it to the screen resolution.
Admittedly, it's only good on single monitor systems - although for my purposes it works out just fine
Code: Select all
GetWindowRect_(GetDesktopWindow_(), @desktopRect)
Admittedly, it's only good on single monitor systems - although for my purposes it works out just fine
Re: DPI Scaling not updating
This very niche case, Windows even tells than some application will need to be restarted when you switch DPI.
Moved to feature request.
Moved to feature request.
Re: DPI Scaling not updating
With one monitor, yes. With multiple, no. If you move a window from one screen to another which has another DPI setting, Windows will send an update message to inform you. Would be nice if PB could handle this.
https://learn.microsoft.com/en-us/windo ... dpichanged
https://github.com/microsoft/Windows-cl ... ontext.cpp
https://github.com/tringi/win32-dpi/blo ... 32-dpi.cpp
Process manifest keyword DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2
The message Windows gives is because of "older" application which do not handle these and become "unsharp" because of DPI mismatch (easy scaling).
Re: DPI Scaling not updating
This would indeed be nice. If I'm not wrong, Windows also sends this message upon changing the dpi-settings in the control panel.
PureBasic 6.04/XProfan X4a/Embarcadero RAD Studio 11/Perl 5.2/Python 3.10
Windows 11/Ryzen 5800X/32GB RAM/Radeon 7770 OC/3TB SSD/11TB HDD
Synology DS1821+/36GB RAM/130TB
Synology DS920+/20GB RAM/54TB
Synology DS916+ii/8GB RAM/12TB
Windows 11/Ryzen 5800X/32GB RAM/Radeon 7770 OC/3TB SSD/11TB HDD
Synology DS1821+/36GB RAM/130TB
Synology DS920+/20GB RAM/54TB
Synology DS916+ii/8GB RAM/12TB
Re: DPI Scaling not updating
I figured how to enable per monitor DPI awareness on windows 8.1 and above, see here : viewtopic.php?p=599281