Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Northover2006-12-18 22:33:24 +0000
committerSteve Northover2006-12-18 22:33:24 +0000
commitadf06dddd683bc03fe0ada86723bb5769c0a7542 (patch)
tree7ee0091651d57827bf66d34e785a4ca6428b69fa
parent15a7eb2f991ac0689235c23b3b926f8cfabe9388 (diff)
downloadeclipse.platform.swt-adf06dddd683bc03fe0ada86723bb5769c0a7542.tar.gz
eclipse.platform.swt-adf06dddd683bc03fe0ada86723bb5769c0a7542.tar.xz
eclipse.platform.swt-adf06dddd683bc03fe0ada86723bb5769c0a7542.zip
161830 - incorrect SWT.NO_FOCUS behaviour for Shell windows on Linux (3.2.2)
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java10
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Control.java10
2 files changed, 18 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
index 28561a9651..3bb2bd4a43 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
@@ -1918,8 +1918,16 @@ int /*long*/ gtk_button_press_event (int /*long*/ widget, int /*long*/ event) {
GdkEventButton gdkEvent = new GdkEventButton ();
OS.memmove (gdkEvent, event, GdkEventButton.sizeof);
if (gdkEvent.type == OS.GDK_3BUTTON_PRESS) return 0;
+ /*
+ * When a shell is created with SWT.ON_TOP and SWT.NO_FOCUS,
+ * do not activate the shell when the user clicks on the
+ * the client area or on the border or a control within the
+ * shell that does not take focus.
+ */
Shell shell = _getShell ();
- if ((shell.style & SWT.ON_TOP) != 0) shell.forceActive ();
+ if (((shell.style & SWT.ON_TOP) != 0) && (((shell.style & SWT.NO_FOCUS) == 0) || ((style & SWT.NO_FOCUS) == 0))) {
+ shell.forceActive();
+ }
display.dragStartX = (int) gdkEvent.x;
display.dragStartY = (int) gdkEvent.y;
display.dragging = display.dragOverride = false;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Control.java
index 0ae9b7a5d4..51f8e51cbf 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Control.java
@@ -3057,7 +3057,15 @@ int XButtonPress (int w, int client_data, int call_data, int continue_to_dispatc
Display display = this.display;
display.hideToolTip ();
Shell shell = getShell ();
- if ((shell.style & SWT.ON_TOP) != 0) shell.forceActive ();
+ /*
+ * When a shell is created with SWT.ON_TOP and SWT.NO_FOCUS,
+ * do not activate the shell when the user clicks on the
+ * the client area or on the border or a control within the
+ * shell that does not take focus.
+ */
+ if (((shell.style & SWT.ON_TOP) != SWT.NONE) && (((shell.style & SWT.NO_FOCUS) == SWT.NONE) || ((style & SWT.NO_FOCUS) == SWT.NONE))) {
+ shell.forceActive();
+ }
XButtonEvent xEvent = new XButtonEvent ();
OS.memmove (xEvent, call_data, XButtonEvent.sizeof);
boolean dispatch = sendMouseEvent (SWT.MouseDown, xEvent);

Back to the top