Community
Participate
Working Groups
Build Identifier: M20100909-0800 When a compsite with control is scrolling, the control decorater's images are displayed outside the composite Reproducible: Always Steps to Reproduce: 1.Add a control with decorator image to a scrollable composite. 2.Scroll the composite till control is not visible 3.When the control is not visible minimize the application. 4.Again when you maximize the appliation decorator image for the control will be visible outside the composite.
Created attachment 190965 [details] ControlDecorator initialy
Created attachment 190966 [details] ControlDecorator when scrolled
Created attachment 190967 [details] ControlDecorator after minimize and maximize the application
Any Update on this bug
Can you add a code snippet to this problem ? Thank you.
Created attachment 195035 [details] Sample source code Please find the attached project which contains a view similar to the screen shot attached, to reproduce the bug please follow the same steps.
I suspect the problem in is ControlDecoration which is drawing the image when it should not. Please send the problem back if I'm wrong.
you are correct the the control decorator draw the image when its not required. I debugged this issues and found that when the control are there in scroll composite even if it is at invisible area there is no change in state. so when control decorator draws the image it is not able to find that control is visible or not.
any update on this bug
In one of our RCP applications (Eclipse Kepler 4.3) we are facing this problem too. Is there any update on this issue?
(In reply to Florian Klein from comment #10) > In one of our RCP applications (Eclipse Kepler 4.3) we are facing this > problem too. Is there any update on this issue? No one is working on this. A good quality patch would be appreciated.
I've seen this issue too and had a few minutes to fiddle. The quick workaround is to use the 3-argument ControlDecoration constructor to explicitly specify the top-most composite where the decoration should be drawn. In the example app specified here, you'd change SampleView.java line 130 from: ControlDecoration controlDecoration = new ControlDecoration(text, SWT.LEFT | SWT.TOP); to ControlDecoration controlDecoration = new ControlDecoration(text, SWT.LEFT | SWT.TOP, scrolledComposite); ControlDecoration installs paint listeners on each of the ancestors of the decorated-control. This is done in case the control's parent does not have enough space for the decoration to be drawn. The 2-arg variant causes these listeners to be installed on all ancestors up to the Shell; the 3-argument constructor limits itself to the specified composite. These paint listeners check that the control is visible and if so computes the location within the hosting composite and draws the decoration. The decoration could be drawn multiple times, but that may be necessary if there isn't enough space in one of the sub composites. Going up to the Shell is normally fine, except when encountering a ScrolledComposite as the decorated control may have been scrolled out of view. We can't easily determine whether widget within a ScrollableComposite is currently visible (that is, isVisible()/getVisible() return true). And so the paint listeners on the parents of the ScrolledComposite compute a location and draw the decoration in a position that is outside of the viewable area. I think the solution here is to consider ScrolledComposites to be a limiting parent, just like a Shell. https://git.eclipse.org/r/40483
Thanks a lot. This solved our problem.
Committed: https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=9d3f213510f8ab6069131915f41ddc1ae36545c8
I'm marking this as verified in I20150316-0800: it seemed to be the cause of flickering decorators seen when opening a pom.xml in m2e, which I no longer see (phew).
*** Bug 342149 has been marked as a duplicate of this bug. ***