Recent

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

winni

  • Hero Member
  • *****
  • Posts: 3197
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: 1215
  • 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

Free Pascal Compiler 3.2.2
macOS 12.1: Lazarus 2.2.6 (64 bit Cocoa M1)
Ubuntu 18.04.3: Lazarus 2.2.6 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.2.6 (64 bit on VBox)

VTwin

  • Hero Member
  • *****
  • Posts: 1215
  • 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

Free Pascal Compiler 3.2.2
macOS 12.1: Lazarus 2.2.6 (64 bit Cocoa M1)
Ubuntu 18.04.3: Lazarus 2.2.6 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.2.6 (64 bit on VBox)

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
  • Former Delphi 1-7, 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.

zgabrovski

  • New Member
  • *
  • Posts: 33
Re: Saving Form sizes using Windows DPI aware
« Reply #19 on: January 17, 2021, 10:22:05 pm »
One year ago I spent a lot of time with this.

https://forum.lazarus.freepascal.org/index.php/topic,49159.0.html

 

TinyPortal © 2005-2018