View Issue Details

IDProjectCategoryView StatusLast Update
0037582LazarusIDEpublic2020-08-20 10:12
ReporterMark Morgan Lloyd Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformx86_64OSLinux 
Product Version2.0.9 (SVN) 
Summary0037582: Multi-file "search results" window scrollbar always starts with 100%
DescriptionIf a multi-file search returns more results than fit in the window, the vertical scrollbar always occupies the entire height until the window is resized at which point it is shrunk to the correct proportion.
Additional InformationIt hasn't always been like this, but for the moment I can't pinpoint the change.
TagsNo tags attached.
Fixed in Revisionr63788, r63797
LazTarget-
WidgetsetGTK 2
Attached Files

Relationships

related to 0034334 closedDmitry Boyarintsev Open Package Window - Treeview upside down (Regression?) 

Activities

Juha Manninen

2020-08-17 09:26

developer   ~0124942

Last edited: 2020-08-17 09:31

View 2 revisions

This happens with any widgetset. I bisected and found the guilty revision. It is r61288 by Dmitry, from 2019-05-24.
 "treeview: calling UpdateScrollbars on resizing, expand, collapse or selection move. Removed UpdateScrollbars from the darwing. Prevents Cocoa drawing (upside down) glitch. 0034334"

I guess the bug happens always when a TreeView is filled with more items than fit in the view. Not specific to search results window.
TCustomTreeView.DoPaint may be a wrong place for calling UpdateScrollbars but it should be called somewhere after filling the tree.

BrunoK

2020-08-17 16:07

reporter   ~0124947

searchresultview.pp.patch (413 bytes)   
Index: ide/searchresultview.pp
===================================================================
--- ide/searchresultview.pp	(revision 63672)
+++ ide/searchresultview.pp	(working copy)
@@ -1393,8 +1393,8 @@
 
     for i := 0 to fUpdateStrings.Count - 1 do
       AddNode(fUpdateStrings[i], TLazSearchMatchPos(fUpdateStrings.Objects[i]));
-
     Items.EndUpdate;
+    Resize;
   end;//if
 end;//EndUpdate
 
searchresultview.pp.patch (413 bytes)   

Juha Manninen

2020-08-19 01:23

developer   ~0124974

Ok, this solves the issue for search results. Other code with a similar problem can also add the Resize line.

Mark Morgan Lloyd

2020-08-19 09:29

reporter   ~0124978

Thanks everybody for looking at this. If I'd realised it was a wider problem I'd have reported it earlier, although I did mention it on the forum.

Since it's marked "resolved", should I close it or would it better be left open as a reminder that there might be more work to be done?

Juha Manninen

2020-08-19 12:43

developer   ~0124986

Is more work needed? Maybe document it somewhere?
Fixing the code so it does not cause trouble elsewhere may be difficult.

Mark Morgan Lloyd

2020-08-19 15:04

reporter   ~0124990

I was mindful of your "other code with a similar problem" comment :-)

BrunoK

2020-08-19 16:30

reporter   ~0124992

I didn't know it was a generalized problem. Next patch might, hopefully, solve the problem in the right place. At least Works with searchresultview.
treeview+revert+searchresult.patch (909 bytes)   
Index: ide/searchresultview.pp
===================================================================
--- ide/searchresultview.pp	(revision 63672)
+++ ide/searchresultview.pp	(working copy)
@@ -1393,7 +1393,6 @@
 
     for i := 0 to fUpdateStrings.Count - 1 do
       AddNode(fUpdateStrings[i], TLazSearchMatchPos(fUpdateStrings.Objects[i]));
-
     Items.EndUpdate;
   end;//if
 end;//EndUpdate
Index: lcl/include/treeview.inc
===================================================================
--- lcl/include/treeview.inc	(revision 63672)
+++ lcl/include/treeview.inc	(working copy)
@@ -2582,8 +2582,11 @@
     Include(Owner.FStates,tvsUpdating)
   else
     Exclude(Owner.FStates,tvsUpdating);
-  if not Updating then
+  if not Updating then begin
+    Include(Owner.FStates,tvsScrollbarChanged);
+    Owner.UpdateScrollbars;
     Owner.Invalidate;
+  end;
 end;
 
 procedure TTreeNodes.EndUpdate;

Juha Manninen

2020-08-20 10:12

developer   ~0125007

Applied, thanks.
UpdateScrollbars is now called a little more often but not too much.

Issue History

Date Modified Username Field Change
2020-08-16 15:50 Mark Morgan Lloyd New Issue
2020-08-17 09:21 Juha Manninen Assigned To => Dmitry Boyarintsev
2020-08-17 09:21 Juha Manninen Status new => assigned
2020-08-17 09:26 Juha Manninen Note Added: 0124942
2020-08-17 09:26 Juha Manninen Relationship added related to 0034334
2020-08-17 09:31 Juha Manninen Note Edited: 0124942 View Revisions
2020-08-17 16:07 BrunoK Note Added: 0124947
2020-08-17 16:07 BrunoK File Added: searchresultview.pp.patch
2020-08-19 01:20 Juha Manninen Assigned To Dmitry Boyarintsev => Juha Manninen
2020-08-19 01:23 Juha Manninen Status assigned => resolved
2020-08-19 01:23 Juha Manninen Resolution open => fixed
2020-08-19 01:23 Juha Manninen Fixed in Revision => r63788
2020-08-19 01:23 Juha Manninen LazTarget => -
2020-08-19 01:23 Juha Manninen Widgetset GTK 2 => GTK 2
2020-08-19 01:23 Juha Manninen Note Added: 0124974
2020-08-19 09:29 Mark Morgan Lloyd Note Added: 0124978
2020-08-19 12:43 Juha Manninen Note Added: 0124986
2020-08-19 15:04 Mark Morgan Lloyd Note Added: 0124990
2020-08-19 16:30 BrunoK Note Added: 0124992
2020-08-19 16:30 BrunoK File Added: treeview+revert+searchresult.patch
2020-08-19 20:10 Juha Manninen Status resolved => assigned
2020-08-19 20:10 Juha Manninen Resolution fixed => open
2020-08-20 10:12 Juha Manninen Status assigned => resolved
2020-08-20 10:12 Juha Manninen Resolution open => fixed
2020-08-20 10:12 Juha Manninen Fixed in Revision r63788 => r63788, r63797
2020-08-20 10:12 Juha Manninen Widgetset GTK 2 => GTK 2
2020-08-20 10:12 Juha Manninen Note Added: 0125007