View Issue Details

IDProjectCategoryView StatusLast Update
0018538LazarusOtherpublic2016-01-02 10:29
ReporterAndrey Zubarev Assigned ToJuha Manninen  
Status closedResolutionfixed 
Product Version0.9.31 (SVN) 
Target Version1.6Fixed in Version1.7 (SVN) 
Summary0018538: Under certain configurations docked windows, lower window arbitrarily increasing its height
DescriptionWhen using the package anchordocking (in IDE or my programs), after loading the default layout.
Steps To ReproduceSave the default configuration windows in IDE like the animated gif and restart. Some actions lead to an increase height of the window "messages", such as compiling
Fixed in Revisionr51097, r51098, r51099
Attached Files


related to 0017908 closedJuha Manninen WindowSate not saved for object inspector / messages 
related to 0018977 closedJuha Manninen The form position in Delphi2006 style Lazarus IDE is not right. 
related to 0018298 resolvedMattias Gaertner Please update the default layout provided with anchor docking package 
related to 0026895 closedJuha Manninen AnchorDocking: Messages window either disappears or becomes very small in some situations 
related to 0029298 closedOndrej Pokorny Docked window height changes when changing the dock site width 


2011-01-16 22:10


anchordocking.gif (86,384 bytes)   
anchordocking.gif (86,384 bytes)   

2011-01-21 21:45


anchordocking.patch (793 bytes)   
Index: anchordocking.pas
--- anchordocking.pas	(revision 29154)
+++ anchordocking.pas	(working copy)
@@ -5066,8 +5066,8 @@
     case ChildSite.Align of
     alTop: ChildSite.Height:=ChildSite.BoundSplitter.Top;
-    alBottom: ChildSite.Height:=Site.ClientHeight
-                  -(ChildSite.BoundSplitter.Top+ChildSite.BoundSplitter.Height);
+    //alBottom: ChildSite.Height:=Site.ClientHeight
+    //              -(ChildSite.BoundSplitter.Top+ChildSite.BoundSplitter.Height);
     alLeft: ChildSite.Width:=ChildSite.BoundSplitter.Left;
     alRight: ChildSite.Width:=Site.ClientWidth
anchordocking.patch (793 bytes)   

Andrey Zubarev

2011-01-21 21:45

reporter   ~0045388

This patch resolves the problem, perhaps wrongly.

Vincent Snijders

2011-02-08 14:36

manager   ~0045897

Target 0.99 for review of patch.

Flávio Etrusco

2011-04-10 21:11

developer   ~0047411

Actually, compiling didn't cause the problem here, but creating a new form did.

Andrey Zubarev

2011-04-10 22:19

reporter   ~0047412

Yes, I am compiling led to rapidly reproduce the bug. The problem of lead any action causing DoAllAutoSize - creating, resize forms

Flávio Etrusco

2011-05-24 21:11

developer   ~0048550

Mattias, just to confirm, there's no intention that the docking alignment works differently from the normal aligment, right? I ask this because fequently the controls acts as if the control are resized proportionally instead of respecting the normal splliter anchors.

Mattias Gaertner

2011-05-24 21:19

manager   ~0048551

The default is when enlarging the window to enlarge all docked windows proportionally. You can disable this (right click on a dock header), but the options are not yet saved.

Flávio Etrusco

2012-03-07 02:36

developer   ~0057336

OMG, I never read that reply. Mattias, don't you think this default should be changed? It's useful to have the option of resizing proportionally, but I don't know any docking implemention that behave like that - not by default at least.

Flávio Etrusco

2012-03-07 03:42

developer   ~0057341

BTW, in a docked IDE, on Windows, unchecking the "Scale on Resize" option and trying to resize a docked control (or resize whole IDE/dockmaster) immediately raises an exception:

