Community
Participate
Working Groups
Try scrolling in the Eclipse editor with mouse wheel or by grabing the scrollbar thumb with the latest nightly (N20121022-1000). It leaves blured areas at the top and bottom of the text widget (depending on if scrolling up or down).
This is caused by http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=f4412fc58eebec522777379819911580021557cf
I have removed the changes for the GTK2 code path. We cannot have this bug for next week M3 build. http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=4de42eea287c8825d0a8fcad58d1afe3cfc7c290
Fixed by using gdk_window_scroll() on GTK3. http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=033543d2c530f3ef9e2efb7e2d0271a91bde3d81
Scrolling seems to work after this fix, but there are still other problems. There is pixel corruption if a open an java editor and insert lines for example.
(In reply to comment #4) > Scrolling seems to work after this fix, but there are still other problems. > There is pixel corruption if a open an java editor and insert lines for > example. I just saw this, the lines above the cursor show problems when I press Enter in the Java Editor.
*** Bug 399545 has been marked as a duplicate of this bug. ***
Simple test case: import org.eclipse.swt.*; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.GC; import org.eclipse.swt.widgets.*; public class ScrollTest { public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); final Canvas canvas = new Canvas(shell, SWT.NONE); canvas.setBounds(10, 10, 300, 300); final Color[] colors = new Color[]{ display.getSystemColor(SWT.COLOR_RED), display.getSystemColor(SWT.COLOR_CYAN), display.getSystemColor(SWT.COLOR_GREEN), display.getSystemColor(SWT.COLOR_YELLOW), display.getSystemColor(SWT.COLOR_MAGENTA) }; canvas.addListener(SWT.Paint, new Listener() { int i; public void handleEvent(Event event) { GC gc = event.gc; gc.setBackground(colors[i++ % colors.length]); gc.fillRectangle(-100, -100, 2000, 2000); gc.drawLine(event.x, event.y, event.x + event.width - 1, event.y + event.height - 1); } }); canvas.addListener(SWT.MouseDown, new Listener() { public void handleEvent(Event event) { //DOWN // canvas.scroll(0, 17, 0, 0, 300, 300, true); //UP // canvas.scroll(0, 0, 0, 17, 300, 300, true); //ENTER canvas.scroll(0, 117, 0, 100, 300, 300, true); } }); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } }
The problem is that gtk_window_scroll () always scroll the whole window. Run the test case above against GTK2 and GTK3 too see the difference. Fixed http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=99e4edefe372e2c463379777ecf1fc5a600cb35b
I reverted my last change. They code only seems to work on Ubuntu 12.04. There are different problems on Fedora 17, Fedora 18 and Ubuntu 12.10 (like black screens).
This patch works Fedora 17/18 and Ubuntu 12.04/12.10. http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=8020477095f7384b8e5f566a5db9fc33a8794ffd