View Issue Details

IDProjectCategoryView StatusLast Update
0032618LazarusIDEpublic2017-10-31 06:09
ReporterPascal Riekenberg Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformi386OSWindows 10 x64 
Product Version1.9 (SVN) 
Summary0032618: Window menu does not show tabed windows if tab is not active (docked mode)
DescriptionWith anchordocking enabled and some windows tabed together.
The windows in the non active pages do not show in the window menu.
Additional InformationAttached patch fixes this.
TagsNo tags attached.
Fixed in Revisionr56244
LazTarget-
WidgetsetWin32/Win64
Attached Files

Activities

Pascal Riekenberg

2017-10-27 13:04

developer  

mainbase.pas.patch (1,096 bytes)   
Index: mainbase.pas
===================================================================
--- mainbase.pas	(revision 56213)
+++ mainbase.pas	(working copy)
@@ -1763,6 +1763,17 @@
         Items[Count-1].Free;
   end;
 
+  function IsVisible(pForm: TForm): Boolean;
+  begin
+    Result := pForm.IsVisible
+      or (
+        Assigned(IDEDockMaster)
+        and Assigned(pForm.Parent)
+        and Assigned(pForm.Parent.Parent)
+        and (pForm.Parent.Parent.ClassNameIs('TAnchorDockPage'))
+      )
+  end;
+
 var
   WindowsList: TFPList;
   i, j, ItemCount, ItemCountProject, ItemCountOther: Integer;
@@ -1785,7 +1796,7 @@
   for i:=0 to Screen.FormCount-1 do begin
     AForm:=Screen.Forms[i];
     //debugln(['TMainIDEBase.UpdateWindowMenu ',DbgSName(AForm),' Vis=',AForm.IsVisible,' Des=',DbgSName(AForm.Designer)]);
-    if (not AForm.IsVisible) or (AForm=MainIDEBar) or (AForm=SplashForm)
+    if (not IsVisible(AForm)) or (AForm=MainIDEBar) or (AForm=SplashForm)
     or IsFormDesign(AForm) or (WindowsList.IndexOf(AForm)>=0) then
       continue;
     if IDEDockMaster<>nil then
mainbase.pas.patch (1,096 bytes)   

Juha Manninen

2017-10-29 17:09

developer   ~0103808

Your patch splits the logic for IDEDockMaster into many places.
There already is:
  if not IDEDockMaster.AddableInWindowMenu(AForm) then continue;
I think you should put the new logic into function TIDEAnchorDockMaster.AddableInWindowMenu() and refactor the code as needed.

Pascal Riekenberg

2017-10-29 19:44

developer   ~0103810

Okay. Thanks for the tip. I will try to.

Pascal Riekenberg

2017-10-30 06:20

developer  

AddableInWindowMenu.pas.patch (1,674 bytes)   
Index: components/anchordocking/design/registeranchordocking.pas
===================================================================
--- components/anchordocking/design/registeranchordocking.pas	(revision 56221)
+++ components/anchordocking/design/registeranchordocking.pas	(working copy)
@@ -251,7 +251,12 @@
   Result:=false;
   if AForm is TAnchorDockHostSite then exit;
   if (DockMaster.FindControl(AForm.Name)=nil) and (AForm.Parent<>nil) then exit;
-  Result:=true;
+  Result := AForm.IsVisible
+    or (
+      Assigned(AForm.Parent)
+      and Assigned(AForm.Parent.Parent)
+      and (AForm.Parent.Parent is TAnchorDockPage)
+    );
 end;
 
 procedure TIDEAnchorDockMaster.AdjustMainIDEWindowHeight(
Index: ide/mainbase.pas
===================================================================
--- ide/mainbase.pas	(revision 56221)
+++ ide/mainbase.pas	(working copy)
@@ -1785,14 +1785,14 @@
   for i:=0 to Screen.FormCount-1 do begin
     AForm:=Screen.Forms[i];
     //debugln(['TMainIDEBase.UpdateWindowMenu ',DbgSName(AForm),' Vis=',AForm.IsVisible,' Des=',DbgSName(AForm.Designer)]);
-    if (not AForm.IsVisible) or (AForm=MainIDEBar) or (AForm=SplashForm)
-    or IsFormDesign(AForm) or (WindowsList.IndexOf(AForm)>=0) then
+    if (AForm=MainIDEBar) or (AForm=SplashForm) or IsFormDesign(AForm)
+    or (WindowsList.IndexOf(AForm)>=0) then
       continue;
     if IDEDockMaster<>nil then
     begin
       if not IDEDockMaster.AddableInWindowMenu(AForm) then continue;
     end else begin
-      if AForm.Parent<>nil then continue;
+      if (AForm.Parent<>nil) or not AForm.IsVisible then continue;
     end;
     WindowsList.Add(AForm);
   end;
AddableInWindowMenu.pas.patch (1,674 bytes)   

Pascal Riekenberg

2017-10-30 06:22

developer   ~0103822

Patch attached.

Juha Manninen

2017-10-30 09:03

developer   ~0103823

Looks very good. Applied, thanks.

There is a related issue which maybe should be reported separately:
Docked windows cannot be selected from the Window-menu. Tabbed or not tabbed, makes no difference. The focus just does not change.

Anyway I resolve this issue now.

Pascal Riekenberg

2017-10-30 09:18

developer   ~0103824

Yes, i know. It works if it's tabbed in current session and not if layout is loaded. I will investigate it later.

Issue History

Date Modified Username Field Change
2017-10-27 13:04 Pascal Riekenberg New Issue
2017-10-27 13:04 Pascal Riekenberg File Added: mainbase.pas.patch
2017-10-29 13:33 Juha Manninen Assigned To => Juha Manninen
2017-10-29 13:33 Juha Manninen Status new => assigned
2017-10-29 17:09 Juha Manninen Note Added: 0103808
2017-10-29 17:09 Juha Manninen LazTarget => -
2017-10-29 17:09 Juha Manninen Status assigned => feedback
2017-10-29 19:44 Pascal Riekenberg Note Added: 0103810
2017-10-29 19:44 Pascal Riekenberg Status feedback => assigned
2017-10-30 06:20 Pascal Riekenberg File Added: AddableInWindowMenu.pas.patch
2017-10-30 06:22 Pascal Riekenberg Note Added: 0103822
2017-10-30 08:59 Juha Manninen Assigned To Juha Manninen =>
2017-10-30 09:03 Juha Manninen Fixed in Revision => r56244
2017-10-30 09:03 Juha Manninen Note Added: 0103823
2017-10-30 09:03 Juha Manninen Status assigned => resolved
2017-10-30 09:03 Juha Manninen Resolution open => fixed
2017-10-30 09:03 Juha Manninen Assigned To => Juha Manninen
2017-10-30 09:18 Pascal Riekenberg Note Added: 0103824
2017-10-31 06:09 Pascal Riekenberg Status resolved => closed