]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/sashwin.cpp
Lots of wxMotif fixes
[wxWidgets.git] / src / generic / sashwin.cpp
index 9bac85b92d14337bc9e8b9a63289a2577879edc2..831085a907b2fa3a9b158b97639756ac35556b55 100644 (file)
@@ -115,13 +115,21 @@ void wxSashWindow::OnMouseEvent(wxMouseEvent& event)
        {
         if ( sashHit != wxSASH_NONE )
         {
-               CaptureMouse();
+            CaptureMouse();
 
            // Required for X to specify that
-               // that we wish to draw on top of all windows
-               // - and we optimise by specifying the area
-               // for creating the overlap window.
-               wxScreenDC::StartDrawingOnTop(this);
+            // that we wish to draw on top of all windows
+            // - and we optimise by specifying the area
+            // for creating the overlap window.
+            // Find the first frame or dialog and use this to specify
+            // the area to draw on.
+            wxWindow* parent = this;
+
+            while (parent && !parent->IsKindOf(CLASSINFO(wxDialog)) &&
+                             !parent->IsKindOf(CLASSINFO(wxFrame)))
+              parent = parent->GetParent();
+
+            wxScreenDC::StartDrawingOnTop(parent);
 
             // We don't say we're dragging yet; we leave that
             // decision for the Dragging() branch, to ensure