PureBasic Forum
https://www.purebasic.fr/english/

[Done] Bug in WindowBounds with #PB_Ignore and DPI awareness
https://www.purebasic.fr/english/viewtopic.php?f=4&t=72415
Page 1 of 1

Author:  mikejs [ Thu Mar 07, 2019 11:18 am ]
Post subject:  [Done] Bug in WindowBounds with #PB_Ignore and DPI awareness

As posted in coding questions...

I have an application which has the option to show extra info at the bottom of the window, and a button to toggle this. Showing extra info means the window needs to get taller, and the minimum window height needs to change.

With DPI awareness, on a device using >100% scaling, this stopped working and instead caused the window to shrink to a very narrow width (as well as changing height correctly). After some debugging, I tracked this down to the WindowBounds() call.

This causes the problem:

Code:
WindowBounds(#w_main, #PB_Ignore, minheight, #PB_Ignore, #PB_Ignore)


But it can be worked around by providing all the min and max values as real values, and avoiding the use of #PB_Ignore:

Code:
WindowBounds(#w_main, minwidth, minheight, maxwidth, maxheight)


(Where only minheight has actually changed from when this was called initially when the window was created.)

Even with DPI awareness turned on, the problem only happens on devices that are using >100% scaling. So it looks like #PB_Ignore is not being handled correctly in that case (Guess: maybe the scaling factor is being applied before the check for whether a particular constant has been passed?)

Author:  Fred [ Wed Apr 10, 2019 8:01 pm ]
Post subject:  Re: Bug in WindowBounds with #PB_Ignore and DPI awareness?

Fixed.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/