Bug 460017 - [GTK2] Entries in combo overwrite each other when set via combo.add(String string, int index)
Summary: [GTK2] Entries in combo overwrite each other when set via combo.add(String st...
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.4.1   Edit
Hardware: PC Linux
: P5 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks: 530841
  Show dependency tree
 
Reported: 2015-02-16 09:01 EST by Markus Schorn CLA
Modified: 2018-07-12 10:16 EDT (History)
2 users (show)

See Also:


Attachments
Screenshot of the combo (18.34 KB, image/png)
2015-02-16 09:01 EST, Markus Schorn CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Schorn CLA 2015-02-16 09:01:09 EST
Created attachment 250829 [details]
Screenshot of the combo

I see the bug on Ubuntu-1404 with
   org.eclipse.swt_3.103.1.v20140903-1938.jar or 
   org.eclipse.swt_3.103.2.v20150203-1313.jar
but not with 
   org.eclipse.swt_3.103.0.v20140605.jar

Adding text to a combo using combo.add(String text, int index) causes a drop down where one entry overwrites the other in the same place. See demonstration code and attached screen shot.

Demo code:
==========

package testSWT;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class TestCombo {
    public static void main(String[] args) {
        final Display disp = Display.getDefault();
        Shell shell = new Shell(disp);
        shell.setLayout(new GridLayout());

        final Combo combo = new Combo(shell, SWT.READ_ONLY | SWT.BORDER);
        combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        combo.add("first", 0);
        combo.add("second", 1);
        combo.add("third", 1);
        combo.add("fourth", 1);

        shell.setText("Combo Test");
        shell.setSize(200, 200);
        shell.setLocation(0, 0);  
        shell.open();

        while (!shell.isDisposed()) {
            if (!disp.readAndDispatch()) {
                disp.sleep();
            }
        }
    }
}
Comment 1 Leo Ufimtsev CLA 2015-02-17 10:46:52 EST
I can reproduce on latest SWT Master Fedora 21, but only on GTK2.24. On Gtk3 the issue does not occur.
Comment 2 Eric Williams CLA 2016-08-05 09:16:55 EDT
I can reproduce this on GTK2 only, it does not happen on GTK3. GTK2 bugs are low priority at the moment, as we do not have the manpower to dedicate much time to GTK2 only fixes.
Comment 3 Leo Ufimtsev CLA 2018-02-07 10:18:03 EST
Triaging Gtk2-only bugs. Please see Bug 530841 for details.
Comment 4 Eric Williams CLA 2018-07-10 13:57:40 EDT
Please note: GTK2 support for SWT is being dropped in Eclipse 4.10 / SimRel 2018-12 release. 

See the following mail for more info: http://dev.eclipse.org/mhonarc/lists/cross-project-issues-dev/msg15783.html
Comment 5 Alexander Kurtakov CLA 2018-07-12 10:16:41 EDT
Marking the bug as wontfix as no work for GTK2 issues will happen. Please reopen if you still face the issue using GTK 3.x.