Bug 202957

Summary: unexpected Paint events when RTL
Product: [Eclipse Project] Platform Reporter: Grant Gayed <grant_gayed>
Component: SWTAssignee: Steve Northover <steve_northover>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: steve_northover
Version: 3.4   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Grant Gayed CLA 2007-09-11 13:34:55 EDT
note that problem does not happen on win2000

- run the snippet below
- click repeatedly on the scrollbars such that they are not moved
  -> you'll see "paint" written to stdout for each click, which should not happen since the viewport did not change
- if you remove the SWT.RIGHT_TO_LEFT style from the snippet then you won't get the unexpected Paint events

public static void main(String[] args) {
	final Display display = Display.getDefault();
	final Shell shell = new Shell(display, SWT.RESIZE | SWT.CLOSE | SWT.RIGHT_TO_LEFT);
	shell.setLayout(new FillLayout());
	final ScrolledComposite scrolledC = new ScrolledComposite(shell, SWT.H_SCROLL | SWT.V_SCROLL);
	scrolledC.setLayout(new FillLayout());
	final Canvas canvas = new Canvas(scrolledC, SWT.NONE);
	final PaintListener paintListener = new PaintListener() {
		public void paintControl(PaintEvent e) {
			System.out.println("paint");
		}
	};
	canvas.addPaintListener(paintListener);
	scrolledC.setContent(canvas);
	scrolledC.setExpandHorizontal(true);
	scrolledC.setExpandVertical(true);
	scrolledC.setMinSize(350, 350);
	shell.setSize(300, 300);
	shell.open();
	while (!shell.isDisposed()) {
		if (!display.readAndDispatch()) display.sleep();
	}
	display.dispose();
}
Comment 1 Eclipse Webmaster CLA 2019-09-06 15:30:26 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.