| Summary: | Can't select tool items when tool bar has a DragDetect listener | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Brock Janiczak <brockj> |
| Component: | SWT | Assignee: | Billy Biggs <billy.biggs> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | critical | ||
| Priority: | P3 | CC: | dirk_baeumer, snorthov |
| Version: | 3.1 | ||
| Target Milestone: | 3.1 M5 | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
|
Description
Brock Janiczak
Is there anything of interest in your log? sorry, i should have mentioned the logs :) There were no errors at all in the logs. I will try installing it again with a new workspace and see if that fixes it. The only interesting thing that happed was that i got a 'could not resore layout' error because of a missing feature (so i had a missing perspective) new config/workspace didn't fix the problem... but the problem doesn't show up under a runtime workbech! I will try remotely debugging the workbench and see if i can find anything This is starting to look like an SWT bug. WM_COMMAND does not seem to be fired
for the buttons at all.
I tried to reproduce the error with a small (SWT only) code fragment but could
only reproduce part of the problem. The selection event was always sent, but
the button click doesn't show unless you double click.
public class Issue81759 {
public static void main(String[] args) {
Display d = Display.getDefault();
Shell s = new Shell(d, SWT.CLOSE);
s.setLayout(new FillLayout());
Composite c = new Composite(s, SWT.NONE);
c.setLayout(new FillLayout());
ToolBar tb = new ToolBar(s, SWT.NONE);
ToolItem ti = new ToolItem(tb, SWT.PUSH);
ti.setText("press me");
ti.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
System.err.println("Button selected");
}
});
tb.addListener(SWT.MenuDetect, new Listener() {
public void handleEvent(Event event) {
}
});
// This causes the button to not show it is being pressed. Shows for
double click though
tb.addListener(SWT.DragDetect, new Listener() {public void
handleEvent(Event event) {}});
s.open();
while (!s.isDisposed()) {
if (d.readAndDispatch()) {
d.sleep();
}
}
}
}
You have to be running with the manifest file for it to happen (that is why it worked in the runtime workbench). The fragment in comment 4 now shows the behaviour i am seeing in the workbench. Ignore the menu detect listener, it shouldn't be there. For the record, I am running version 5.82.2900.2180 of comctrl32.dll. I am using the xp manifest and use the classic theme. Updating the summary and moving to SWT since this doesn't seem to be a platform UI problem. *** Bug 81777 has been marked as a duplicate of this bug. *** Raising severity since the bug renders makes the build almost unusable. Fixed > 20041222. This was caused by the fix for bug 79216. |