diff options
author | Silenio Quarti <silenio> | 2004-04-22 16:32:16 +0000 |
---|---|---|
committer | Silenio Quarti <silenio> | 2004-04-22 16:32:16 +0000 |
commit | ccd846101c704dda4d457ae7362a582b82912ce8 (patch) | |
tree | fb3db292569436485b7d3b3abb3e06e7a0f2b317 /bundles/org.eclipse.swt/Eclipse SWT AWT/motif/org/eclipse/swt/awt/SWT_AWT.java | |
parent | 05dd422e38c1e9350971674d095c6a49baf9267e (diff) | |
download | eclipse.platform.swt-ccd846101c704dda4d457ae7362a582b82912ce8.tar.gz eclipse.platform.swt-ccd846101c704dda4d457ae7362a582b82912ce8.tar.xz eclipse.platform.swt-ccd846101c704dda4d457ae7362a582b82912ce8.zip |
58308
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT AWT/motif/org/eclipse/swt/awt/SWT_AWT.java')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT AWT/motif/org/eclipse/swt/awt/SWT_AWT.java | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT AWT/motif/org/eclipse/swt/awt/SWT_AWT.java b/bundles/org.eclipse.swt/Eclipse SWT AWT/motif/org/eclipse/swt/awt/SWT_AWT.java index 8d01927b8a..6792f372cf 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT AWT/motif/org/eclipse/swt/awt/SWT_AWT.java +++ b/bundles/org.eclipse.swt/Eclipse SWT AWT/motif/org/eclipse/swt/awt/SWT_AWT.java @@ -16,6 +16,8 @@ import java.lang.reflect.Method; /* SWT Imports */ import org.eclipse.swt.*; import org.eclipse.swt.internal.Library; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; @@ -76,17 +78,19 @@ public static Frame new_Frame (final Composite parent) { } catch (Throwable e) { SWT.error (SWT.ERROR_NOT_IMPLEMENTED, e); } + final Frame frame = (Frame) value; try { /* Call registerListeners() to make XEmbed focus traversal work */ Method method = clazz.getMethod("registerListeners", null); if (method != null) method.invoke(value, null); } catch (Throwable e) {} - final Frame frame = (Frame) value; parent.getShell ().addListener (SWT.Move, new Listener () { public void handleEvent (Event e) { + Display display = parent.getDisplay(); + final Point location = display.map(parent, null, 0, 0); EventQueue.invokeLater(new Runnable () { public void run () { - frame.dispatchEvent (new ComponentEvent (frame, ComponentEvent.COMPONENT_MOVED)); + frame.setLocation (location.x, location.y); } }); } @@ -101,6 +105,20 @@ public static Frame new_Frame (final Composite parent) { }); } }); + parent.getDisplay().asyncExec(new Runnable() { + public void run () { + if (parent.isDisposed()) return; + Display display = parent.getDisplay(); + Rectangle clientArea = parent.getClientArea(); + final Rectangle bounds = display.map(parent, null, clientArea); + EventQueue.invokeLater(new Runnable () { + public void run () { + frame.setBounds (bounds.x, bounds.y, bounds.width, bounds.height); + frame.validate (); + } + }); + } + }); return frame; } |