Bug 207472 - "Dancing Scrollbar" in Tree
Summary: "Dancing Scrollbar" in Tree
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M3   Edit
Assignee: Steve Northover CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-25 11:32 EDT by Benjamin Pasero CLA
Modified: 2007-10-30 12:17 EDT (History)
2 users (show)

See Also:


Attachments
Scroll Thumb initially (26.71 KB, image/png)
2007-10-25 11:33 EDT, Benjamin Pasero CLA
no flags Details
Scroll Thumb after mouse-over (26.75 KB, image/png)
2007-10-25 11:33 EDT, Benjamin Pasero CLA
no flags Details
Dancing Tree Snippet (4.81 KB, text/x-java)
2007-10-25 17:35 EDT, Benjamin Pasero CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Pasero CLA 2007-10-25 11:32:43 EDT
For a while I am seeing a weird bug, where the scrollbar thumb of a Tree shows on the bottom, although it should be on top. As soon as I move the mouse over the Tree, the thumb moves up to the correct position (see the two screen shots).

I tried to get this into a snippet, but was unable to reproduce outside of RSSOwl.  It is reproducable every time in RSSOwl. What I have found out so far is:

- Its unrelated to using Custom Owner Drawn
- Its related to using Columns
- Its related to having parent tree items with childs

And most importantly: Its related to executing a UIJob from inside a Job that sets the input to the Viewer. That is, executing a display.asyncExec() from a Thread. I was unable to reproduce in RSSOwl 2 as soon as I changed the UIJob to use display.syncExec AND executing it from the UI Thread instead a Job. 

Any ideas where I could look into to find out more?

Ben
Comment 1 Benjamin Pasero CLA 2007-10-25 11:33:21 EDT
Created attachment 81169 [details]
Scroll Thumb initially
Comment 2 Benjamin Pasero CLA 2007-10-25 11:33:46 EDT
Created attachment 81170 [details]
Scroll Thumb after mouse-over
Comment 3 Benjamin Pasero CLA 2007-10-25 11:37:44 EDT
Interesting. It seems to be related to using:

TreeViewer.setAutoExpandLevel(AbstractTreeViewer.ALL_LEVELS);

If I comment out that line, the problem is gone. My initial guess is that expanding the items causes the Tree to scroll until the last expanded element becomes visible (this is OS behavior at least on windows). But then for some reason, the scrollbar stays at this position, while the first item shows.

Wasn't there a complex hack in 3.3 to support expanding items without scrolling? Maybe thats related to this UI issue.
Comment 4 Steve Northover CLA 2007-10-25 16:26:01 EDT
There was.  What the #$%#$% does TreeViewer.setAutoExpandLevel() do?  Wait, I'll go check the code ...
Comment 5 Steve Northover CLA 2007-10-25 16:35:19 EDT
From quicky inspecting the code, dancing might occur because redraw is not turned off when all items are expanded.  It doesn't help that Control.update() is performed after the setExpanded(), causing damage for each expand to be processed rather than merged when we get back to the event loop.

Having said that, the "no scroll hack" should not leave the scroll bar in a bad state at the bottom of the control.
Comment 6 Steve Northover CLA 2007-10-25 16:36:25 EDT
Is your content lazy?
Comment 7 Steve Northover CLA 2007-10-25 16:42:05 EDT
The "don't scroll fix" was bug 159586.
Comment 8 Steve Northover CLA 2007-10-25 16:43:45 EDT
Can you hack the snippet from that bug report to show the problem or write a TreeViewer example that does it?  I tried a bit but couldn't get it to happen.
Comment 9 Benjamin Pasero CLA 2007-10-25 16:46:32 EDT
I am not using SWT.VIRTUAL for the Tree or using a ILazyContentProvider, nope. I will proceed trying to get a snippet right. Its good that its reproducable _everytime_ in RSSOwl, so its only a question of time :)
Comment 10 Steve Northover CLA 2007-10-25 16:48:31 EDT
Can't wait.  I didn't expect to fix the no scroll thing without some fall out.
Comment 11 Benjamin Pasero CLA 2007-10-25 17:35:38 EDT
Created attachment 81205 [details]
Dancing Tree Snippet

Got it (see attachment). It depends on the actual number of parents and items. Say hello to SWT-Bug-of-the-year (at least for me ;-) ).
Comment 12 Steve Northover CLA 2007-10-26 11:26:17 EDT
Fixed > 20071026

The problem was that the when redraw was turned back on in a tree with columns, the scroll bar of the was not updated.

By the way, nothing "dances" for me.  Are you still seeing this somewhere?
Comment 13 Benjamin Pasero CLA 2007-10-26 11:48:13 EDT
> By the way, nothing "dances" for me.  Are you still seeing this somewhere?

Nope, looks good now.