]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/dcscreen.cpp
patch from list to fix warning and get rid of unneccessary call
[wxWidgets.git] / src / motif / dcscreen.cpp
index 1b0597df23a1a5608bcd467fe710ada2ba3cc1a0..71f3c01e54ecb981801a4a2f9b97b75bec04b936 100644 (file)
@@ -9,11 +9,15 @@
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "dcscreen.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/window.h"
+#include "wx/frame.h"
 #include "wx/dcscreen.h"
 #include "wx/utils.h"
 
@@ -64,6 +68,7 @@ wxScreenDC::wxScreenDC()
 
 wxScreenDC::~wxScreenDC()
 {
+    EndDrawingOnTop();
 }
 
 bool wxScreenDC::StartDrawingOnTop(wxWindow* window)
@@ -71,7 +76,7 @@ bool wxScreenDC::StartDrawingOnTop(wxWindow* window)
     wxRect rect;
     int x, y, width, height;
     window->GetPosition(& x, & y);
-    if (window->GetParent())
+    if (window->GetParent() && !window->IsKindOf(CLASSINFO(wxFrame)))
         window->GetParent()->ClientToScreen(& x, & y);
     window->GetSize(& width, & height);
     rect.x = x; rect.y = y;