View Issue Details

IDProjectCategoryView StatusLast Update
0029200LazarusIDEpublic2018-05-22 09:27
ReporterAnthony Walter Assigned ToMattias Gaertner  
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionopen 
PlatformLinuxOSUbuntu 
Product Version1.5 (SVN) 
Summary0029200: Desktop manager restore incorrect docked layouts when layout has docked pages
DescriptionThe following applies to Lazarus with anchordockingdsgn installed.

When restoring desktops using the "Desktop manager" layouts are incorrectly restored resulting in a unusable user interface. Lazarus will also sometimes crash if you attempt to fix the layout by dragging or resizing the docked windows using the horizontal or vertical splitter diving the docked regions.

Before where first layout is active:

http://cache.getlazarus.org/images/mantis/lazarus-docking.gif

After restoring my alternate layout the layout is corrupted (this is not how I had layed out my windows). Lazarus may now crash if you attempt to move the docked windows:

http://cache.getlazarus.org/images/mantis/lazarus-docking-restore-corrupted.gif
Steps To ReproduceLaunch Lazarus with anchordockingdsgn installed.
Open "Desktop manager" and be sure auto save is turned off.
Close "Desktop manager".
Create a new docked layout by moving docked windows around and/or adding new docked windows.
Open "Desktop manager" and save your layout to a new name.
Close "Desktop manager".
Create a different docked layout by moving docked windows around and/or adding new docked windows.
Open "Desktop manager" again save your layout to a new name.
Close "Desktop manager".

* You should now have 2 different docked layouts. *

Open "Desktop manager" one last time and restore the layout which is not active.
Close "Desktop manager".

Lazarus now has an unusable layout and may crash if you attempt to adjust the docked windows.
Additional InformationThe old layout must have docked pages (tabs). If there are no pages, there is no issue.
TagsAnchorDocking
Fixed in Revision
LazTarget-
Widgetset
Attached Files

Relationships

related to 0018298 resolvedMattias Gaertner Lazarus Please update the default layout provided with anchor docking package 
related to 0029199 closedJuha Manninen Lazarus Docked windows renamed when saving desktops 
related to 0028325 assignedMattias Gaertner Lazarus [Anchordocking] fix a major issue with undocking 
related to 0031238 closedMichl Lazarus [AnchorDocking] Faulty LoadLayoutFromConfig when used second time 
related to 0026999 closedMattias Gaertner Lazarus [AnchorDocking] Wrong loading layout after loaded undocking state 
related to 0031981 closedMichl Lazarus AnchorDockingDsgn doesn't initially respect IDE Coolbar settings 
related to 0032342 resolvedJuha Manninen Lazarus anchordocking crash 
related to 0033061 closedMichl Packages Anchordocking, the "Tab position" setting is not saved and restored 

Activities

Ondrej Pokorny

2016-01-19 15:40

developer   ~0089071

Last edited: 2016-01-19 15:43

View 2 revisions

I can confirm this issue.

The clue is that you have to dock some windows to tabs in order to reproduce it.

Btw. seems to be WS/OS-independent. I reproduced it on Windows/win32.

Ondrej Pokorny

2016-01-20 00:16

developer  

anchordocking-29200-1.patch (1,667 bytes)   
Index: components/anchordocking/anchordocking.pas
===================================================================
--- components/anchordocking/anchordocking.pas	(revision 51348)
+++ components/anchordocking/anchordocking.pas	(working copy)
@@ -610,6 +610,7 @@
     procedure SaveSettings(Settings: TAnchorDockSettings);
     function SettingsAreEqual(Settings: TAnchorDockSettings): boolean;
     procedure ResetSplitters;
+    procedure RecreateSites;
 
     // manual docking
     procedure ManualFloat(AControl: TControl);
@@ -2098,6 +2099,40 @@
     AddPopupMenuItem('OptionsMenuItem', adrsDockingOptions, @OptionsClick);
 end;
 
