Bug 29607 - [Cell Editors] usability: ComboBoxCellEditor unusable on GTK
Summary: [Cell Editors] usability: ComboBoxCellEditor unusable on GTK
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.1   Edit
Hardware: PC Linux-GTK
: P1 major (vote)
Target Milestone: 2.1 RC1   Edit
Assignee: Veronika Irvine CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-16 05:49 EST by Adam Kiezun CLA
Modified: 2003-02-11 14:17 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Kiezun CLA 2003-01-16 05:49:12 EST
20030114
i cannot select anything from any comboboxcelleditor on gtk - it either does 
not expand at all or expands and hides the list right away

this affects the task list as well as java editor hovers pref page
Comment 1 Andrew Irvine CLA 2003-01-20 15:58:54 EST
Eclipse 20030120:
The UI propertySheet example appears to be working correctly.  I tried an SWT 
standalone example, it also worked.  The hover preference page did not work, in 
my case the list was displayed, and I could select an entry but the property 
sheet did not reflect the change.  Motif was fine.

What version of linux and GTK are you using? 
Comment 2 Adam Kiezun CLA 2003-01-21 03:54:13 EST
i think linux is RH 7.2
how do i check gtk version?
Comment 3 Andrew Irvine CLA 2003-01-22 09:02:36 EST
Using I20030121 I have verified the correct behaviour on both Windows XP and 
Motif.  I have verified the incorrect behaviour on GTK.

Not all ComboBoxCellEditor usage is broken.  For example the use in the UI 
propertySheet example is correct, yet the two example mentioned by Adam are not 
working.

Both Adam and I are using RH 7.2, I believe we are both using GTK 2.0.0.  I 
have seen the same behavious on RH 8.0 (Grant's machine), not sure which 
release of Eclipse was running.

Routing to SWT for further investigation.
Comment 4 Veronika Irvine CLA 2003-02-05 15:25:48 EST
RH 8.0 comes with GTK 2.0.6 which is the minimum requirement for SWT.

Adam, what event are you detecting for hiding the cell editor?  There is a bug 
on GTK that the focus lost event is sent from the CCOmbo when the list is 
popped down. I thought there was already a bug report about this but I can not 
find it now.

Reminder to me - on GTK when the FocusLost event is sent, getFocusControl still 
returns the old focus widget not the widget that now has focus.
Comment 5 Adam Kiezun CLA 2003-02-06 04:57:05 EST
>Adam, what event are you detecting for hiding the cell editor?
no idea, i don't do that from code - it's a 'user' bug report :)
Comment 6 Veronika Irvine CLA 2003-02-11 13:02:43 EST
Investigated differences between FocusIn and FocusOut on different platforms.

Test Case:

import org.eclipse.swt.*;
import org.eclipse.swt.events.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;

public class Bug29607 {

public static void main(String[] args) {

	final Display display = new Display();
	Shell shell = new Shell(display, SWT.SHELL_TRIM);
	shell.setLayout(new RowLayout());
	Text b = new Text(shell, SWT.BORDER);
	b.setText("text 1");
	b.addFocusListener(new FocusAdapter() {
		public void focusGained(FocusEvent e) {
			System.out.println("Focus Gained "+e.widget+" control 
= "+display.getFocusControl());
		}
		public void focusLost(FocusEvent e) {
			System.out.println("Focus Lost "+e.widget+" control 
= "+display.getFocusControl());
		}		
	});
	b = new Text(shell, SWT.BORDER);
	b.setText("text 2");
	b.addFocusListener(new FocusAdapter() {
		public void focusGained(FocusEvent e) {
			System.out.println("Focus Gained "+e.widget+" control 
= "+display.getFocusControl());
		}
		public void focusLost(FocusEvent e) {
			System.out.println("Focus Lost "+e.widget+" control 
= "+display.getFocusControl());
		}		
	});
	shell.pack();
	shell.open();
	while (!shell.isDisposed()) {
		if (!display.readAndDispatch())
			display.sleep();
	}
	display.dispose();
}
}

Results:

GTK Send:                               GTK Post:

FocusGained T1 control = T1             FocusGained T1 control = T1
FocusLost   T1 control = T1             FocusLost   T1 control = T2
FocusGained T2 control = T2             FocusGained T2 control = T2

Motif Send:                             Motif Post:

FocusGained T1 control = T1             FocusGained T1 control = T1
FocusLost   T1 control = T1             FocusLost   T1 control = T2
FocusGained T2 control = T2             FocusGained T2 control = T2

Windows Send:                           Windows Post:

FocusGained T1 control = T1             FocusGained T1 control = T1
FocusLost   T1 control = T2             FocusLost   T1 control = T2
FocusGained T2 control = T2             FocusGained T2 control = T2

Mac Send:                               Mac Post:

(no widget has focus to start with)     (no widget has focus to start with)
FocusGained T1 control = null           FocusGained T1 control = T1
FocusLost   T1 control = T1             FocusLost   T1 control = T2
FocusGained T2 control = null           FocusGained T2 control = T2
Comment 7 Veronika Irvine CLA 2003-02-11 14:17:14 EST
Fixed.

Ran the getFocusControl in CCombo asynchronously.

The issues with getFocusControl are discussed in bug report 4479.