Community
Participate
Working Groups
There is a difference in loosing focus on Text and CCombo controls. CCombo don't notify their listeners when focus lost. For example I have example with CCombo widget as below: package org.eclipse.jface.viewers.tests.bug108431; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.CCombo; import org.eclipse.swt.events.FocusEvent; import org.eclipse.swt.events.FocusListener; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; public class CComboTest { public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setSize(300, 150); shell.setLayout(new FillLayout()); CCombo combo = new CCombo(shell, SWT.READ_ONLY); combo.add("row1"); combo.add("row2"); combo.add("row3"); combo.addFocusListener(new FocusListener() { public void focusGained(FocusEvent e) { System.out.println("Gained"); } public void focusLost(FocusEvent e) { System.out.println("Lost"); }}); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } } - make a change in the ccombo(for example by traverse key up or down), but do not give <enter> or mouseclicks - select main window of another program running (not this Eclipse instance) - the changed ccombo don't notify his listeners(This control doesn't lose focus) When you do the same on a Text, the listener are notified when focus lost. Bug 108431 depend on it because they don't be notify when focus lost.
I believe we fixed this. Duong to retest.
No. This is not fixed.
Duong, please get to the bottom of this.
The problem is that we can't tell the difference between a Shell focusLost event when the CCombo popup list is shown or when another application is selected and the Shell really lost focus. I tried several workarounds but the one that works best on all platforms is to defer the focus lost in an asyncExec. When focus is really lost, the focus control is null and isn't one of the components that makes up the ccombo (eg. text, list or button). Fixed > 080312
Hi, We are facing the same problem. On clicking the combo box it opens normally but while moving the mouse from the combo box(focus out) it is not getting closed unless mouse button is pressed on the other control or shell. We are using eclipse : 3.7.2 environment : solaris Regards, Deepak Patwal