javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Control.java
changeset 61 bf7ee68962da
parent 47 f40128debb5d
child 79 2f468c1958d0
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Control.java	Tue Jul 06 14:10:26 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Control.java	Wed Aug 18 09:43:15 2010 +0300
@@ -811,6 +811,14 @@
     }
 }
 
+void fixMousePropagation() {
+    // In SWT mouse events are not supposed to propagate to the parent like in
+    // Qt. Thus, the default is never to propagate. 
+    if(handle != 0) {
+        OS.QWidget_setAttribute(handle, OS.QT_WA_NOMOUSEPROPAGATION, true);
+    }
+}
+
 void flushBuffers() {
     if (bufferedGcs != null) {
         for (int i = 0; i < bufferedGcs.size(); i++) {
@@ -1857,23 +1865,23 @@
         }
 
         // Add the actions that may be added by CommandArranger
-	     if(commandList != null) {
-	        CommandUtils.sort(commandList);
-	        for (int i = 0; i < commandList.length; i++) {
-	            OS.QMenu_addAction(menuHandle, Internal_PackageSupport.topHandle(commandList[i]));
-	        }
-	     }
+         if(commandList != null) {
+            CommandUtils.sort(commandList);
+            for (int i = 0; i < commandList.length; i++) {
+                OS.QMenu_addAction(menuHandle, Internal_PackageSupport.topHandle(commandList[i]));
+            }
+         }
 
         OS.QMenu_exec(menuHandle, event.x, event.y, 0);
 
         // Clean-up the QActions from CommandArranger and QMenu
         if(commandList != null && menuHandle != 0)   {
-	        for (int i = 0; i < commandList.length; i++) {
-	            int action = Internal_PackageSupport.topHandle(commandList[i]);
-	        	if(action != 0) {
-	        		OS.QWidget_removeAction(menuHandle, action);
-	        	}
-	        }
+            for (int i = 0; i < commandList.length; i++) {
+                int action = Internal_PackageSupport.topHandle(commandList[i]);
+                if(action != 0) {
+                    OS.QWidget_removeAction(menuHandle, action);
+                }
+            }
         }
         if (commandMenu) {
             QObjectDeleteWrapper.deleteSafely(menuHandle);