Lazarus

Using the Lazarus IDE => Editor => Topic started by: Relativity on April 05, 2018, 11:33:24 am

Title: Alt-G does not work any more
Post by: Relativity on April 05, 2018, 11:33:24 am
Recently I have installed Lazarus 1.8.2 on my new Computer. It is the first time that I install Lazarus on this Computer.
I have copied my projects, developed with old Lazarus versions (I guess it was Lazarus 1.6.0) on my old Computer, to the new one, to carry them on.
Everything looks ok, but when I press Alt-g or I call List Procedures from the menu, I get the following message:

TControl.InvalidatePreferresSize loop detected TB:TToolBar Bounds=|=0,t=0,r=1188,b=32.

Press OK to ignore and risk data corruption.
Press Abort to kill the program

Then I select "Abort". Lazarus is closed and I get the following message:

Access Violation
Access Violation

Is that maybe a bug in Lazarus 1.8.2 ?
Title: Re: Alt-G does not work any more
Post by: Martin_fr on April 05, 2018, 01:21:28 pm
OS ?

Did you add any package to the IDE?

It works fine for me on Windows Vista (still...)
Title: Re: Alt-G does not work any more
Post by: Relativity on April 05, 2018, 01:44:05 pm
Martin_fr,
thank you very much for your help.

I have Windows 7.
I didn't add any package to the IDE.
Title: Re: Alt-G does not work any more
Post by: rvk on April 05, 2018, 02:18:54 pm
What happens if you do the same in a new empty project?
If that works open up your other project (in which alt+g failed) and try to strip code until it works.

It could be related to the following bug:
https://bugs.freepascal.org/view.php?id=32951

If it's your config you can go to %localappdata%\lazarus (in your explorer) and look in envronmentoptions.xml.
What is the value of Width and Height of <Name Value="TProcedureListForm"/> ?

You could try renaming that file and restarting lazarus to get a fresh clean version.
Title: Re: Alt-G does not work any more
Post by: Relativity on April 05, 2018, 02:40:05 pm
If I open a new project and I do Alt-G as first action after having opened the project, I immediately get the over-mentioned error.
Title: Re: Alt-G does not work any more
Post by: dsyrios on April 05, 2018, 03:58:10 pm
Hi,
I have the same problem.
So... I stopped to use Alt-G  :D

Laz 1.8.2/FPC 3.0.4/win32
Title: Re: Alt-G does not work any more
Post by: rvk on April 05, 2018, 03:59:58 pm
Please refer to what the values are mentioned earlier...

If it's your config you can go to %localappdata%\lazarus (in your explorer) and look in envronmentoptions.xml.
What is the value of Width and Height of <Name Value="TProcedureListForm"/> ?

You could try renaming that file and restarting lazarus to get a fresh clean version.

If you rename envronmentoptions.xml, does it work after that?
If so, you can rename it back and post the original envronmentoptions.xml here.
Title: Re: Alt-G does not work any more
Post by: dsyrios on April 05, 2018, 04:01:51 pm
for me... on win7

<Name Value="TProcedureListForm"/>
<Size Width="950" Height="680"/>
Title: Re: Alt-G does not work any more
Post by: dsyrios on April 05, 2018, 04:05:44 pm
@rvk
You are right !!!
Now it's ok!
thanks
Title: Re: Alt-G does not work any more
Post by: rvk on April 05, 2018, 04:06:43 pm
Now it's ok!
Those values worked for me fine. Maybe it depends on the resolution of your screen 1920x1080 for me.

What worked for you now? Renaming the file?
Maybe just deleting that section mentioning those values (or adjusting those values) is sufficient.
Title: Re: Alt-G does not work any more
Post by: dsyrios on April 05, 2018, 04:10:43 pm
@rvk
Yes... renaming the file.
Title: Re: Alt-G does not work any more
Post by: dsyrios on April 05, 2018, 04:21:35 pm
Ooops !
It came again.

 
Title: Re: Alt-G does not work any more
Post by: rvk on April 05, 2018, 04:30:19 pm
Ooops !
It came again.
Could you try removing the <dialog></dialog> tags containing the TProcedureListForm values.
Does that help.

