diff options
author | Silenio Quarti <silenio_quarti@ca.ibm.com> | 2012-11-12 12:32:34 -0500 |
---|---|---|
committer | Silenio Quarti <silenio_quarti@ca.ibm.com> | 2012-11-12 12:32:34 -0500 |
commit | 2f862f00166fcf6199c86ef2db5918eea6feae6a (patch) | |
tree | 462c448d64fde0efb4ca7785a221f21856817834 | |
parent | 92eda262fe6609e637257b664ef3791c831227e8 (diff) | |
download | eclipse.platform.swt-2f862f00166fcf6199c86ef2db5918eea6feae6a.tar.gz eclipse.platform.swt-2f862f00166fcf6199c86ef2db5918eea6feae6a.tar.xz eclipse.platform.swt-2f862f00166fcf6199c86ef2db5918eea6feae6a.zip |
Bug 393742 - Mac: Pop up window will be hidden behind and main window UI is frozen
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java index fad1729f90..df6ff78b5d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java @@ -4967,7 +4967,7 @@ void applicationSendEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ event if (performKeyEquivalent(window, nsEvent)) return; int type = (int)/*64*/nsEvent.type (); - boolean down = false; + boolean activate = false, down = false; switch (type) { case OS.NSLeftMouseDown: case OS.NSRightMouseDown: @@ -4976,6 +4976,7 @@ void applicationSendEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ event case OS.NSLeftMouseUp: case OS.NSRightMouseUp: case OS.NSOtherMouseUp: + activate = true; case OS.NSLeftMouseDragged: case OS.NSRightMouseDragged: case OS.NSOtherMouseDragged: @@ -4991,13 +4992,17 @@ void applicationSendEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ event if (shell != null) { Shell modalShell = shell.getModalShell (); if (modalShell != null) { - if (down) { - if (!application.isActive()) { + if (activate) { + if (application.isActive()) { + modalShell.window.orderFrontRegardless(); + } else { application.activateIgnoringOtherApps(true); } - NSRect rect = window.contentView().frame(); - NSPoint pt = window.convertBaseToScreen(nsEvent.locationInWindow()); - if (OS.NSPointInRect(pt, rect)) beep (); + if (down) { + NSRect rect = window.contentView().frame(); + NSPoint pt = window.convertBaseToScreen(nsEvent.locationInWindow()); + if (OS.NSPointInRect(pt, rect)) beep (); + } } return; } |