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

Bug 98283

Summary: Combo does not drop down when used as TreeEditor.
Product: [Eclipse Project] Platform Reporter: G.W. van der Vegt <wvd_vegt>
Component: SWTAssignee: Bogdan Gheorghe <gheorghe>
Status: CLOSED DUPLICATE QA Contact:
Severity: major    
Priority: P3 CC: billy.biggs, cocoakevin, snorthov, xixiyan
Version: 3.1Keywords: triaged
Target Milestone: ---   
Hardware: All   
OS: Linux-GTK   
Whiteboard:
Attachments:
Description Flags
Combo & Text Height Bug when Editing a TreeItem none

Description G.W. van der Vegt CLA 2005-06-03 10:48:52 EDT
Hi,

I'm using a Combo as editor in a 2 column Tree. 

When the editor pops up it's not the correct height as on both Os/X and
Linux/Gtk2 it's to small so text gets clipped. The same holds for a normal Text
edit btw. Windows handles it correct and forces a minimum height of both
controls indenpend of the editors height.

When i pack the Combo and set the editors minimumHeight to the Combo.getSize().y
the initial display is correct on all three platforms. On Linux GTK2 however the
dropdown list is not displayed (the dropdown button doesn't seem to function).
The up/downarrow move the selection btw.

The dropdown list not being shown is a major flaw, the rest is very annoying for
programmers and disturbes cross platform development.

Eclipse is 3.1 RC1 but older versions also showed this problem
Comment 1 Steve Northover CLA 2005-06-06 19:09:23 EDT
Can you provide a snippet that shows the problem?  BB, have you seen this?
Comment 2 G.W. van der Vegt CLA 2005-06-07 09:40:08 EDT
Created attachment 22508 [details]
Combo & Text Height Bug when Editing a TreeItem

Hi,

I have not been able to test it on mac & os/x but it runs on win32 and contains
code directly taken from the application that i work on. Search for //* n *//
style comments to see where You can change a few things.

What happens is:

1) both the Text/Combo is smaller than the TreeItem and is shrinked on
Linux/GTK2 & Os/X but not on Win32 (at least the Combo isn't, can't remember
the Text Control). Technically on Win32 the Combo is centered above the Tree
Item's cell so when editing the top row the Combo clipped a bit too.

If that is corrected another bug surfaces: 

2) on Linux/GTK2 there is no dropdown list visible (the Combo works only by
scrolling when using the cursor keys).
Comment 3 Billy Biggs CLA 2005-06-07 12:10:09 EDT
Can you show a screenshot of the Text being clipped on GTK+ or OS X?  I can't
reproduce that behaviour here.
Comment 4 Billy Biggs CLA 2005-06-07 15:04:53 EDT
Apologies, this is trivially reproducable on OS X (but not on my GTK+ version).
 Regardless, it seems that the workaround of setting the minimumHeight to the
size is the correct thing to do: the default is to set the size to the size of
the item, and more space is required to fit the focus ring on OS X.  So, this
part is not a bug.

The combo not appearing is reproducable for me on GTK+ and I am investigating.
Comment 5 Billy Biggs CLA 2005-06-08 16:24:32 EDT
The problem is that the focus events for a Combo are being tracked on the text
entry by SWT on both GTK+ and Motif.  When the drop down appears, a FocusOut
event is sent, which causes the Combo to be disposed.
Comment 6 G.W. van der Vegt CLA 2005-06-09 08:42:54 EDT
(In reply to comment #5)
> The problem is that the focus events for a Combo are being tracked on the text
> entry by SWT on both GTK+ and Motif.  When the drop down appears, a FocusOut
> event is sent, which causes the Combo to be disposed.

Any (temporary) workarounds or must i wait for a new Build of Eclipse for this
to be fixed?
Comment 7 Billy Biggs CLA 2005-06-09 11:28:56 EDT
Fixing this will be difficult and I do not think we will be able to find a safe
fix for 3.1.  As a workaround in your code, you could not dispose the combo
editor on FocusOut, and look for other events to track as appropriate for the
application.
Comment 8 Xi Yan CLA 2018-08-16 16:18:48 EDT
I can reproduce the issue on SWT master as of today, GTK3.22.
Comment 9 Xi Yan CLA 2018-12-07 15:06:14 EST

*** This bug has been marked as a duplicate of bug 344898 ***