diff dwt/custom/CCombo.d @ 194:3afcd4ddcf90

Update to SWT 3.3.2
author Frank Benoit <benoit@tionex.de>
date Wed, 19 Mar 2008 21:48:31 +0100
parents a5afe31f5cdd
children ab60f3309436
line wrap: on
line diff
--- a/dwt/custom/CCombo.d	Mon Mar 17 21:47:05 2008 +0100
+++ b/dwt/custom/CCombo.d	Wed Mar 19 21:48:31 2008 +0100
@@ -1087,7 +1087,21 @@
             dropDown (false);
             break;
         case DWT.Deactivate:
-            dropDown (false);
+            /*
+             * Bug in GTK. When the arrow button is pressed the popup control receives a
+             * deactivate event and then the arrow button receives a selection event. If
+             * we hide the popup in the deactivate event, the selection event will show
+             * it again. To prevent the popup from showing again, we will let the selection
+             * event of the arrow button hide the popup.
+             */
+            if ("gtk".equals(DWT.getPlatform())) {
+                Point point = arrow.toControl(getDisplay().getCursorLocation());
+                Point size = arrow.getSize();
+                Rectangle rect = new Rectangle(0, 0, size.x, size.y);
+                if (!rect.contains(point)) dropDown (false);
+            } else {
+                dropDown(false);
+            }
             break;
         default:
     }