Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 371067 - Focused combo not visually detectable
Summary: Focused combo not visually detectable
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.8   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-09 07:46 EST by Dani Megert CLA
Modified: 2019-11-14 03:45 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2012-02-09 07:46:03 EST
I20120208-0800.

One can't see if a combo has focus among other widgets. Works fine if e.g. a button has the focus. This is a major usability problem.

Test Case:

1. paste the snippet [1]
2. run it
   ==> you can clearly see the focus - it's on the button
3. change the snippet to set the focus on the combo
4. run it
   ==> no clue which widget has the focus

EXPECTED: either we also see a bluish indicator like for the button or we at least show the focus ring.

Also, if I click on the widgets with the mouse, I can see the focus for the button but not the combo.

And yes, I know that this is the standard Windows 7 behavior. But similar to bug 342282 we need to override it if it's not working well.


[1]
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;

public class Snippet {


    public static void main(final String[] args) {
        final Display display = new Display();

        Shell shell = new Shell(display);
        shell.setLayout(new RowLayout());

        Label label = new Label(shell, SWT.SINGLE);
        label.setText("text:");
        final Combo combo = new Combo(shell, SWT.DROP_DOWN | SWT.READ_ONLY);
        combo.setItems(new String[] {"hello", "hi"});
        combo.select(0);
        Button button = new Button(shell, SWT.PUSH);
        button.setText("button");

        display.addFilter(SWT.KeyDown, new Listener() {
            public void handleEvent(Event event) {
                if (event.keyCode == SWT.F1) {
                    combo.redraw();
                    System.out.println("redrawing");
                }
            }
        });
        shell.setSize(200, 200);
        shell.open();
		button.setFocus();
//		combo.setFocus();
        while (!shell.isDisposed()) {
            if (!display.readAndDispatch())
                display.sleep();
        }

        display.dispose();
    }
}
Comment 1 Lars Vogel CLA 2019-11-14 03:45:19 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.