summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT AWT/motif/org/eclipse/swt/awt/SWT_AWT.java
diff options
context:
space:
mode:
authorSteve Northover <steve>2007-01-03 21:19:26 +0000
committerSteve Northover <steve>2007-01-03 21:19:26 +0000
commit918e592c4cb7d752c1b68388f85f47322a79e685 (patch)
tree34828a437f4e29d859e4cc09ae43b6c2dda044b4 /bundles/org.eclipse.swt/Eclipse SWT AWT/motif/org/eclipse/swt/awt/SWT_AWT.java
parentc4acbc4255954f0b7768817ef371284e3742efde (diff)
downloadeclipse.platform.swt-918e592c4cb7d752c1b68388f85f47322a79e685.tar.gz
eclipse.platform.swt-918e592c4cb7d752c1b68388f85f47322a79e685.tar.xz
eclipse.platform.swt-918e592c4cb7d752c1b68388f85f47322a79e685.zip
186043 - SWT_AWT not working in CTabFolder with JDK 6 on Linux
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.java42
1 files changed, 30 insertions, 12 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 e3570c0584..a61c5551d4 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
@@ -195,19 +195,37 @@ public static Frame new_Frame (final Composite parent) {
Shell shell = parent.getShell ();
shell.addListener (SWT.Deiconify, shellListener);
shell.addListener (SWT.Iconify, shellListener);
- parent.addListener (SWT.Dispose, new Listener () {
- public void handleEvent (Event event) {
- Shell shell = parent.getShell ();
- shell.removeListener (SWT.Deiconify, shellListener);
- shell.removeListener (SWT.Iconify, shellListener);
- parent.setVisible(false);
- EventQueue.invokeLater(new Runnable () {
- public void run () {
- frame.dispose ();
- }
- });
+
+ Listener listener = new Listener () {
+ public void handleEvent (Event e) {
+ switch (e.type) {
+ case SWT.Dispose:
+ Shell shell = parent.getShell ();
+ shell.removeListener (SWT.Deiconify, shellListener);
+ shell.removeListener (SWT.Iconify, shellListener);
+ parent.setVisible(false);
+ EventQueue.invokeLater(new Runnable () {
+ public void run () {
+ frame.dispose ();
+ }
+ });
+ break;
+ case SWT.Resize:
+ if (Library.JAVA_VERSION >= Library.JAVA_VERSION(1, 6, 0)) {
+ final Rectangle clientArea = parent.getClientArea();
+ EventQueue.invokeLater(new Runnable () {
+ public void run () {
+ frame.setSize (clientArea.width, clientArea.height);
+ }
+ });
+ }
+ break;
+ }
}
- });
+ };
+ parent.addListener (SWT.Dispose, listener);
+ parent.addListener (SWT.Resize, listener);
+
parent.getDisplay().asyncExec(new Runnable() {
public void run () {
if (parent.isDisposed()) return;