Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 295480 - No selection event fired on right-click for an already selected element in a Tree
Summary: No selection event fired on right-click for an already selected element in a ...
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-18 11:04 EST by Stefan Thurnherr CLA
Modified: 2021-09-06 00:59 EDT (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 Stefan Thurnherr CLA 2009-11-18 11:04:21 EST
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.5) Gecko/20091111 Firefox/3.5.5 (.NET CLR 3.5.30729)
Build Identifier: I20090611-1540

A Tree widget with an already selected element but no
focus does not emit a selectionChanged event when regaining focus.

My use case: 2 different widgets ((Table)widget1, (Tree)widget2) as selection providers of a View. When both have a selection, and focus switches from widget1 to widget2 by directly right-clicking on the selected element of widget2, no selectionChanged event gets emitted -> the appearing context menu's selection context is the now inactive element of widget1.

Workaround: catch the focus event and manually fire a selectionChanged event.

Reproducible: Always
Comment 1 Felipe Heidrich CLA 2009-11-18 14:24:38 EST
Selection events are sent when the selection changes. In the case you described, the selection is not changing (the focus is). Therefore, not sending an event is the correct behaviour, agreed ?

(I verified that GTK behaves the same way).

closing as wont fix.
Comment 2 Markus Keller CLA 2009-11-18 14:41:21 EST
I would also not expect a selection event because the focus changes (which can also be done with the tab key).

But on left-click, you currently always get a selection event (even if the item has already been selected before). You could also send a redundant event on right-click.
Comment 3 Stefan Thurnherr CLA 2009-11-19 10:51:08 EST
Felipe, I basically agree with you that selectionChanged events should be fired when the selection changes.

The problem here is consistency when clicking an already selected element:
 * For a Table element, a selectionChanged event gets fired upon a LEFT and RIGHT mouse click
 * For a Tree element, a selectionChanged event gets fired only upon a LEFT mouse click, but not upon a RIGHT mouse click.

I suggest a consistent implementation, i.e., sending a redundant selectionChanged event as suggested by Markus in comment#2.
Comment 4 Praveen CLA 2010-03-02 06:55:57 EST
On GTK, both the Table and Tree widgets does not send Selection events on Right click, which appears to be appropriate. May be, Windows behavior should be aligned to GTK.
Comment 5 Eclipse Webmaster CLA 2019-09-06 16:18:44 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.
Comment 6 Eclipse Genie CLA 2021-09-06 00:59:29 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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.

--
The automated Eclipse Genie.