0 0xbaadf00d in ?? ()
1 0x0040be72 in SYSTEM_TOBJECT_$__FREE ()
2 0x0041fbdf in SYSUTILS_FREEANDNIL$formal ()
3 0x00ccc566 in TANCHORDOCKMASTER__DESTROY (vmt=0x1,this=<error reading variable>) at anchordocking.pas:1885
4 0x0040be72 in SYSTEM_TOBJECT_$__FREE ()
5 0x0041fbdf in SYSUTILS_FREEANDNIL$formal ()
6 0x00cdc32d in ANCHORDOCKING_finalize () at anchordocking.pas:5636
7 0x0040e3c8 in SYSTEM_FINALIZEUNITS ()
8 0x0ed410b4 in ?? ()
9 0x004044cc in fpc_check_object ()
10 0x00cd7f16 in TANCHORDOCKCLOSEBUTTON__CALCULATEPREFERREDSIZE (PREFERREDWIDTH=14, PREFERREDHEIGHT=14, WITHTHEMESPACE=true,this=<error reading variable>) at anchordocking.pas:4810
11 0x005d7889 in TCONTROL__GETPREFERREDSIZE (PREFERREDWIDTH=162851284,PREFERREDHEIGHT=187635824, RAW=true, WITHTHEMESPACE=true,this=<error reading variable>) at ./include/
12 0x005b510b in INITPREFERREDSIZES (parentfp=0x9b4ea10) at ./include/
14 0x005c702f in TWINCONTROL__CALCULATEPREFERREDSIZE (PREFERREDWIDTH=0, PREFERREDHEIGHT=0, WITHTHEMESPACE=true, this=<error reading variable>) at ./include/
15 0x00cd71b6 in TANCHORDOCKHEADER__CALCULATEPREFERREDSIZE (PREFERREDWIDTH=0, PREFERREDHEIGHT=0, WITHTHEMESPACE=true,this=<error reading variable>) at anchordocking.pas:4658
16 0x005d7889 in TCONTROL__GETPREFERREDSIZE (PREFERREDWIDTH=2005097720,PREFERREDHEIGHT=17896532, RAW=false, WITHTHEMESPACE=true,this=<error reading variable>) at ./include/
17 0x005b93d9 in DOPOSITION (CONTROL=0xd686550, AALIGN=ALLEFT,ACONTROLINDEX=0, parentfp=0x9b4ee28) at ./include/
18 0x005b91de in DOALIGN (AALIGN=ALLEFT, parentfp=0x9b4ee28) at ./include/
19 0x005b8c90 in TWINCONTROL__ALIGNCONTROLS (ACONTROL=0x0,REMAININGCLIENTRECT=..., this=<error reading variable>) at ./include/
20 0x004268ed in TSCROLLINGWINCONTROL__ALIGNCONTROLS (ACONTROL=0x0, ARECT=..., this=<error reading variable>) at ./include/
21 0x00cd34a6 in TANCHORDOCKHOSTSITE__ALIGNCONTROLS (ACONTROL=0x0,ARECT=..., this=<error reading variable>) at anchordocking.pas:3690
22 0x005c1934 in TWINCONTROL__ALIGNCONTROL (ACONTROL=0x0,this=<error reading variable>) at ./include/
23 0x005cf8ed in AUTOSIZECONTROL (ACONTROL=0xd6860c0, parentfp=0x9b4ef7c) at ./include/
24 0x005cf92d in AUTOSIZECONTROL (ACONTROL=0xc73cb98, parentfp=0x9b4ef7c) at ./include/
25 0x005cf5d2 in TCONTROL__DOALLAUTOSIZE (this=<error reading variable>) at ./include/
26 0x005bab28 in TWINCONTROL__DOALLAUTOSIZE (this=<error reading variable>) at ./include/
27 0x005d80c9 in TCONTROL__ENABLEAUTOSIZING (this=<error reading variable>) at ./include/
28 0x005d51cc in TCONTROL__DOCK (NEWDOCKSITE=0x0, ARECT=...,this=<error reading variable>) at ./include/
29 0x0042fe51 in TCUSTOMFORM__DOCK (NEWDOCKSITE=0x0, ARECT=...,this=<error reading variable>) at ./include/
30 0x005d42e8 in TCONTROL__SETHOSTDOCKSITE (AVALUE=0x0,this=<error reading variable>) at ./include/
31 0x005c1ebe in TWINCONTROL__DESTROY (vmt=0x0,this=<error reading variable>) at ./include/
32 0x005d8dec in TCUSTOMCONTROL__DESTROY (vmt=0x0,this=<error reading variable>) at ./include/
33 0x00427309 in TSCROLLINGWINCONTROL__DESTROY (vmt=0x0,this=<error reading variable>) at ./include/
34 0x00428285 in TCUSTOMFORM__DESTROY (vmt=0x1,this=<error reading variable>) at ./include/
35 0x0040be72 in SYSTEM_TOBJECT_$__FREE ()
36 0x004363e3 in TAPPLICATION__DOBEFOREFINALIZATION (this=<error reading variable>) at ./include/
37 0x0042441d in BEFOREFINALIZATION () at forms.pp:1790
38 0x0040e529 in SYSTEM_INTERNALEXIT ()
39 0x00000000 in ?? ()

