Bug 552533 - DoubleClickEvent only fired in first column of TableViewer
Summary: DoubleClickEvent only fired in first column of TableViewer
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.13   Edit
Hardware: PC Windows All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-29 17:37 EDT by Pierre-Yves Bigourdan CLA
Modified: 2019-11-23 07:58 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre-Yves Bigourdan CLA 2019-10-29 17:37:35 EDT
When a DoubleClickListener is added to a TableViewer with several columns, DoubleClickEvents are only fired when the user double-clicks on the first column in the table on Windows. Double clicking on any other column seems to have no effect. On macOS and Linux, all columns trigger DoubleClickEvents.

A simple way to reproduce this problem is to open the Language Servers -> Logs preference page of lsp4e. It allows users to selectively enable file or console logging on a per language server basis, by double clicking on the different items in the table. This preference page does not work on Windows.

The relevant code creating the TableViewer is here: https://git.eclipse.org/c/lsp4e/lsp4e.git/tree/org.eclipse.lsp4e/src/org/eclipse/lsp4e/ui/LoggingPreferencePage.java

I had a dig around, but wasn't able to successfully track down the root cause of this issue. The details I've provided will hopefully be helpful.
Comment 1 Pierre-Yves Bigourdan CLA 2019-11-20 17:55:05 EST
@Mickael, added you to CC list so that you're aware this is causing issues with lsp4e on Windows.
Comment 2 Mickael Istria CLA 2019-11-21 02:56:42 EST
Thanks Pierre-Yves, I wasn't aware of this.
On LSP4E side, we could rework a bit the list to use a CheckboxCellEditor instead of double-clicking. This might be more consistent with other parts or UI and hopefully make things usable on Windows by avoiding that bug.
Comment 3 Pierre-Yves Bigourdan CLA 2019-11-22 17:15:12 EST
Hmmm... I've been playing around with TableViewer objects, and apparently creating them with SWT.FULL_SELECTION seems to solve the problem on Windows (new TableViewer(composite, SWT.FULL_SELECTION)). Any ideas why this flag is required for this operating system?
Comment 4 Paul Pazderski CLA 2019-11-22 17:31:44 EST
(In reply to Pierre-Yves B. from comment #3)
> Hmmm... I've been playing around with TableViewer objects, and apparently
> creating them with SWT.FULL_SELECTION seems to solve the problem on Windows
> (new TableViewer(composite, SWT.FULL_SELECTION)). Any ideas why this flag is
> required for this operating system?

This seem to be intentional Windows behaviour. Recognized the same when I made my fake control example in bug 550555 comment 5. The relevant code is in SWT Table#sendMouseDownEvent where the hit test only check for the first column if not in FULL_SELECTION mode.
Comment 5 Pierre-Yves Bigourdan CLA 2019-11-23 07:58:04 EST
Quite a few other bugs seem to mention similar behaviours, for instance Bug 396604. If it really is intentional behaviour, maybe it's worth updating some of the Javadocs to avoid users being caught off-guard in the future?