If it helps we need to know the values and the resolution of your screen.
Did you happen to maximize that screen?
You're not using the docking-packages by any chance, are you?
Title: Re: Alt-G does not work any more
Post by: Relativity on April 05, 2018, 04:30:46 pm
In my environmentoptions file I don't have that entry (<Name Value="TProcedureListForm"/>) at all.
I renamed environmentoptions to environmentoptionsOLD, then I opened Lazarus again, but ALT-g still doesn't work and Lazarus doesn't create a new environmentoptions file.

Here is the content of my environmentoptions file:

<?xml version="1.0"?>
<CONFIG>
  <EnvironmentOptions>
    <Version Value="110" Lazarus="1.8.2"/>
    <LazarusDirectory Value="C:\lazarus">
    </LazarusDirectory>
    <CompilerFilename Value="$Lazarusdir\fpc\3.0.4\bin\x86_64-win64\\fpc.exe">
    </CompilerFilename>
    <FPCSourceDirectory Value="$(LazarusDir)fpc\$(FPCVer)\source">
    </FPCSourceDirectory>
    <MakeFilename Value="$Lazarusdir\fpc\3.0.4\bin\x86_64-win64\\make.exe">
    </MakeFilename>
    <TestBuildDirectory Value="C:\Users\A.Conti\AppData\Local\Temp\">
    </TestBuildDirectory>
    <Debugger Class="TGDBMIDebugger"/>
  </EnvironmentOptions>
</CONFIG>


Thank you rvk for your time.
Title: Re: Alt-G does not work any more
Post by: rvk on April 05, 2018, 04:32:55 pm
I renamed environmentoptions to environmentoptionsOLD, then I opened Lazarus again, but ALT-g still doesn't work and Lazarus doesn't create a new environmentoptions file.
In that case you might have installed Lazarus 1.8.2 with the option to put the configuration files somewhere else.
(because Laz should always recreate that file)

Check the C:\Lazarus\lazarus.cfg for any option as to where your configuration files are located.
Title: Re: Alt-G does not work any more
Post by: Relativity on April 05, 2018, 04:38:52 pm
I can not find any lazarus.cfg file in C:\lazarus

Title: Re: Alt-G does not work any more
Post by: rvk on April 05, 2018, 04:49:02 pm
I can not find any lazarus.cfg file in C:\lazarus
Ok, that's weird.

Where does the shortcut for your Lazarus startup point to? C:\Lazarus or some other directory?
(Maybe you already installed it to some alternative directory)

You need to find the correct environmentoptions.xml. Lazarus doesn't work without it (or it will create a new one).
Title: Re: Alt-G does not work any more
Post by: Relativity on April 05, 2018, 04:52:57 pm
It points to C:\lazarus\lazarus.exe


Title: Re: Alt-G does not work any more
Post by: rvk on April 05, 2018, 04:56:06 pm
If you run Lazarus 1.8.2 and open up Tools > Code Templates.
What is the directory and file that's listed there.
The directory should be the same as your config-directory.

If you open the explorer and paste %localappdata% you should see a lazarus directory.
In there, there should be a environmentoptions.xml.

PS. Lazarus might only recreate the file when it exits.
Title: Re: Alt-G does not work any more
Post by: Relativity on April 05, 2018, 05:08:35 pm
The directory and file listed there are:

C:\Users\A.Conti\AppData\Local\Lazarus\lazarus.dci

Actually on my Computer there is no C:\Users Folder, because I am in Germany and here we have C:\Benutzer instead of C:\Users, because "Benutzer" in German means "users".
So it points to a non-existing directory.

I installed the german version of Lazarus 1.8.2.
Title: Re: Alt-G does not work any more
Post by: rvk on April 05, 2018, 05:16:14 pm
Actually on my Computer there is no C:\Users Folder, because I am in Germany and here we have C:\Benutzer instead of C:\Users, because "Benutzer" in German means "users".
So it points to a non-existing directory.
No, Explorer shows you Benutzer but it is actually Users.
You can even type C:\Users in the explorer and it will put you in (what you think is) C:\Benutzer.

Anyway... %localappdata% is a shortcut to C:\Users\A.Conti\AppData\Local\ (or C:\Benutzer\A.Conti\AppData\Local\) and it has the Lazarus directory. (AppData itself is also normally hidden)

