Page 1 of 1

DesktopScaleX() / DesktopScaleY() on different scaled monitor

Posted: Fri Nov 26, 2021 1:56 pm
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

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

Posted: Fri Nov 26, 2021 2:28 pm
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... :(

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

Posted: Sat Nov 27, 2021 12:47 am
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...

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

Posted: Sat Feb 04, 2023 12:39 pm
by Fred
PB is not yet multimonitor DPI aware, so it's more a feature request