Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Moffatt2013-07-29 14:16:33 +0000
committerEric Moffatt2013-07-29 14:17:02 +0000
commita23cbd01b2bb406e19fd38cf2fd6e3afcc82e957 (patch)
treee4ac29e7acfcf65f2a8b5bf0524a49d1bcdd4887
parent609d190b158c1abd6aeafb9aa3ca451f705bc464 (diff)
downloadeclipse.platform.ui-a23cbd01b2bb406e19fd38cf2fd6e3afcc82e957.tar.gz
eclipse.platform.ui-a23cbd01b2bb406e19fd38cf2fd6e3afcc82e957.tar.xz
eclipse.platform.ui-a23cbd01b2bb406e19fd38cf2fd6e3afcc82e957.zip
Fix for Bug 371598 - [FastView] Fast views do not always close on Escape
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/TrimStack.java27
1 files changed, 26 insertions, 1 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/TrimStack.java b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/TrimStack.java
index 1fd9c0db53d..e63eb6b3311 100644
--- a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/TrimStack.java
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/TrimStack.java
@@ -109,6 +109,28 @@ public class TrimStack {
*/
private Map<String, Image> imageMap = new HashMap<String, Image>();
+ private Listener mouseDownFilter = new Listener() {
+ public void handleEvent(Event event) {
+ if (!(event.widget instanceof Control))
+ return;
+ Control ctrl = (Control) event.widget;
+ Point p = new Point(event.x, event.y);
+ p = event.display.map(ctrl, null, p);
+
+ Rectangle caBounds = hostPane.getBounds();
+ caBounds = event.display.map(hostPane.getParent(), null, caBounds);
+ boolean inHostPane = caBounds.contains(p);
+
+ TrimmedPartLayout tpl = (TrimmedPartLayout) hostPane.getShell().getLayout();
+ Rectangle shellCABounds = tpl.clientArea.getBounds();
+ shellCABounds = event.display.map(tpl.clientArea.getParent(), null, shellCABounds);
+ boolean inShellCA = shellCABounds.contains(p);
+
+ if (inShellCA && !inHostPane)
+ showStack(false);
+ }
+ };
+
ControlListener caResizeListener = new ControlListener() {
public void controlResized(ControlEvent e) {
if (hostPane != null && hostPane.isVisible())
@@ -804,6 +826,7 @@ public class TrimStack {
ctf.setParent(hostPane);
clientArea.addControlListener(caResizeListener);
+ clientArea.getDisplay().addFilter(SWT.MouseUp, mouseDownFilter);
// Set the initial location
setPaneLocation(hostPane);
@@ -817,8 +840,10 @@ public class TrimStack {
} else if (!show && isShowing) {
// Check to ensure that the client area is non-null since the
// trimstack may be currently hosted in the limbo shell
- if (clientArea != null)
+ if (clientArea != null) {
clientArea.removeControlListener(caResizeListener);
+ clientArea.getDisplay().removeFilter(SWT.MouseUp, mouseDownFilter);
+ }
if (hostPane != null && hostPane.isVisible()) {
hostPane.setVisible(false);

Back to the top