If you exit Lazarus it should contain a environmentoptions.xml now.
If you rename it and start Lazarus again, go to the code-editor and press Alt+G, does that work?
Title: Re: Alt-G does not work any more
Post by: Relativity on April 05, 2018, 05:38:21 pm
You are right.
I pasted %localappdata% in Explorer and I got C:\Users\A.Conti\AppData\Local\.
There was the lazarus directory and in the lazarus directory was the environmentoptions.xml file.
I renamed it to environmentoptionsOLD and I restarted Lazarus but Alt-g still gives the error.
However Lazarus created a new environmentoptions file.

In attachment there is a copy of environmentoptions as .txt file.

Title: Re: Alt-G does not work any more
Post by: rvk on April 05, 2018, 05:57:07 pm
In attachment there is a copy of environmentoptions as .txt file.
Your environmentoptions.xml worked fine here.

But I'm missing some coordinates in your xml (for <MainIDE> and <SourceNotebook> etc).
Did you have the docking-packages installed? (I already asked but got no answer)
What screen-resolution are you on?
Title: Re: Alt-G does not work any more
Post by: Relativity on April 05, 2018, 06:14:04 pm
My screen resolution in this moment is 1920 x 1080.
I don't remember having installed any extra package apart from the default Lazarus version.
In any case I checked under Package - Install/Uninstall packages... and I don't see any "docking" package or so listed under the installed packages.

Title: Re: Alt-G does not work any more
Post by: rvk on April 05, 2018, 06:18:44 pm
They are called AnchorDockingDsgn 0.5 and sparta_DockedFormEditor 0.0.

You could try moving all the files in the config directory to a subdirectory named old.
All config files should then be recreated.
I can't think of anything else (if the Docking packages are not installed).

Here it is working correctly on 1920x1080.
Title: Re: Alt-G does not work any more
Post by: Relativity on April 05, 2018, 06:35:51 pm
The packages you mention are not installed here.
They are only signalled as available for installation, but they are definitely not installed.

I moved all the files of the config directory in a new subdirectory named "old" and I restarted Lazarus: It works but when I do Alt-g I still get the error.

Title: Re: Alt-G does not work any more
Post by: balazsszekely on April 05, 2018, 09:08:55 pm
You should debug the IDE. Please do the following:
1. Go to ($LazarusDir)\IDE folder
2. Open project lazarus.lpi
3. Open unit procedurelist.pas, put a breakpoint to FormCreate first line
4. Click the Run button, ignore any error might occur, wait until another instance of Lazarus appears then press Alt + G 
5. Press F8 until you see the "InvalidatePreferresSize loop detected" error. I need a line number

PS: You can switch to Debug IDE if you like, but is not necessary at this point.
Title: Re: Alt-G does not work any more
Post by: dsyrios on April 06, 2018, 06:30:18 am
@GetMem
I have the same problem.
Following your instructions I got exception...
In file '.\include\control.inc' at line 5576
Title: Re: Alt-G does not work any more
Post by: balazsszekely on April 06, 2018, 08:26:33 am
@dsyrios
Quote
I have the same problem.
Following your instructions I got exception...
OK. This is the exception itself, but from which line of procedurelist.pas is coming from? I would debug it myself but I cannot reproduce the error. Please do the following, debug the IDE again(as in the above post) and when the exception appears, go to View-->Debug Windows-->Call Stack, or press: Ctrl + Alt + S, then make a screenshot and post it here.
Title: Re: Alt-G does not work any more
Post by: dsyrios on April 06, 2018, 10:44:29 am
@GetMem
I have NOT any experience on debug, but...
Do you mean this attachment?
Title: Re: Alt-G does not work any more
Post by: rvk on April 06, 2018, 11:21:30 am
YIKES. Yes, confirmed on Windows 7 Virtualbox with CLASSIC THEME !!!
Edit: Mmm, it also crashes under Normal Theme. Maybe it's Windows 7 general.

Lazarus 1.8.2 r57369 FPC 3.0.4 x86_64-win64-win32/win64
Title: Re: Alt-G does not work any more
Post by: rvk on April 06, 2018, 11:36:53 am
Complete call-stack (at least to 50)

