Recent

Author Topic: Saving Form sizes using Windows DPI aware  (Read 2013 times)

winni

  • Hero Member
  • *****
  • Posts: 1359
Re: Saving Form sizes using Windows DPI aware
« Reply #15 on: July 24, 2019, 11:33:10 pm »
Just wanted to say: It's too hot for hunting bugs, but then I saw, that you don't live in Europe....

If you just want to solve the problem, then there is a rude way:

In TForm1.resize check if the Form has the desired height and width.
If not resize the Form and all the children.

I did that once when the KDE desktop hat strange ideas about the size of the application while restoring a session. 

This works but you'll never know what's the reason of this strange behaviour.

Winni

VTwin

  • Hero Member
  • *****
  • Posts: 895
  • Former Turbo Pascal 3 user
Re: Saving Form sizes using Windows DPI aware
« Reply #16 on: July 24, 2019, 11:46:42 pm »
Just a guess:

If it only happens in Win7, what about a Windows speciality: the anoying manifest files?

Are they turned of in the project options?  Or do they interact strange with the DPI stuff?

Only a guess.

Winni

Possibly. I do have them turned on, with DPI awareness off. I'll try turning the darn things off altogether.

We did get bonkers hot over the weekend, but got a bit of a break. That second solution sounds like a last resort. If I had Windows on trunk I might try harder to bug hunt, but I've got my hands full, and only run Mac on trunk. I'll still see if I can isolate the behavior, but I just might have to wait on trying to get DPI aware.

Thanks,
VTwin
« Last Edit: July 25, 2019, 12:00:46 am by VTwin »
“Talk is cheap. Show me the code.” -Linus Torvalds

macOS 10.13.6: Lazarus 2.0.6 (64 bit Cocoa, also fixes and trunk)
Ubuntu 18.04.3: Lazarus 2.0.6 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.0.6 (64 bit on VBox)

VTwin

  • Hero Member
  • *****
  • Posts: 895
  • Former Turbo Pascal 3 user
Re: Saving Form sizes using Windows DPI aware
« Reply #17 on: July 25, 2019, 01:40:10 am »
Turning of manifest does not seem to make any difference.

Disabling application scaling is a good step, but every time I switch to or from Windows, I have to make a small change in a form layout to force it to rebuild to the correct scaling. I end up with shrunken forms on Windows, or huge forms on Mac. Very frustrating.

Does anyone else who is doing cross-platform have this problem? Has anyone come up with a solution?
« Last Edit: July 25, 2019, 01:52:54 am by VTwin »
“Talk is cheap. Show me the code.” -Linus Torvalds

macOS 10.13.6: Lazarus 2.0.6 (64 bit Cocoa, also fixes and trunk)
Ubuntu 18.04.3: Lazarus 2.0.6 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.0.6 (64 bit on VBox)

trev

  • Hero Member
  • *****
  • Posts: 670
  • Former Delphi 1-7 and 10.2 User
Re: Saving Form sizes using Windows DPI aware
« Reply #18 on: July 27, 2019, 02:25:17 am »
Does anyone else who is doing cross-platform have this problem? Has anyone come up with a solution?

I have an application which runs on macOS, Windows, Linux and FreeBSD which does not exhibit any scaling problem across those platforms.

However, I do not store the width of forms for restoration; I simply store the TOP and LEFT form properties.
o Lazarus v2.1.0 r63272, FPC v3.3.1 r45525, macOS 10.14.6 (with sup update), Xcode 11.3.1
o Lazarus v2.1.0 r61574, FPC v3.3.1 r42318, FreeBSD 12.1 (Parallels VM)
o FPC 3.0.4, FreeBSD 12-STABLE r358002
o Lazarus v2.1.0 r61574, FPC v3.0.4, Ubuntu 18.04 (Parallels VM)

 

TinyPortal © 2005-2018