Bug 434980 - Tree widget flicks during redrawing
Summary: Tree widget flicks during redrawing
Status: RESOLVED INVALID
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.4   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 4.5   Edit
Assignee: Niraj Modi CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 435024
  Show dependency tree
 
Reported: 2014-05-15 11:55 EDT by Daniel Rolka CLA
Modified: 2015-03-18 19:50 EDT (History)
4 users (show)

See Also:


Attachments
Sample presenting the gaps/cheese issue (3.58 KB, text/plain)
2014-05-16 07:50 EDT, Daniel Rolka CLA
no flags Details
Sample presenting the flicking issue during redrawing the entire Tree (2.44 KB, text/plain)
2014-05-16 07:57 EDT, Daniel Rolka CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Rolka CLA 2014-05-15 11:55:33 EDT
The Tree widget flicks when we redraw it with the Tree.redraw() method on the Windows platform.

One of the possible solutions is redrawing of the Tree with the double-buffering (using the BitBlt method - http://msdn.microsoft.com/en-gb/library/windows/desktop/dd183370%28v=vs.85%29.aspx)
Comment 1 Dani Megert CLA 2014-05-16 03:24:12 EDT
Daniel, please attach an SWT snippet that shows the problem.
Comment 2 Daniel Rolka CLA 2014-05-16 07:50:37 EDT
Created attachment 243172 [details]
Sample presenting the gaps/cheese issue
Comment 3 Daniel Rolka CLA 2014-05-16 07:57:41 EDT
Created attachment 243173 [details]
Sample presenting the flicking issue during redrawing the entire Tree

I've attached two snippets:

1) 'Sample presenting the gaps/cheese issue' -> it is just to show the original issue that we try to fix

2) 'Sample presenting the flicking issue during redrawing the entire Tree' -> the flicking issue that want to fix with this bug. Basically the more complicated Tree to draw (i.e. with images or multi-level structure -> redraw of the tree consumes more time), the flicking issue is better visible

Daniel
Comment 4 Markus Keller CLA 2014-05-21 08:42:39 EDT
(In reply to Daniel Rolka from comment #2)
> Created attachment 243172 [details]
> Sample presenting the gaps/cheese issue

This snippet is invalid client code. When the user clicks the same item again,
- SWT sends a PaintEvent
- the CheeseIssueSimulator fills the whole tree with white
- the CheeseIssueSimulator only calls gc.drawText(..) for the selected item

=> SWT has nothing more to do. Note that listening to Paint events is not the right approach to replace tree drawing. Clients should use the owner draw APIs (bug 81334), which operate on individual TreeItems, and not on the whole Tree like PaintEvents.


(In reply to Daniel Rolka from comment #3)
> Created attachment 243173 [details]
> Sample presenting the flicking issue during redrawing the entire Tree

I don't see any flickering when I click items in this tree.
Comment 5 Daniel Rolka CLA 2014-05-21 09:20:35 EDT
(In reply to Markus Keller from comment #4)
> (In reply to Daniel Rolka from comment #3)
> > Created attachment 243173 [details]
> > Sample presenting the flicking issue during redrawing the entire Tree
> 
> I don't see any flickering when I click items in this tree.

Have you tried the sample on Windows? On my Windows 7 I see flicking

Daniel
Comment 6 Dani Megert CLA 2014-05-21 09:29:58 EDT
(In reply to Daniel Rolka from comment #5)
> (In reply to Markus Keller from comment #4)
> > (In reply to Daniel Rolka from comment #3)
> > > Created attachment 243173 [details]
> > > Sample presenting the flicking issue during redrawing the entire Tree
> > 
> > I don't see any flickering when I click items in this tree.
> 
> Have you tried the sample on Windows? On my Windows 7 I see flicking
> 
> Daniel

Just tried on Windows 7 against SWT from RC1. No flickering when clicking on tree items.
Comment 7 Daniel Rolka CLA 2014-05-21 09:52:22 EDT
Unfortunately I see the flicking clicking on the Tree. It seems we have to consider the hardware in the issue as well

Daniel
Comment 8 Dani Megert CLA 2014-05-21 09:55:20 EDT
Which JRE are you using?
Are you using 32- or 64-bit SWT?
Comment 9 Daniel Rolka CLA 2014-05-21 10:06:58 EDT
(In reply to Dani Megert from comment #8)
> Which JRE are you using?

java version "1.6.0"
Java(TM) SE Runtime Environment (build pwa6460sr9ifix-20110211_02(SR9+IZ94423))
IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 Windows 7 amd64-64 jvmwa6460sr9-20101
124_69295 (JIT enabled, AOT enabled)
J9VM - 20101124_069295
JIT  - r9_20101028_17488ifx2
GC   - 20101027_AA)
JCL  - 20110211_02

> Are you using 32- or 64-bit SWT? org.eclipse.swt.win32.win32.x86_64_3.103.0.v20140514-1435.jar

Daniel
Comment 10 Daniel Rolka CLA 2014-05-22 09:57:06 EDT
(In reply to Daniel Rolka from comment #0)
> The Tree widget flicks when we redraw it with the Tree.redraw() method on
> the Windows platform.
> 
> One of the possible solutions is redrawing of the Tree with the
> double-buffering (using the BitBlt method -
> http://msdn.microsoft.com/en-gb/library/windows/desktop/dd183370%28v=vs.
> 85%29.aspx)

I see that the drawing with the double buffering has been already added to the Tree widget. We have to use the style SWT.DOUBLE_BUFFERING for that.

However it doesn't solve the issue - I still see the flicking clicking on the SampleOfStylingPreferencesWithCSS.Tree

Daniel
Comment 11 Dani Megert CLA 2014-05-27 07:27:59 EDT
(In reply to Daniel Rolka from comment #9)
> (In reply to Dani Megert from comment #8)
> > Which JRE are you using?
> 
> java version "1.6.0"
> Java(TM) SE Runtime Environment (build
> pwa6460sr9ifix-20110211_02(SR9+IZ94423))
> IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 Windows 7 amd64-64

I tried with the latest version of the IBM JRE 6 (sr16) and it also doesn't flicker.

Note that I talk about 'SampleOfStylingPreferencesWithCSS' not the 'CheeseIssueSimulator' which is just wrong client code (see comment 4 for details).
Comment 12 Lars Vogel CLA 2015-03-18 19:50:43 EDT
(In reply to Dani Megert from comment #11)
> (In reply to Daniel Rolka from comment #9)
> > (In reply to Dani Megert from comment #8)
> > > Which JRE are you using?
> > 
> > java version "1.6.0"
> > Java(TM) SE Runtime Environment (build
> > pwa6460sr9ifix-20110211_02(SR9+IZ94423))
> > IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 Windows 7 amd64-64
> 
> I tried with the latest version of the IBM JRE 6 (sr16) and it also doesn't
> flicker.

I have not seen any additional bugs reports on this so I mark it as invalid.