DesktopScaleX() / DesktopScaleY() on different scaled monitor

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6161
Joined: Sat May 17, 2003 11:31 am
Contact:

DesktopScaleX() / DesktopScaleY() on different scaled monitor

Post by blueznl »

This is triggered by and possible related to another bug I'm trying to isolate.

I have a dual monitor setup. When both monitors have a different scale (in Windows 10 Scale and Layout / Change the size of text, apps and other items) this function only reports the scale from my primary monitor.

I.e. if monitor 1 is set to 150% and monitor 2 is set to 125%, it will report 150% for all monitors.
This is compiled with DPI aware set to ON.

Code: Select all

n = ExamineDesktops()
While nn < n
  Debug "---"
  Debug nn
  Debug DesktopX(nn)
  Debug DesktopY(nn)
  Debug DesktopWidth(nn)
  Debug DesktopHeight(nn)
  Debug DesktopScaledX(100)
  Debug DesktopScaledY(100)
  nn = nn+1
Wend
Last edited by blueznl on Fri Dec 03, 2021 8:33 pm, edited 1 time in total.
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Rinzwind
Enthusiast
Enthusiast
Posts: 636
Joined: Wed Mar 11, 2009 4:06 pm
Location: NL

Re: DesktopScaleX() / DesktopScaleY() on different scaled monitor

Post by Rinzwind »

Yup, PB's GUI library must be updated to support DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 on windows...
As of now, it only supports DPI_AWARENESS_CONTEXT_SYSTEM_AWARE which does not include support for multiple monitors... :(
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6161
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: DesktopScaleX() / DesktopScaleY() on different scaled monitor

Post by blueznl »

There's indeed something wrong. I tried to replicate a bug related to ResizeWindow() and multi monitor setups, but I cannot isolate it.

It seems that a doubleclick on a (PB generated) systray icon (this is a guess) throws some spanner in the wheels internally, causing subsequent ResizeWindow() calls to fail, but ONLY if the app has an open window on a non-primary monitor with a different scale, and it seems to only affect the window on the primary monitor.

It drives me completely nuts, because all test code I've devised doesn't show the problem, but the full application does... grrrrr... The only thing left is that it's somehow related to the systray icon, because that's something my test code doesn't have. I'll try that next...
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Fred
Administrator
Administrator
Posts: 16619
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: DesktopScaleX() / DesktopScaleY() on different scaled monitor

Post by Fred »

PB is not yet multimonitor DPI aware, so it's more a feature request
Post Reply