Bug 243894 - Debug view should not scroll to right when breakpoint is hit
Summary: Debug view should not scroll to right when breakpoint is hit
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.7   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard:
Keywords: polish
: 307735 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-08-12 11:22 EDT by Markus Keller CLA
Modified: 2011-03-25 11:55 EDT (History)
2 users (show)

See Also:


Attachments
fix (1.64 KB, patch)
2011-03-25 11:54 EDT, Silenio Quarti CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2008-08-12 11:22:29 EDT
I20080807-1402, was OK in 3.3.2 and 3.4.

Paste the class below to the Package Explorer, set the breakpoint, and then debug as Java application. When the breakpoint is hit (in both threads), make sure that the Debug view is so narrow that its toolbar just fits on one row (the view then shows a horizontal scroll bar). Press F8.
=> Was: Tree scrolls to the right
=> Expected: Tree should not scroll horizontally

Even when you drag the thumb to the left, pressing F8 always scrolls to the right again.

package xy;

public class Try {

	public static void main(String[] args) {
		new Thread("Worker") {
			public void run() {
				goDeep();
			}
		}.start();
		goDeep();
	}

	static void goDeep() {
		for (int i = 0; i < 10; i++) {
			deep(50);
		}
	}

	private static void deep(int i) {
		if (i > 0) {
			deep(i - 1);
		} else {
			try {
				Thread.sleep(1000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			System.out.println("hi"); // breakpoint
		}
	}
}
Comment 1 Markus Keller CLA 2008-11-12 09:33:11 EST
Still very annoying in I20081111-0800. When I debug threading problems, I often lose context in the tree and have to scroll back manually.
Comment 2 Markus Keller CLA 2011-03-11 09:30:21 EST
*** Bug 307735 has been marked as a duplicate of this bug. ***
Comment 3 Markus Keller CLA 2011-03-11 09:32:32 EST
This is still quite annoying in I20110310-1119. Would make a great polish item. If the problem is in SWT, please move the bug.
Comment 4 Silenio Quarti CLA 2011-03-25 11:53:18 EDT
The problem happens because Tree.setTopItem() is called for the thread tree item (Thread [main] ...) which is longer than the tree itself. The OS call to set the top item also scrolls horizontally to reveal the item's text.

I believe Tree.setTopItem() should not scroll horizontally. This is the behavior in other platforms.
Comment 5 Silenio Quarti CLA 2011-03-25 11:54:18 EDT
Created attachment 191916 [details]
fix
Comment 6 Silenio Quarti CLA 2011-03-25 11:55:43 EDT
Fixed > 20110325