Recent

Author Topic: Same project and two Pcs  (Read 4818 times)

caiov1n1c1us

  • New Member
  • *
  • Posts: 14
Same project and two Pcs
« on: April 22, 2024, 01:40:23 am »
Hi guys! I'm working on a lazarus project with my dad and we are constantly sending projects to each other.

There's one project that opens perfectly on my PC and completely messed up on his PC.
(check the images of the same project on each pc)

What could it be? On his PC is like no object is actually there, the background image doesn't show up and nothing works.

*He uses a docked version and I don't.


Thanks!

n7800

  • Full Member
  • ***
  • Posts: 139
Re: Same project and two Pcs
« Reply #1 on: April 22, 2024, 03:25:13 am »
I remember one problem that fits your description. Tell me, what is the value of the WindowState property of the form?

caiov1n1c1us

  • New Member
  • *
  • Posts: 14
Re: Same project and two Pcs
« Reply #2 on: April 22, 2024, 02:17:14 pm »
I remember one problem that fits your description. Tell me, what is the value of the WindowState property of the form?

The value is "wsNormal"

Laksen

  • Hero Member
  • *****
  • Posts: 777
    • J-Software
Re: Same project and two Pcs
« Reply #3 on: April 22, 2024, 02:36:53 pm »
The DPIs or display scalings look markedly different in the two screenshots. Could it be that on PC2 all the items are just way out of the border of the form? Try and select some controls in the object inspector and see if the Left and Top properties are larger than the width and height of the form

wp

  • Hero Member
  • *****
  • Posts: 12368
Re: Same project and two Pcs
« Reply #4 on: April 22, 2024, 02:38:12 pm »
Just a few ideas which come to my mind:

PC2 seems to have a different pixel-density than PC1. I would not expect difficulties due to this, but could you /your dad switch PC2 to normal resolution (96 ppi = 100%)?

I also do not think that the docked IDE is the root cause. But just to make sure your dad could temporarily uninstall the anchordocking packages to get back to the undocked IDE. What happens? (He can install these packages later again, and he should return to his old IDE). Or conversely, you could temporarily install anchordocking.

The screenshot of PC2 shows that the controls on the form seem to be present. What does your dad see in the Left/Top properties in the object inspector when he clicks on one of the controls in the object tree? Maybe due to some strange alignment issue the controls could be moved somewhere else. (I often wonder "where is the form" when people submit projects here in the forum and I cannot find the form on my monitor: they have two monitors and their coordinates are outside the range of my monitor).

You are speaking of "one project". So, this is the only project having this issue? Or do all projects that you share suffer from this? What happens when your dad modifies the form size by a few pixels, stores it on his machine and you try to open this modified version on your PC?

When it's the only project, it is probably difficult for you to create a simplified project for us which shows the issue. Normally issues can be solved much more easily when a compilable project is available.


caiov1n1c1us

  • New Member
  • *
  • Posts: 14
Re: Same project and two Pcs
« Reply #5 on: April 22, 2024, 02:57:04 pm »
Sorry I forgot to say that I'm using a widescreen resolution and he's using 4k resolution.


wp

  • Hero Member
  • *****
  • Posts: 12368
Re: Same project and two Pcs
« Reply #6 on: April 22, 2024, 03:14:35 pm »
Sorry I forgot to say that I'm using a widescreen resolution and he's using 4k resolution.
The relevant parameter is the pixels-per-inch (ppi) or percentage setting (relative to old-fashioned "normal" 96ppi): Right-click on desktop > Display settings > Scaling

caiov1n1c1us

  • New Member
  • *
  • Posts: 14
Re: Same project and two Pcs
« Reply #7 on: April 22, 2024, 06:38:42 pm »
Installed anchordocking on my lazarus and now my project looks the same as my dad.

So I've found the problem but not exactly the solution. I'll use the docked version and I'll build the project from zero.

Thanks guys!

caiov1n1c1us

  • New Member
  • *
  • Posts: 14
Re: Same project and two Pcs
« Reply #8 on: April 22, 2024, 06:54:08 pm »
Now I've found the real problem!

