X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/338dd992160bf20205743c092b353d96ef7604fb..926ce9e3ac32e1a33cc43420f76876fac8868436:/src/motif/dcscreen.cpp?ds=sidebyside diff --git a/src/motif/dcscreen.cpp b/src/motif/dcscreen.cpp index 9686ee49b6..762a740101 100644 --- a/src/motif/dcscreen.cpp +++ b/src/motif/dcscreen.cpp @@ -9,11 +9,11 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#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" @@ -27,9 +27,7 @@ #include "wx/motif/private.h" -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxScreenDC, wxWindowDC) -#endif WXWindow wxScreenDC::sm_overlayWindow = 0; int wxScreenDC::sm_overlayWindowX = 0; @@ -61,11 +59,12 @@ wxScreenDC::wxScreenDC() &gcvalues); m_backgroundPixel = (int) gcvalues.background; - m_ok = TRUE; + m_ok = true; } wxScreenDC::~wxScreenDC() { + EndDrawingOnTop(); } bool wxScreenDC::StartDrawingOnTop(wxWindow* window) @@ -73,7 +72,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; @@ -85,7 +84,7 @@ bool wxScreenDC::StartDrawingOnTop(wxWindow* window) bool wxScreenDC::StartDrawingOnTop(wxRect* rect) { if (sm_overlayWindow) - return FALSE; + return false; Display *dpy = (Display*) wxGetDisplay(); Pixmap screenPixmap = RootWindow(dpy, DefaultScreen(dpy)); @@ -115,10 +114,10 @@ bool wxScreenDC::StartDrawingOnTop(wxRect* rect) if (sm_overlayWindow) { XMapWindow(dpy, (Window) sm_overlayWindow); - return TRUE; + return true; } else - return FALSE; + return false; } bool wxScreenDC::EndDrawingOnTop() @@ -127,8 +126,8 @@ bool wxScreenDC::EndDrawingOnTop() { XDestroyWindow((Display*) wxGetDisplay(), (Window) sm_overlayWindow); sm_overlayWindow = 0; - return TRUE; + return true; } else - return FALSE; + return false; }