Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 155817 - [Viewers] Treeview expand/collapse ignores somewhat quick + and - clicks (doubleclicks)
Summary: [Viewers] Treeview expand/collapse ignores somewhat quick + and - clicks (dou...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M5   Edit
Assignee: Steve Northover CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 480586
  Show dependency tree
 
Reported: 2006-08-31 09:40 EDT by Fares Abdullah CLA
Modified: 2018-02-09 03:59 EST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fares Abdullah CLA 2006-08-31 09:40:06 EDT
- eclipse-SDK-3.2-win32.zip
- Windows XP
- Sun JDK 1.5.0
	Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
	Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode)

Clicking on + then - in a tree view ignores successive clicks if they are less than about half a second apart.

This is not a problem in native Windows (Windows explorer, for example).

Fixing this makes applications seem more responsive and improves the user experience. One example scenario would be missing with the mouse and expanding the wrong tree, then collapsing it immediately to expand the right one.

To reproduce:
- Start Eclipse 3.2
- Create a Java project, or go to Window->Show View->Other...
- Rapidly click on the +/- to expand and collapse a tree.
Notice how rapid successive clicks are ignored.
Comment 1 Boris Bokowski CLA 2006-09-05 11:54:11 EDT
SWT, what are we doing wrong?

Snippet15 seems to behave like the Windows Explorer: Double clicking on a tree item expands it, but double clicking on the + expands on the first click and collapses on the second click, even if the item moved as a result of the expand so that the second click does not actually happen on the item.
Comment 2 Steve Northover CLA 2006-09-05 16:33:35 EDT
You are hooking SWT.DoubleSelection which means that you are providing the actaion when a user double clicks on an item.  This disables the expand/collapse behavior of a tree item (otherwise, the expand/collapse would happen, then your double selection action would run and that would be confusing).

Am I missing something?
Comment 3 Steve Northover CLA 2006-09-05 16:39:17 EDT
Are you overriding the operating system default and expand/collapsing the node yourself?  If so, you are probably seeing XP animation that is slowing down the operation.  Try turning it off to see.
Comment 4 Markus Keller CLA 2007-01-22 10:10:18 EST
This is a bug in the SWT Tree control (win32). As soon as the first listener is registered for SWT.DefaultSelection, doubleclicks on the "+" or "-" don't work any more.

This can easily be reproduced in the Control Example by adding such a listener to the Tree control. With the SWT.DefaultSelection installed, doubleclicking on "+" only expands a tree item, but does *not* send out a DefaultSelection event.

Tree#wmNotifyChild(..):
		[..]
		case OS.NM_DBLCLK: {
			if (hooks (SWT.DefaultSelection)) return LRESULT.ONE;
			break;
		}
		[..]
=> Should not return LRESULT.ONE if the click target was the "+" / "-" box and not the item.
Comment 5 Steve Northover CLA 2007-01-22 10:43:37 EST
Is the behavior that you want for double clicking to expand and then collapse the tree right away?  Seems useless, but correct.
Comment 6 Fares Abdullah CLA 2007-01-22 10:47:40 EST
It would make applications written using SWT feel more responsive.

From comment#0: One example scenario would be missing with the mouse and expanding the wrong tree, then collapsing it immediately to expand the right one.
Comment 7 Markus Keller CLA 2007-01-22 11:33:20 EST
> Is the behavior that you want for double clicking to expand and then collapse
> the tree right away?  Seems useless, but correct.

Exactly. Actually, I need less time than the default doubleclick delay to realize that I expanded the wrong node. BTW: Under GTK, this already works as expected.
Comment 8 Steve Northover CLA 2007-01-22 12:34:04 EST
Fixed > 20070122
Comment 9 Markus Keller CLA 2007-01-24 07:48:13 EST
Thanks, works perfect in I20070123-1715.