When I open the project in a docked version the Form's Left position changes to -2229. Changed to 0 and everything went back to normal.
Thanks Lasken for the insight.

Thanks!

wp

  • Hero Member
  • *****
  • Posts: 12368
Re: Same project and two Pcs
« Reply #9 on: April 22, 2024, 07:35:03 pm »
Strange. Your first post looks as if the contents of the form have moved out of the form at design-time. But from all I know about the docked-formeditor I would expect the form to be correct at designtime, and to disappear at runtime in case of out-of-screen Left/Top coordinates.

This looks to me like a bug of the docked-formeditor. Now that you can reproduce the issue, can you prepare a small demo project which could be used for digging deeper? Just a simple form with one of two controls on it. Pack the .pas, .lfm, .lpi and .lpr files into a common .zip and upload it here under "Attachments and other options".

caiov1n1c1us

  • New Member
  • *
  • Posts: 14
Re: Same project and two Pcs
« Reply #10 on: April 22, 2024, 07:52:23 pm »
Strange. Your first post looks as if the contents of the form have moved out of the form at design-time. But from all I know about the docked-formeditor I would expect the form to be correct at designtime, and to disappear at runtime in case of out-of-screen Left/Top coordinates.

This looks to me like a bug of the docked-formeditor. Now that you can reproduce the issue, can you prepare a small demo project which could be used for digging deeper? Just a simple form with one of two controls on it. Pack the .pas, .lfm, .lpi and .lpr files into a common .zip and upload it here under "Attachments and other options".

Sure! Here it is a sample

n7800

  • Full Member
  • ***
  • Posts: 139
Re: Same project and two Pcs
« Reply #11 on: April 22, 2024, 07:59:28 pm »
There are already two issues on the bug tracker:

https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/23929
https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/40491

I asked about the first one at the beginning, but in your case it turned out to be the second one.

No less interesting is why the coordinate turned out to be negative at all.

wp

  • Hero Member
  • *****
  • Posts: 12368
Re: Same project and two Pcs
« Reply #12 on: April 22, 2024, 08:06:47 pm »
Strange. Your first post looks as if the contents of the form have moved out of the form at design-time. But from all I know about the docked-formeditor I would expect the form to be correct at designtime, and to disappear at runtime in case of out-of-screen Left/Top coordinates.

This looks to me like a bug of the docked-formeditor. Now that you can reproduce the issue, can you prepare a small demo project which could be used for digging deeper? Just a simple form with one of two controls on it. Pack the .pas, .lfm, .lpi and .lpr files into a common .zip and upload it here under "Attachments and other options".

Sure! Here it is a sample
Do you work with two monitors?

caiov1n1c1us

  • New Member
  • *
  • Posts: 14
Re: Same project and two Pcs
« Reply #13 on: April 22, 2024, 09:55:05 pm »
Strange. Your first post looks as if the contents of the form have moved out of the form at design-time. But from all I know about the docked-formeditor I would expect the form to be correct at designtime, and to disappear at runtime in case of out-of-screen Left/Top coordinates.

This looks to me like a bug of the docked-formeditor. Now that you can reproduce the issue, can you prepare a small demo project which could be used for digging deeper? Just a simple form with one of two controls on it. Pack the .pas, .lfm, .lpi and .lpr files into a common .zip and upload it here under "Attachments and other options".

Sure! Here it is a sample
Do you work with two monitors?

Three monitors. Two ultrawide and one 4k.
My dad uses only one 4k.

Could be that? Because I place all Lazarus windows between all 3 monitors.

wp

  • Hero Member
  • *****
  • Posts: 12368
Re: Same project and two Pcs
« Reply #14 on: April 22, 2024, 11:37:19 pm »
Three monitors. Two ultrawide and one 4k.
My dad uses only one 4k.

Could be that? Because I place all Lazarus windows between all 3 monitors.
Yes. Depending on which monitor you design the form there will be negative or very large positive Left values. Since the DockedFormEditor has an issue with negative Left values as reported by n7800 it will exactly produce the issue that you describe.

 

TinyPortal © 2005-2018