Code: [Select]
#0 fpc_raiseexception at :0
#1 RAISELOOP(0x102e5d0) at include\control.inc:5576
#2 INVALIDATEPREFERREDSIZE(0x7763410) at include\control.inc:5592
#3 DOSETBOUNDS(0x7765e30, 129, 0, 6, 28) at include\control.inc:750
#4 CHANGEBOUNDS(0x7765e30, 129, 0, 6, 28, true) at include\control.inc:680
#5 SETBOUNDSKEEPBASE(0x7765e30, 129, 0, 6, 28) at include\control.inc:5423
#6 DOPOSITION(0x102eb80, 0x7765e30, ALNONE, 6) at include\wincontrol.inc:3023
#7 DOALIGN(0x102eb80, ALNONE) at include\wincontrol.inc:3136
#8 ALIGNCONTROLS(0x7763410, 0x0, {LEFT = 1, TOP = 0, RIGHT = 1188, BOTTOM = 32, TOPLEFT = {X = 1, Y = 0}, BOTTOMRIGHT = {X = 1188, Y = 32}, VECTOR = {1, 0, 1188, 32}}) at include\wincontrol.inc:3216
#9 ALIGNCONTROL(0x7763410, 0x0) at include\wincontrol.inc:6406
#10 AUTOSIZECONTROL(0x102ed40, 0x7763410) at include\control.inc:2986
#11 AUTOSIZECONTROL(0x102ed40, 0x45f5240) at include\control.inc:2988
#12 DOALLAUTOSIZE(0x45f5240) at include\control.inc:3036
#13 DOALLAUTOSIZE(0x45f5240) at include\wincontrol.inc:3524
#14 ENABLEAUTOSIZING(0x45f5240) at include\control.inc:5686
#15 fin$604(0x102eea0) at :4510
#16 SETVISIBLE(0x45f5240, true) at include\customform.inc:492
#17 SHOW(0x45f5240) at include\customform.inc:2317
#18 SHOWMODAL(0x45f5240) at include\customform.inc:2988
#19 EXECUTEPROCEDURELIST(0x1212960) at procedurelist.pas:151
#20 MNUSEARCHPROCEDURELIST(0x1212960, 0x1212960) at main.pp:3040
#21 PROCESSIDECOMMAND(0x1212960, 0x65f0870, 1019, true) at main.pp:3342
#22 PROCESSPARENTCOMMAND(0x65f0870, 0x6400ae0, 1019, '', 0x0, true) at sourceeditor.pp:8499
#23 PROCESSUSERCOMMAND(0x6400ae0, 0x65f8f50, 1019, '', 0x0) at sourceeditor.pp:3915
#24 DOONPROCESSCOMMAND(0x65f8f50, 1019, '', 0x0) at synedit.pp:7093
#25 COMMANDPROCESSOR(0x65f8f50, 1019, '', 0x0, []) at synedit.pp:6453
#26 KEYDOWN(0x65f8f50, 0, [SSALT]) at synedit.pp:2931
#27 KEYDOWNBEFOREINTERFACE(0x65f8f50, 0, [SSALT]) at include\wincontrol.inc:5667
#28 DOKEYDOWNBEFOREINTERFACE(0x65f8f50, {MSG = 48388, UNUSEDMSG = 0, CHARCODE = 0, UNUSED = 0, UNUSED2 = 0, KEYDATA = 539099137, RESULT = 0}, false) at include\wincontrol.inc:5798
#29 CNSYSKEYDOWN(0x65f8f50, {MSG = 48388, UNUSEDMSG = 0, CHARCODE = 0, UNUSED = 0, UNUSED2 = 0, KEYDATA = 539099137, RESULT = 0}) at include\wincontrol.inc:7164
#30 SYSTEM$_$TOBJECT_$__$$_DISPATCH$formal at :0
#31 ?? at :0
#32 CALLNOTIFYEVENTS(0x65f8f50, 0x673b608) at lazmethodlist.pas:306
#33 WNDPROC(0x65f8f50, {MSG = 48388, WPARAM = 0, LPARAM = 539099137, RESULT = 0, WPARAMLO = 0, WPARAMHI = 0, WPARAMFILLER = {FILLER = {0, 0, 0, 0}}, LPARAMLO = 1, LPARAMHI = 8226, LPARAMFILLER = {FILLER = {0, 0, 0, 0}}, RESULTLO = 0, RESULTHI = 0, RESULTFILLER = {FILLER = {0, 0, 0, 0}}}) at include\wincontrol.inc:5397
#34 WNDPROC(0x65f8f50, {MSG = 48388, WPARAM = 0, LPARAM = 539099137, RESULT = 0, WPARAMLO = 0, WPARAMHI = 0, WPARAMFILLER = {FILLER = {0, 0, 0, 0}}, LPARAMLO = 1, LPARAMHI = 8226, LPARAMFILLER = {FILLER = {0, 0, 0, 0}}, RESULTLO = 0, RESULTHI = 0, RESULTFILLER = {FILLER = {0, 0, 0, 0}}}) at synedit.pp:6034
#35 DELIVERMESSAGE(0x65f8f50, 0) at lclmessageglue.pas:112
#36 DOWINDOWPROC(0x673b530) at win32\win32callback.inc:2513
#37 WINDOWPROC(15073658, 260, 71, 539099137) at win32\win32callback.inc:2671
#38 UnregisterPowerSettingNotification at :0
#39 ?? at :0
#40 ?? at :0
#41 ?? at :0
#42 ?? at :0
#43 USER32!PtInRect at :0
#44 ?? at :0
#45 ?? at :0
Title: Re: Alt-G does not work any more
Post by: taazz on April 06, 2018, 11:56:57 am
not here. Although I never use it, I just tried and it works. Default theme with custom colors and no sounds.
could it be a screen resolution thing? I'm on 1920x1080
Title: Re: Alt-G does not work any more
Post by: rvk on April 06, 2018, 02:30:35 pm
In mij virtualbox with Windows 7 Ultimate I'm also on 1920x1080.
Even when switching to a lower resolution it keeps happening.
I also don't use it but it's defenitly a bug.

