Bug 414643 - GTK3 - Duplicated Items in the Combo
Summary: GTK3 - Duplicated Items in the Combo
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.4   Edit
Hardware: PC Linux
: P3 critical (vote)
Target Milestone: 4.3.1   Edit
Assignee: Alexander Kurtakov CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 340067
  Show dependency tree
 
Reported: 2013-08-08 04:36 EDT by Krzysztof Daniel CLA
Modified: 2013-08-21 07:30 EDT (History)
3 users (show)

See Also:
Silenio_Quarti: review+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Krzysztof Daniel CLA 2013-08-08 04:36:26 EDT
Steps to reproduce:
* Open Help->Install New software
* click Available Software Sites
* change anything (add repo, disable and enable it)
* close the dialog

*expected 
 work with combo box lists available repositories
* actual
 work with combo box duplicates each repository a couple of times
 
 Additional info: happens only if in GTK3 mode, GTK2 works fine.
Comment 1 Krzysztof Daniel CLA 2013-08-08 04:46:08 EDT
Following snippet replaces combo items in GTK2, but adds them in GTK3. This is a critical issue.

        Shell shell = new Shell();
		shell.setLayout(new GridLayout());
		final Combo combo = new Combo(shell, SWT.DROP_DOWN);
		combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
		combo.setItems(new String[]{"a","b","c"});
		Button button = new Button(shell, SWT.PUSH);
		button.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false,
				false));
		button.setText("reset");
		button.addSelectionListener(new SelectionAdapter() {
			int i;
			@Override
			public void widgetSelected(SelectionEvent e) {
				combo.setItems(new String[]{"click" + i++});
			}
		});
		shell.layout();
		shell.open();
		while(!shell.isDisposed()){
			if(!Display.getCurrent().readAndDispatch()){
				Display.getCurrent().sleep();
			}
		}
Comment 3 Alexander Kurtakov CLA 2013-08-12 16:14:03 EDT
Silenio, what do you think about backporting such fixes for kepler SR releases?
Comment 4 Silenio Quarti CLA 2013-08-12 16:39:46 EDT
I am ok back porting the fix, but first we need to fix all references to gtk_combo_box_remove_text() to either call gtk_combo_box_text_remove() or gtk_combo_box_text_remove_all().
Comment 5 Alexander Kurtakov CLA 2013-08-12 17:19:31 EDT
Done with http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=0abcaf5e238ad1d67e0ff4fd7f34e24c72e4a2bf .
What's the procedure to backport? Just cherrypick? Anything special I need to set in bugzilla, etc?
Comment 6 Silenio Quarti CLA 2013-08-12 17:52:40 EDT
Looks good.

Follow the rules [1], cherrypick, set target milestone to 4.3.1.   And since there are native changes, we will have to increment the version and build libraries, but this part is done by our build process.

[1] http://www.eclipse.org/eclipse/development/plans/freeze_plan_4_3_1.php
Comment 7 Alexander Kurtakov CLA 2013-08-13 15:25:40 EDT
OK, cherry picked and set the target, hope that there is nothing I missed.
Comment 8 Alexander Kurtakov CLA 2013-08-20 06:42:09 EDT
Backported to kepler.