eclipse / nebula

Nebula Project
https://eclipse.org/nebula
Eclipse Public License 2.0
84 stars 98 forks source link

TableComboViewer dropdown not closed automatically on mouse click on the dialog area #499

Closed ajaylamba-provar closed 6 months ago

ajaylamba-provar commented 1 year ago

Thr dropdown of TableCombo is not closed when clicking on empty space on the parent dialog. The TableComboViewer uses TableCombo internally which handles the dropdown open and close action through org.eclipse.nebula.widgets.tablecombo.TableCombo.dropDown(boolean).

In the latest version 1.2.0 of tablecombo, the parent dialog remains activated when dropdown is opened. This in turn causes issues in closing the dropdown.

Note: The dropdown is closed when clicked on any control e.g. text, button etc. because of respective event trigger. It also gets closed when the parent dialog moves out of focus.

Versions: org.eclipse.nebula.widgets.tablecombo - 1.2.0 org.eclipse.swt.win32.win32.x86_64 - 3.121.0 Eclipse version - 2022-09 JDK-11.0.16.9 (Amazon Corretto) OS - Windows 10

ajaylamba-provar commented 1 year ago

One more thing I noticed is that when the dropDown is opened, the parent dialog box doesn't loose focus which means focusOut event is not triggered? While in older versions of eclipse/swt/nebula, the parent dialog is no more in focus and when we click again on the dialog, probably the focus event is triggered but not very sure about this.

wimjongman commented 1 year ago

Hey Ajay. Thanks for the analysis. Can you make a patch and provide it through a pull request?

Please see the README on how to set up a development environment.

ajaylamba-provar commented 1 year ago

Hi @wimjongman, I think there is some misunderstanding here. I have not found the root cause yet. I have added my analysis just to help in understanding the issue.

wimjongman commented 1 year ago

Ah, ok. It looks like you are very much qualified to contribute. Just give it a try.

ajaylamba-provar commented 1 year ago

yes, I am trying to find the root cause. It's just that it is difficult to debug because of different events being triggered e.g. focusOut on moving the cursor to the debug window :D. Will give it another try and will add my analysis.

wimjongman commented 1 year ago

Yes, that is tricky. Maybe add some tracing in the events?

wimjongman commented 1 year ago

With tracing I mean some console printing.

ajaylamba-provar commented 1 year ago

This seems to be similar to the issue https://bugs.eclipse.org/bugs/show_bug.cgi?id=543226. @lcaron

And it is occurring due to the changes done in https://github.com/eclipse/nebula/commit/e2295ddc18d4fd1e11d49de759faa314d292d874. @mpscholz @wimjongman

It is working fine if we revert the changes done in https://github.com/eclipse/nebula/commit/e2295ddc18d4fd1e11d49de759faa314d292d874

ajaylamba-provar commented 1 year ago

@mpscholz could you please suggest?

mpscholz commented 1 year ago

Hi Ajay,

Sorry, this escaped me due to the holidays...

It's been quite a time ago, but if I remember well, the commit fixed a serious bug in the TableCombo widget in connection with misleading selection change events being sent. Hence, I'd apply for not reverting the change but fixing the present issue on top of it. Otherwise, we'd replace one bug simply with another (serious) one.

Best, MP

Am Mo., 9. Jan. 2023 um 10:25 Uhr schrieb Ajay Kumar < @.***>:

@mpscholz https://github.com/mpscholz could you please suggest?

— Reply to this email directly, view it on GitHub https://github.com/eclipse/nebula/issues/499#issuecomment-1375322600, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMV4IIZKTVYZHTVTDM5ICLWRPKOXANCNFSM6AAAAAATCAI7QY . You are receiving this because you were mentioned.Message ID: @.***>

mpscholz commented 1 year ago

In any case, we obviously lack unit tests for both use cases ...

Am Mo., 9. Jan. 2023 um 14:20 Uhr schrieb Matthias Paul Scholz < @.***>:

Hi Ajay,

Sorry, this escaped me due to the holidays...

It's been quite a time ago, but if I remember well, the commit fixed a serious bug in the TableCombo widget in connection with misleading selection change events being sent. Hence, I'd apply for not reverting the change but fixing the present issue on top of it. Otherwise, we'd replace one bug simply with another (serious) one.

Best, MP

Am Mo., 9. Jan. 2023 um 10:25 Uhr schrieb Ajay Kumar < @.***>:

@mpscholz https://github.com/mpscholz could you please suggest?

— Reply to this email directly, view it on GitHub https://github.com/eclipse/nebula/issues/499#issuecomment-1375322600, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMV4IIZKTVYZHTVTDM5ICLWRPKOXANCNFSM6AAAAAATCAI7QY . You are receiving this because you were mentioned.Message ID: @.***>

ajaylamba-provar commented 1 year ago

Thanks for your input @mpscholz.

lcaron commented 6 months ago

Bug fixed in Nebula 3.1.1