+procedure TAnchorDockMaster.RecreateSites;
+var
+  I: Integer;
+  S: TAnchorDockHostSite;
+  C: TControl;
+begin
+  for I := ComponentCount-1 downto 0 do
+  begin
+    if (I >= ComponentCount)
+    or not (Components[I] is TAnchorDockHostSite)
+    then
+      continue;
+
+    S := TAnchorDockHostSite(Components[I]);
+    if S.SiteType = adhstOneControl then
+    begin
+      C := S.GetOneControl;
+      if C=nil then
+        continue;
+      C.DisableAutoSizing;
+      try
+        S.Free;
+        if not IsCustomSite(C) then
+          MakeDockable(C, False);
+      finally
+        C.EnableAutoSizing;
+      end;
+    end else
+    begin
+      S.Free;
+    end;
+  end;
+end;
+
 procedure TAnchorDockMaster.ResetSplitters;
 var
   I: Integer;
@@ -2121,6 +2156,7 @@
   ControlNames:=TStringList.Create;
   fTreeNameToDocker:=TADNameToControl.Create;
   try
+    RecreateSites;
     // close all unneeded forms/controls (not helper controls like splitters)
     if not CloseUnneededControls(Tree) then exit;
 
anchordocking-29200-1.patch (1,667 bytes)   

Ondrej Pokorny

2016-01-20 00:21

developer   ~0089100

Last edited: 2016-01-20 10:12

View 3 revisions

I found a dirty solution (anchordocking-29200-1.patch) - to recreate the sites.
Unfortunately it opens new issues:
1) change desktop when docked designer is visible breaks the layout
<strike>2) autosizing of docked controls may fail</strike> - happens also without the patch
3) it is slower and flickers more

-> so it isn't a true solution. A better fix has to be found, the patch may help to find it. I have no more ideas, assigning Mattias back.

Issue History

Date Modified Username Field Change
2015-12-16 19:47 Anthony Walter New Issue
2015-12-16 19:47 Anthony Walter Tag Attached: AnchorDocking
2015-12-17 11:24 Mattias Gaertner Assigned To => Mattias Gaertner
2015-12-17 11:24 Mattias Gaertner Status new => assigned
2016-01-05 10:35 Juha Manninen Relationship added related to 0029199
2016-01-19 15:40 Ondrej Pokorny Note Added: 0089071
2016-01-19 15:43 Ondrej Pokorny Note Edited: 0089071 View Revisions
2016-01-19 19:01 Ondrej Pokorny Assigned To Mattias Gaertner => Ondrej Pokorny
2016-01-20 00:14 Ondrej Pokorny LazTarget => -
2016-01-20 00:14 Ondrej Pokorny Widgetset GTK 2 =>
2016-01-20 00:14 Ondrej Pokorny Summary Desktop manager restore incorrect docked layouts => Desktop manager restore incorrect docked layouts when layout has docked pages
2016-01-20 00:14 Ondrej Pokorny Additional Information Updated View Revisions
2016-01-20 00:16 Ondrej Pokorny File Added: anchordocking-29200-1.patch
2016-01-20 00:21 Ondrej Pokorny Note Added: 0089100
2016-01-20 00:21 Ondrej Pokorny Assigned To Ondrej Pokorny => Mattias Gaertner
2016-01-20 10:11 Ondrej Pokorny Note Edited: 0089100 View Revisions
2016-01-20 10:12 Ondrej Pokorny Note Edited: 0089100 View Revisions
2016-03-14 11:05 Ondrej Pokorny Relationship added related to 0028325
2017-03-28 08:58 Ondrej Pokorny Relationship added related to 0031238
2017-03-28 08:58 Ondrej Pokorny Relationship added related to 0026999
2017-06-21 11:27 Juha Manninen Relationship added related to 0031981
2017-08-28 18:54 Ondrej Pokorny Relationship added related to 0032342
2018-01-22 11:48 Juha Manninen Relationship added related to 0033061
2018-05-22 09:27 Mattias Gaertner Relationship added related to 0018298