It seems like with the resizing of the TProcedureListForm the toolbar TB keeps the cfAutoSizeNeeded in Form.FControlFlags which is why the loop exists. At least it is the AutoSizeControl(AWinControl.Controls[i]); for TB which puts the cfAutoSizeNeeded back for the form.

My debugging skills are not that advanced to pinpoint the exact reason (especially with the poor info from the gdb debugger). It happens in line 2988 (AutoSizeControl) for I=1 (for the TB control). I can imagine if you can't reproduce the error it's almost impossible to find the problem.
Title: Re: Alt-G does not work any more
Post by: Relativity on April 06, 2018, 02:36:58 pm
I am now using another computer than the one on which I found the problem: it's a computer provided by the customer I work for.
Here I have Lazarus 1.8.0 and Windows 7 Enterprise and the resolution is 1920 x 1080: Alt-g perfectly works.

Title: Re: Alt-G does not work any more
Post by: balazsszekely on April 06, 2018, 02:41:53 pm
Quote
@dsyrios
I have NOT any experience on debug, but...
Do you mean this attachment?
Yes. You did a great job. Thanks. Unfortunately the screenshot does not help. The bug is not originating from procedurelist.pas.

@rvk
Quote
Complete call-stack (at least to 50)
Thanks. Despite my best efforts, I'm still unable to reproduce the bug, everything works fine in my win7 machine. According to the call stack + a small debug, it looks like a TToolButton resize triggers a TToolBar resize, which triggers again a TToolButton resize, and so on. Why is happening only to you I have no idea. Do you use high DPI?

Can you please try the following:
1. Set TB visibility to false(ProcedureListForm) on design time
2. On Form resize:
Code: Pascal  [Select][+][-]
  1. procedure TProcedureListForm.FormResize(Sender: TObject);
  2. begin
  3.   StatusBar.Panels[0].Width := self.ClientWidth - 105;
  4.   if not TB.Visible then
  5.     TB.Visible := True;
  6. end;  
 
3. Rebuild

This should prevent the infinite loop. Again I cannot test.
Title: Re: Alt-G does not work any more
Post by: rvk on April 06, 2018, 02:52:03 pm
Can you please try the following:
1. Set TB visibility to false(ProcedureListForm) on design time
2. On Form resize:
3. Rebuild
I did a clean & rebuild each time.
Just setting visible for the TB already did the trick.
Adding the visible := true in OnResize made the TB appear again without problems.

