Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 327332

Summary: Tree should not show hand pointer by default on Windows 7
Product: [Eclipse Project] Platform Reporter: Markus Keller <markus.kell.r>
Component: SWTAssignee: Felipe Heidrich <eclipse.felipe>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, deepakazad, eclipse.felipe, remy.suen, Silenio_Quarti
Version: 3.7   
Target Milestone: 3.7 M4   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Patch none

Description Markus Keller CLA 2010-10-08 09:14:11 EDT
I20101005-0800

On Windows 7, the Tree widget should not show the hand pointer by default when the user moves the mouse over an item. The tree in the Windows Explorer does that because clicking a folder executes an action (feeds the right pane). But that's not the case in general. E.g. compmgmt.msc behaves like WinXP, Linux, and the Mac (shows the normal arrow cursor).

In some popups (Breadcrumb, Ctrl+O, Ctrl+E, Ctrl+3, etc.), we have special code that turns the cursor into a hand if the item under the mouse will be opened on single-click (bug 277862). In the breadcrumb, we compute the cursor individually per item (e.g. a  folder does not get the hand pointer), but this information is lost on Windows 7.
Comment 1 Felipe Heidrich CLA 2010-10-13 14:48:15 EDT
It is the OS doing it, not us.

Does it work as expected if you always set the cursor  ?
tree = new Tree(parent, style);
tree.setCursor(display.getSystemCursor(SWT.CURSOR_ARROW));

I rather not override the OS behaviour.
Comment 2 Markus Keller CLA 2010-10-14 07:08:40 EDT
> Does it work as expected if you always set the cursor  ?

Yes, that would work. But I still think the hand pointers are wrong in almost all trees. Microsoft's guidelines are also quite clear on that topic:
http://msdn.microsoft.com/en-us/library/bb545459.aspx#hand

E.g. in the Package Explorer, the cursor is a hand on item names (where a single click doesn't do anything, but it's an arrow on the twisties (where a click actually toggles expansion).
Comment 3 Felipe Heidrich CLA 2010-11-05 12:18:25 EDT
Silenio, please advise.
Should I go ahead and make the change ? 

Please bear in mind that once the change is in users that want the behaviour will not be able to get it; the control only shows the hand when the mouse is over an item, thus tree.setCursor(display.getSystemCursor(SWT.CURSOR_HANDE)); will not restore the same behavour.




Personally I agree this is a odd behaviour and I am okay disabling it.
Comment 4 Markus Keller CLA 2010-11-05 13:28:53 EDT
(In reply to comment #3)
If somebody really cries for the current behavior, you could always add a CURSOR_HAND_ON_ITEM constant later.
Comment 5 Silenio Quarti CLA 2010-11-05 17:07:43 EDT
Go ahead and make the change. The user can always add a mouse listener and change the cursor to SWT.CURSOR_HAND when the mouse is over an item.
Comment 6 Felipe Heidrich CLA 2010-11-08 11:36:09 EST
Created attachment 182634 [details]
Patch
Comment 7 Felipe Heidrich CLA 2010-11-08 13:01:02 EST
Fixed in HEAD
Comment 8 Dani Megert CLA 2010-12-08 03:09:42 EST
Thanks! I only work on Windows 7 during the test pass and this change makes the user experience much better.