]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/popupcmn.cpp
don't translate Win32 structured exceptions into C++ ones (requires always using...
[wxWidgets.git] / src / common / popupcmn.cpp
index 8dc2f18ebbfcf94afa7525ffd04387c0a7445677..3a6ba467bf786ca0d163fd6fcc9651dc005c15d0 100644 (file)
@@ -46,6 +46,9 @@
 #ifdef __WXGTK__
     #include <gtk/gtk.h>
 #endif
+#ifdef __WXX11__
+#include "wx/x11/private.h"
+#endif
 
 IMPLEMENT_DYNAMIC_CLASS(wxPopupWindow, wxWindow)
 IMPLEMENT_DYNAMIC_CLASS(wxPopupTransientWindow, wxPopupWindow)
@@ -279,18 +282,25 @@ bool wxPopupTransientWindow::Show( bool show )
     if (!show)
     {
         gdk_pointer_ungrab( (guint32)GDK_CURRENT_TIME );
-    
+
         gtk_grab_remove( m_widget );
     }
 #endif
 
+#ifdef __WXX11__
+    if (!show)
+    {
+        XUngrabPointer( wxGlobalDisplay(), CurrentTime );
+    }
+#endif
+
     bool ret = wxPopupWindow::Show( show );
-    
+
 #ifdef __WXGTK__
     if (show)
     {
         gtk_grab_add( m_widget );
-        
+
         gdk_pointer_grab( m_widget->window, TRUE,
                           (GdkEventMask)
                             (GDK_BUTTON_PRESS_MASK |
@@ -303,6 +313,21 @@ bool wxPopupTransientWindow::Show( bool show )
     }
 #endif
 
+#ifdef __WXX11__
+    if (show)
+    {
+        Window xwindow = (Window) m_clientWindow;
+
+        /* int res =*/ XGrabPointer(wxGlobalDisplay(), xwindow,
+            True,
+            ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask,
+            GrabModeAsync,
+            GrabModeAsync,
+            None,
+            None,
+            CurrentTime );
+    }
+#endif
     return ret;
 }
 
@@ -357,7 +382,7 @@ bool wxPopupComboWindow::Create(wxComboControl *parent)
 void wxPopupComboWindow::PositionNearCombo()
 {
     // the origin point must be in screen coords
-    wxPoint ptOrigin = m_combo->ClientToScreen(wxPoint(0, 0));
+    wxPoint ptOrigin = m_combo->ClientToScreen(wxPoint());
 
 #if 0 //def __WXUNIVERSAL__
     // account for the fact that (0, 0) is not the top left corner of the