Mmm, setting visible to true again the Alt+G still works now  %)
I undid all the changes and it keeps working  %)
I think I need to reinstall again, for the 3rd time.
Title: Re: Alt-G does not work any more
Post by: balazsszekely on April 06, 2018, 02:58:42 pm
@rvk
Quote
I think I need to reinstall again, for the 3rd time.
If you reinstall, please copy procedurelist.lfm and procedurelist.pas somewhere else so you can always reproduce the bug. I suspect a particular size(width/height) triggers the error. Once you manage to start the form at least once, the bug is gone. I might be wrong though.
Title: Re: Alt-G does not work any more
Post by: rvk on April 06, 2018, 03:20:56 pm
Ok, reinstalled and saved ide\procedurelist.* (actually made a complete copy of C:\Lazarus)
First confirmed Alt+G crashes (it does)
Then did a Tools > Clean up + Rebuild all to be sure it's still there
Opened lazarus.lpi
Ctrl+F12 and opened Procedurelist.pas
F12 to view form (TB.Top=0 TB.Left=0)
Toggles visible of TB to off and to on
F12, File save
Tools > Clean up + Rebuild all
Lazarus restarted and Alt+G worked  %) %)

Appearantly nobody touched procedurelist.lfm since LCLVersion = '1.7'
The newly saved version for 1.8.2 also has new properties and the sizes are indeed changed (but I didn't resize the form itself, I just toggled TB.visible off and on)

Also BorderSpacing.Around changed from 1.7 to 1.8.2 and that maybe that could also cause some problems if the default values changed.

Attached is a patch between new and old procedurelist.lfm.

(I'll try a trunk compile in that VM to see if it is fixed)
Title: Re: Alt-G does not work any more
Post by: balazsszekely on April 06, 2018, 03:50:51 pm
I just did a quick compare, procedurelist(pas and dfm) in 1.8 and trunk are almost the same. The bug should be present in trunk too.
Title: Re: Alt-G does not work any more
Post by: rvk on April 06, 2018, 03:54:24 pm
I just did a quick compare, procedurelist(pas and dfm) in 1.8 and trunk are almost the same. The bug should be present in trunk too.
Yes, I see on my normal machine the procedurelist.lfm also has LCLVersion 1.7 in trunk.

So if it also fails on trunk I'll request a touch-up with lazarus.ide for that .lfm.
(unless somebody wants to dive in and find out which value really f's up at runtime :) )
(my building script is really really slow downloading trunk at the moment in that VM)

@Relativity and @dsyrios, If you want this working in Lazarus 1.8.2 just open up procedurelist.pas (with lazarus.lpi open), goto the form (F12) and toggle something and save it again. Rebuild the Lazarus ide again and it should work.
Title: Re: Alt-G does not work any more
Post by: balazsszekely on April 06, 2018, 04:05:26 pm
@rvk
I can commit the changes if the bug is present in trunk too. Please let me know when you're done with testing(it works for me without any change in trunk).
Title: Re: Alt-G does not work any more
Post by: rvk on April 06, 2018, 04:44:00 pm
ARGH....  >:D I noticed I was on 125% dpi (120DPI) in my VM (for testing purposes with another program).

In 125% trunk also had the problem. I made a change in procedurelist.lfm and recompiled and the Alt+G was solved. I made a patch and noticed the DesignTimePPI = 120  :'(

Set it back to 100%, reverted the changes and in trunk Alt+G worked.

So went back to the Laz 1.8.2 (original install), expecting it to work there too, and it did.

So question for @Relativity and @dsyrios, are you on something other than 100%?

Edit: Although Laz 1.8.2 at 100% worked I still edited the procedurelist.lfm and recompiled. At 100% it worked, switched to 125% and... it crashed again. So it has something to do with the display @ 125% and designtime @ 100%.

Yep. After switching back to 125% I tried the working trunk on 100% (still with LCLVersion 1.7) and it crashed too.
Title: Re: Alt-G does not work any more
Post by: balazsszekely on April 06, 2018, 05:08:10 pm
OK then. This bug should go to @Ondrej. He is the one who developed the High DPI feature, he will know what to do.


PS: I can reproduce with 125%.
Title: Re: Alt-G does not work any more
Post by: rvk on April 06, 2018, 05:22:24 pm
https://bugs.freepascal.org/view.php?id=33575

Edit: Also confirmed on Windows 10.
Title: Re: Alt-G does not work any more
Post by: dsyrios on April 06, 2018, 05:28:00 pm
@rvk
You are right...
Quote
If you want this working in Lazarus 1.8.2 just open up procedurelist.pas (with lazarus.lpi open), goto the form (F12) and toggle something and save it again. Rebuild the Lazarus ide again and it should work.
When I change any xxx% DPI, it crashes and I have to do the above solution again.
Title: Re: Alt-G does not work any more
Post by: dsyrios on April 06, 2018, 05:48:49 pm
@rvk
I saw your report at bugtracker that you refer only 125% DPI.
I noticed that NOT only at 125%, but any time I change the current xxx% DPI, it crashes
and I have to follow your...
Quote
If you want this working in Lazarus 1.8.2 just open up procedurelist.pas (with lazarus.lpi open), goto the form (F12) and toggle something and save it again. Rebuild the Lazarus ide again and it should work
Title: Re: Alt-G does not work any more
Post by: rvk on April 06, 2018, 05:50:44 pm
I saw your report at bugtracker that you refer only 125% DPI.
I noticed that NOT only at 125%, but any time I change the current xxx% DPI, it crashes
It happens at 125% when it is designed for 100%.

It could be that if you design it @ 125% (save it) it could crash at 100% again.
Did you try it at 100% (with a saved procedurelist.lfm @ 125%)?
Title: Re: Alt-G does not work any more
Post by: balazsszekely on April 06, 2018, 05:52:48 pm
125% was just an example. The point is if the design time dpi is different from the runtime dpi the IDE crashes. 
Title: Re: Alt-G does not work any more
Post by: rvk on April 06, 2018, 05:54:15 pm
Yes, it could be as simple as a rounding problem. The toolbar needing to be put at a position but it can't be put there because of a rounding problem (because different designtime/runtime dpi). In that case the toolbar is not at the expected position and the loop starts over again. (Maybe, but it was hard to trace/diagnose)
Title: Re: Alt-G does not work any more
Post by: Relativity on April 06, 2018, 09:13:04 pm
I can only say that through Control Panel > Appearance and Personalization > Display I coud see that I am on 125 % and this is indicated as default. That is, 125 % is the default.

rvk, I don't understand much of your posts, because they are far beyond the limits of my knowledge, sorry.
I only wanted to ask: what do you mean by design time dpi ?
How do you explain that it crashes also when I create a new project and I do alt-g ? Is in that case the runtime not the same as the design time ?

Title: Re: Alt-G does not work any more
Post by: rvk on April 06, 2018, 10:26:01 pm
I can only say that through Control Panel > Appearance and Personalization > Display I coud see that I am on 125 % and this is indicated as default. That is, 125 % is the default.
For me 100% is default and recommended. But that might depend on the size and resolution of your screen.

Quote
I only wanted to ask: what do you mean by design time dpi ?
With design-time I meant in which dpi setting the IDE is designed. It's the IDE that crashes on 125% dpi because it was originally designed at 100%. Most designers design at 100% because designing at another setting could cause problems when running on 100% (and it was designed on something different).

Since the IDE (and procedurelist.lfm) was designed at 100%, when displaying at 125% it needs to resize during runtime. Perhaps there is some roundoff where it can't put the toolbar correctly at the top and it gets stuck in a loop.

You can fix this quite easily yourself.
Open up ide\lazarus.lpi project.
Press Ctrl+F12 and open procedurelist.pas
Press F12 to view the form
Resize it slightly (it doesn't really matter)
Press F12 again to view the code
Choose File > Save (or Ctrl+S) to save it
Now choose Tools > Configure Builds
Choose Clean up + Build all at the top
Choose Build at the bottom
Lazarus will now recompile itself with your changed form and the ProcedureList will work

This is because you changed the procedurelist form, it is now saved with a setting of 120DPP in designtime and resizing the form work correctly now.

Of course this is a bug which still exists in trunk (development version) so it has to be corrected in the original release by someone. (hence the bug-report I submitted)
Title: Re: Alt-G does not work any more
Post by: rvk on April 20, 2018, 10:51:48 am
Fixed in trunk revision 57674 by Ondrej.
Fix is also targeted for Lazarus 1.8.4.

https://bugs.freepascal.org/view.php?id=33575
Title: Re: Alt-G does not work any more
Post by: zamtmn on April 23, 2018, 10:55:05 pm
r57674 have bad consequences.
Code: Pascal  [Select][+][-]
  1. unit Unit1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils, Forms, Controls, Graphics, Dialogs,
  9.   ComCtrls,StdCtrls;
  10.  
  11. type
  12.  
  13.   { TForm1 }
  14.  
  15.   TForm1 = class(TForm)
  16.     procedure _onCreateHandler(Sender: TObject);
  17.   private
  18.  
  19.   public
  20.  
  21.   end;
  22.  
  23. var
  24.   Form1: TForm1;
  25.  
  26. implementation
  27.  
  28. {$R *.lfm}
  29.  
  30. { TForm1 }
  31.  
  32. procedure TForm1._onCreateHandler(Sender: TObject);
  33. var
  34.   tb:TToolBar;
  35.   cb:TComboBox;
  36. begin
  37.   tb:=TToolBar.Create(self);
  38.   cb:=TComboBox.Create(tb);
  39.   cb.Align:=alRight;
  40.   cb.Parent:=tb;
  41.   tb.Parent:=self;
  42. end;
  43.  
  44. end.
with r57673 - ComboBox located right side
with r57674 - ComboBox located left side

windows 7, trunk Lazarus and trunk FPC
Title: Re: Alt-G does not work any more
Post by: rvk on April 24, 2018, 11:44:17 am
r57674 have bad consequences.
I don't think TToolButton is supposed to contain a right aligned TComboBox. It is for TToolButtons which, when they are added to the point they overflow at the right, they continue on a new line.

In Delphi a TComboBox dropped on a TToolbar also can't be aligned right.
Title: Re: Alt-G does not work any more
Post by: univan on May 11, 2018, 05:19:32 am
I can only say that through Control Panel > Appearance and Personalization > Display I coud see that I am on 125 % and this is indicated as default. That is, 125 % is the default.
For me 100% is default and recommended. But that might depend on the size and resolution of your screen.

Quote
I only wanted to ask: what do you mean by design time dpi ?
With design-time I meant in which dpi setting the IDE is designed. It's the IDE that crashes on 125% dpi because it was originally designed at 100%. Most designers design at 100% because designing at another setting could cause problems when running on 100% (and it was designed on something different).

Since the IDE (and procedurelist.lfm) was designed at 100%, when displaying at 125% it needs to resize during runtime. Perhaps there is some roundoff where it can't put the toolbar correctly at the top and it gets stuck in a loop.

You can fix this quite easily yourself.
Open up ide\lazarus.lpi project.
Press Ctrl+F12 and open procedurelist.pas
Press F12 to view the form
Resize it slightly (it doesn't really matter)
Press F12 again to view the code
Choose File > Save (or Ctrl+S) to save it
Now choose Tools > Configure Builds
Choose Clean up + Build all at the top
Choose Build at the bottom
Lazarus will now recompile itself with your changed form and the ProcedureList will work

This is because you changed the procedurelist form, it is now saved with a setting of 120DPP in designtime and resizing the form work correctly now.

Of course this is a bug which still exists in trunk (development version) so it has to be corrected in the original release by someone. (hence the bug-report I submitted)

fix it on windows 10 . Screen DPI 125%
Title: Re: Alt-G does not work any more
Post by: rvk on May 11, 2018, 05:26:07 am
fix it on windows 10 . Screen DPI 125%
It's already fixed.
See my previous post.
Fixed in trunk revision 57674 by Ondrej.
Fix is also targeted for Lazarus 1.8.4.
https://bugs.freepascal.org/view.php?id=33575

If you can't wait for 1.8.4 you can fix it yourself. (Also see my last post, the one you quoted).
TinyPortal © 2005-2018