Bug 171205 - Tracker flickers when another shell is moved
Summary: Tracker flickers when another shell is moved
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Grant Gayed CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 92322
  Show dependency tree
 
Reported: 2007-01-22 06:48 EST by Markus Keller CLA
Modified: 2019-09-06 16:19 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2007-01-22 06:48:52 EST
I20070116-1510

The Tracker flickers when using setRectangles(..) to hold it in place (like in bug 51081) and at the same time moving a shell around.

To reproduce, run the snippet below and drag the red rectangle around.


public class TrackerFlicker {
	public static void main(String[] args) {
		Display display= new Display();
		final Shell shell= new Shell(display);

		StyledText st= new StyledText(shell, SWT.WRAP | SWT.MULTI);
		st.setBounds(10, 20, 300, 200);
		shell.setSize(400, 300);
		shell.open();

		final Shell popup= new Shell(shell, SWT.ON_TOP | SWT.NO_TRIM);
		popup.setBackground(display.getSystemColor(SWT.COLOR_DARK_RED));
		final Rectangle popupRoot= new Rectangle(100, 100, 100, 50);
		popup.setBounds(popupRoot);
		popup.open();

		final Tracker tracker= new Tracker(st, SWT.NONE);
		final Rectangle trackedRoot= new Rectangle(1000000, 0, 0, 0);
		final Rectangle staticRubber= new Rectangle(100, 100, 100, 50);
		tracker.setRectangles(new Rectangle[] { trackedRoot,
				staticRubber });
		tracker.setStippled(true);
		tracker.addControlListener(new ControlAdapter() {
			public void controlMoved(ControlEvent e) {
				Rectangle tracked= tracker.getRectangles()[0];
				int x= popupRoot.x + tracked.x - trackedRoot.x;
				int y= popupRoot.y + tracked.y - trackedRoot.y;
				popup.setLocation(x, y);
				tracker.setRectangles(new Rectangle[] { tracked,
						staticRubber });
			}
		});
		
		popup.addMouseListener(new MouseAdapter() {
			public void mouseDown(MouseEvent e) {
				tracker.open();
			}
		});
		
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
		display.dispose();
	}
}
Comment 1 Eclipse Webmaster CLA 2019-09-06 16:19:20 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.