I'll try debugging it...

2012-03-18 22:25


FixScaleOnResize.patch (1,087 bytes)   
Index: anchordocking.pas
--- anchordocking.pas	(revision 36148)
+++ anchordocking.pas	(working copy)
@@ -1730,6 +1730,7 @@
+  CreateCloseButtonBitmap;
 procedure TAnchorDockMaster.SetShowHeader(AValue: boolean);
@@ -1784,7 +1785,7 @@
 procedure TAnchorDockMaster.FreeCloseButtonBitmap;
-  fCloseBtnBitmap.Free;
+  freeandnil(fCloseBtnBitmap);
Index: anchordockoptionsdlg.pas
--- anchordockoptionsdlg.pas	(revision 36148)
+++ anchordockoptionsdlg.pas	(working copy)
@@ -239,6 +239,7 @@
+  TheSettings.HeaderButtonSize:=Master.HeaderButtonSize;
 procedure TAnchorDockOptionsFrame.LoadFromSettings(
FixScaleOnResize.patch (1,087 bytes)   

Andrey Zubarev

2012-03-18 22:27

reporter   ~0057821

>>BTW, in a docked IDE, on Windows, unchecking the "Scale on Resize" option and
>>trying to resize a docked control (or resize whole IDE/dockmaster) immediately
>>raises an exception:
FixScaleOnResize.patch resolves the problem, perhaps wrongly.

Mattias Gaertner

2014-10-06 22:20

manager   ~0078025

The button code was rewritten.

Andrey Zubarev

2014-10-06 22:40

reporter   ~0078026

But the bug is still present ((

Mattias Gaertner

2014-10-06 23:16

manager   ~0078027

The crash should be fixed. Is it not?

Andrey Zubarev

2014-10-07 00:05

reporter   ~0078029

I mean
>>Under certain configurations docked windows, lower window arbitrarily increasing its height

I attached an animated gif file since the start of Lazarus. message window is still changing its height, more than was specified in layout file

Andrey Zubarev

2014-10-07 00:07


stillpresent.gif (343,872 bytes)

Mattias Gaertner

2014-10-07 02:11

manager   ~0078035

Under what configurations does it change?
I cannot reproduce it on neither Windows nor Linux.

Andrey Zubarev

2014-10-07 07:39

reporter   ~0078038

Lazarus 1.3 46459 FPC 2.7.1 i386-win32-win32/win64
Compose window as shown in At launch Lazarus moment message window is still changing its height

Mattias Gaertner

2014-10-08 01:06

manager   ~0078061

It works under Windows XP, maybe it is Window 7 themes.

Andrey Zubarev

2014-10-08 06:07

reporter   ~0078063

>>maybe it is Window 7 themes.
I don't think. I see the same incorrect behavior in Linux&Qt. How can I help in finding the problem?

Andrey Zubarev

2014-10-08 06:44

reporter   ~0078064

In Linux&GTK2 incorrect behavior too((
Layout file, screenshots before saving layout and after restarting IDE attached

Andrey Zubarev

2014-10-08 06:44


anchordocklayout.xml (1,766 bytes)   
<?xml version="1.0" encoding="UTF-8"?>
    <Nodes ChildCount="2">
      <Item1 Name="MainIDE" Type="CustomSite" ChildCount="1">
        <Bounds Left="63" Top="31" Width="667" Height="455">
            <Rect Right="2560" Bottom="1440"/>
        <Item1 Name="AnchorDockSite5" Type="Layout" ChildCount="5">
          <Bounds Top="60" Width="667" Height="365" SplitterPos="56"/>
          <Anchors Align="Bottom"/>
          <Item1 Name="MessagesView" Type="Control">
            <Bounds Top="195" Width="422" Height="170"/>
            <Anchors Top="AnchorDockSplitter3" Right="AnchorDockSplitter2"/>
          <Item2 Name="AnchorDockSplitter2" Type="SplitterVertical">
            <Bounds Left="422" Width="4" Height="365"/>
          <Item3 Name="CodeExplorerView" Type="Control">
            <Bounds Left="426" Width="241" Height="365"/>
            <Anchors Left="AnchorDockSplitter2"/>
          <Item4 Name="AnchorDockSplitter3" Type="SplitterHorizontal">
            <Bounds Top="191" Width="422" Height="4"/>
            <Anchors Right="AnchorDockSplitter2"/>
          <Item5 Name="SourceNotebook" Type="Control">
            <Bounds Width="422" Height="191"/>
            <Anchors Right="AnchorDockSplitter2" Bottom="AnchorDockSplitter3"/>
            <Header Position="left"/>
      <Item2 Name="ObjectInspectorDlg" Type="Control">
        <Bounds Top="266" Width="306" Height="393">
            <Rect Right="2560" Bottom="1440"/>
anchordocklayout.xml (1,766 bytes)   

Andrey Zubarev

2014-10-08 06:45


before_saving.png (252,659 bytes)   
before_saving.png (252,659 bytes)   

Andrey Zubarev

2014-10-08 06:45


after_restoring.png (293,770 bytes)

Juha Manninen

2015-12-29 18:15

developer   ~0088410

Last edited: 2015-12-29 18:15

View 2 revisions

This was maybe fixed in r51081. Please test.
Why does reading the active desktop in TMainIDE.StartIDE prevent the bug also with actions done while the IDE is running?
It must be figured out and maybe solved in a better way.

Andrey Zubarev

2015-12-29 20:32

reporter   ~0088416

This is not a IDE bug, this is a AnchorDocking package problem.
Unfortunately I have not opportunity to check in gtk and qt, but in win I have not noticed this problem

Juha Manninen

2015-12-29 23:04

developer   ~0088418

> This is not a IDE bug, this is a AnchorDocking package problem.

This is very much an IDE bug! Even your video and screenshots are about Lazarus IDE.
Do you mean you can also reproduce the problem with a smaller test application which uses AnchorDocking package?

> Unfortunately I have not opportunity to check in gtk and qt, but in win I have not noticed this problem

Do you mean after r51081?

Ondrej Pokorny

2015-12-31 14:37

developer   ~0088464

About the bug:

The bug persists when these circumstances are met:
a.) The dock site has a main menu. (E.g. Lazarus IDE main bar).
b.) TAnchorDockSettings.ScaleOnResize is enabled (True).

Why does it happen? I will now talk about Lazarus IDE (the same applies to other forms as well):
1.) When the docked layout is read, MainIDEBar hasn't HandleAllocated and thus when setting BoundsRect an incorrect "ClientRect" (FClientWidth, FClientHeight) is saved in MainIDEBar.
2.) After the docked layout has been read, MainIDEBar is shown, it allocates handle and the real FClientHeight is received from OS/WS. The new FClientHeight is different (smaller) than the FClientHeight from point 1.
3.) Whenever DoAllAutoSize was called on MainIDEBar it did resize the dock site according to the difference in FClientHeight between 1 and 2 (because ScaleOnResize is True).

