| Summary: | [Widgets] [SWT/Carbon]SWT.MouseExit event being generated when it should not be. | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | alf <lihedl> | ||||||
| Component: | SWT | Assignee: | Silenio Quarti <Silenio_Quarti> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | Silenio Quarti <Silenio_Quarti> | ||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | eclipse.felipe, linyunz, lshanmug, raji | ||||||
| Version: | 3.5.2 | Flags: | eclipse.felipe:
review+
|
||||||
| Target Milestone: | 3.6.1 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
alf
Created attachment 167865 [details]
example source code
source code:
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
public class DragSametiemTest {
public static void main (String [] args) {
Display display = new Display ();
Shell shell = new Shell(display);
shell=new Shell(display, SWT.SHELL_TRIM);
GridLayout gl = new GridLayout(1, false);
gl.marginHeight=0;
gl.marginWidth=0;
shell.setLayout(gl);
Composite _chatAreaCmp = new Composite(shell, SWT.NONE);
_chatAreaCmp.setLayoutData(new GridData(GridData.FILL_BOTH));
_chatAreaCmp.setLayout(gl);
Text browser = new Text(_chatAreaCmp, SWT.NONE);
browser.setText("top text");
browser.setLayoutData(new GridData(GridData.FILL_BOTH));
MyComp _chatAreaView = new MyComp(_chatAreaCmp, SWT.DOWN);
_chatAreaView.setLayout(gl);
_chatAreaView.setLayoutData(new GridData(GridData.FILL_BOTH));
shell.setSize(250, 300);
shell.layout();
shell.open();
while (!shell.isDisposed ()) {
if (!display.readAndDispatch ()) display.sleep ();
}
display.dispose ();
}
static class MyComp extends Composite {
public MyComp(Composite parent, int style) {
super(parent, style);
Canvas canvas = new Canvas(this, style);
Listener listener = new Listener() {
public void handleEvent(Event event) {
switch (event.type) {
case SWT.Paint:
GC gc = event.gc;
Rectangle rect = getClientArea();
gc.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_BLUE));
gc.fillRectangle(rect.x, rect.y, rect.width, rect.height);
break;
case SWT.MouseExit:
System.out.println("exit"); break;
}
}
};
canvas.setLayoutData(new GridData(GridData.FILL_BOTH));
int[] events = new int[] {SWT.Paint,SWT.KeyDown, SWT.MouseExit };
for (int i = 0; i < events.length; i++) {
canvas.addListener(events[i], listener);
}
}
}
}
Happens only with the first drag. Created attachment 170102 [details]
patch for 3.5.2 and HEAD (after 3.6 ships)
Thanks Silenio, will this be included in 3.6.1? (we are moving XPD up to 3.6.1 shortly) Fix has been released to HEAD. Felipe, please review for 3.6.1. Fix released to R3_6_maintenance and HEAD |