Why does the workaround from r51081 work?
Because (3) happens of course only once. When the docked layout is read again after MainIDEBar's handle has been allocated, FClientHeight is already correct.

What is the real bug fix?
To reset splitter parent ClientRect after MainIDEBar's ClientHeight is correct and ClientHeight takes MainMenu into account. That means after EnableAllAutoSizing.

I fixed it in r51097. Juha please revert your changes (but keep DoShowMessagesView deleted). Then you can resolve this issue.

+ There is still a similar issue unsolved: 0029298. It looks same but is different and persists before and after r51097.

Juha Manninen

2016-01-01 10:41

developer   ~0088488

Fixed together with related issues.

Andrey Zubarev

2016-01-02 10:29

reporter   ~0088519


Issue History

Date Modified Username Field Change
2011-01-16 22:10 Andrey Zubarev New Issue
2011-01-16 22:10 Andrey Zubarev File Added: anchordocking.gif
2011-01-16 22:12 Andrey Zubarev Tag Attached: docking
2011-01-21 21:45 Andrey Zubarev File Added: anchordocking.patch
2011-01-21 21:45 Andrey Zubarev Note Added: 0045388
2011-02-08 14:36 Vincent Snijders LazTarget => 0.99.0
2011-02-08 14:36 Vincent Snijders Note Added: 0045897
2011-02-08 14:36 Vincent Snijders Status new => acknowledged
2011-02-08 14:36 Vincent Snijders Target Version => 0.99.0
2011-03-24 11:20 Juha Manninen Relationship added related to 0018977
2011-03-30 09:44 Mattias Gaertner Status acknowledged => assigned
2011-03-30 09:44 Mattias Gaertner Assigned To => Mattias Gaertner
2011-04-10 21:11 Flávio Etrusco Note Added: 0047411
2011-04-10 22:19 Andrey Zubarev Note Added: 0047412
2011-05-24 21:11 Flávio Etrusco Note Added: 0048550
2011-05-24 21:19 Mattias Gaertner Note Added: 0048551
2011-10-03 17:18 Felipe Monteiro de Carvalho LazTarget 0.99.0 => 1.2
2012-03-06 07:14 Paul Ishenin Target Version 0.99.0 => 1.2.0
2012-03-07 02:36 Flávio Etrusco Note Added: 0057336
2012-03-07 03:42 Flávio Etrusco Note Added: 0057341
2012-03-18 22:25 Andrey Zubarev File Added: FixScaleOnResize.patch
2012-03-18 22:27 Andrey Zubarev Note Added: 0057821
2013-06-23 16:21 Mattias Gaertner Relationship added related to 0018298
2014-02-15 20:51 Martin Friebe LazTarget 1.2 => 1.4
2014-02-15 20:52 Martin Friebe Target Version 1.2.0 => 1.4
2014-10-06 22:20 Mattias Gaertner Note Added: 0078025
2014-10-06 22:20 Mattias Gaertner Status assigned => resolved
2014-10-06 22:20 Mattias Gaertner Resolution open => fixed
2014-10-06 22:40 Andrey Zubarev Note Added: 0078026
2014-10-06 23:15 Mattias Gaertner Status resolved => assigned
2014-10-06 23:15 Mattias Gaertner Resolution fixed => reopened
2014-10-06 23:16 Mattias Gaertner Note Added: 0078027
2014-10-07 00:05 Andrey Zubarev Note Added: 0078029
2014-10-07 00:07 Andrey Zubarev File Added: stillpresent.gif
2014-10-07 02:11 Mattias Gaertner Note Added: 0078035
2014-10-07 07:39 Andrey Zubarev Note Added: 0078038
2014-10-08 01:06 Mattias Gaertner Note Added: 0078061
2014-10-08 06:07 Andrey Zubarev Note Added: 0078063
2014-10-08 06:44 Andrey Zubarev Note Added: 0078064
2014-10-08 06:44 Andrey Zubarev File Added: anchordocklayout.xml
2014-10-08 06:45 Andrey Zubarev File Added: before_saving.png
2014-10-08 06:45 Andrey Zubarev File Added: after_restoring.png
2014-10-19 13:15 Juha Manninen Relationship added related to 0026895
2015-04-27 21:59 Juha Manninen LazTarget 1.4 => -
2015-04-27 22:02 Juha Manninen Target Version 1.4 =>
2015-12-29 17:30 Juha Manninen Assigned To Mattias Gaertner => Juha Manninen
2015-12-29 17:30 Juha Manninen Relationship added related to 0017908
2015-12-29 18:15 Juha Manninen Note Added: 0088410
2015-12-29 18:15 Juha Manninen Status assigned => feedback
2015-12-29 18:15 Juha Manninen Note Edited: 0088410 View Revisions
2015-12-29 20:32 Andrey Zubarev Note Added: 0088416
2015-12-29 20:32 Andrey Zubarev Status feedback => assigned
2015-12-29 23:04 Juha Manninen Note Added: 0088418
2015-12-31 14:29 Ondrej Pokorny Fixed in Revision => 51097
2015-12-31 14:29 Ondrej Pokorny LazTarget - => 1.6
2015-12-31 14:29 Ondrej Pokorny Fixed in Version => 1.7 (SVN)
2015-12-31 14:29 Ondrej Pokorny Target Version => 1.6
2015-12-31 14:37 Ondrej Pokorny Note Added: 0088464
2015-12-31 15:28 Ondrej Pokorny Relationship added related to 0029298
2016-01-01 10:41 Juha Manninen Fixed in Revision 51097 => r51097, r51098, r51099
2016-01-01 10:41 Juha Manninen Note Added: 0088488
2016-01-01 10:41 Juha Manninen Status assigned => resolved
2016-01-01 10:41 Juha Manninen Resolution reopened => fixed
2016-01-02 10:29 Andrey Zubarev Note Added: 0088519
2016-01-02 10:29 Andrey Zubarev Status resolved => closed