X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7e2baeb41321aedca928608f816f03c13afdeff9..af717fa87a47084b4faa3d6e5dcabc6cdf3ff36f:/src/dfb/dcclient.cpp diff --git a/src/dfb/dcclient.cpp b/src/dfb/dcclient.cpp index 1d1354843e..a10dd02b9e 100644 --- a/src/dfb/dcclient.cpp +++ b/src/dfb/dcclient.cpp @@ -27,6 +27,7 @@ #ifndef WX_PRECOMP #include "wx/window.h" + #include "wx/nonownedwnd.h" #endif #include "wx/dfb/private.h" @@ -45,7 +46,7 @@ // boundaries ("hidden behind its borders"), recursively: static wxRect GetUncoveredWindowArea(wxWindow *win) { - wxRect r(win->GetRect()); + wxRect r(win->GetSize()); if ( win->IsTopLevel() ) return r; @@ -58,6 +59,11 @@ static wxRect GetUncoveredWindowArea(wxWindow *win) // coordinates; this will remove parts of 'r' that are outside of the // parent's area: wxRect rp(GetUncoveredWindowArea(parent)); + + // normal windows cannot extend out of its parent's client area: + if ( !win->CanBeOutsideClientArea() ) + rp.Intersect(parent->GetClientRect()); + rp.Offset(-win->GetPosition()); rp.Offset(-parent->GetClientAreaOrigin()); r.Intersect(rp); @@ -74,6 +80,11 @@ wxIDirectFBSurfacePtr CreateDummySurface(wxWindow *win, const wxRect *rect) wxLogTrace(TRACE_PAINT, _T("%p ('%s'): creating dummy DC surface"), win, win->GetName().c_str()); wxSize size(rect ? rect->GetSize() : win->GetSize()); + + // we can't create a surface of 0 size but the size of the window may be 0, + // so ensure that we have at least a single pixel to draw on + size.IncTo(wxSize(1, 1)); + return win->GetDfbSurface()->CreateCompatible ( size, @@ -96,6 +107,8 @@ void wxWindowDC::InitForWin(wxWindow *win, const wxRect *rect) { wxCHECK_RET( win, _T("invalid window") ); + m_win = win; + // obtain the surface used for painting: wxPoint origin; wxIDirectFBSurfacePtr surface; @@ -154,6 +167,7 @@ void wxWindowDC::InitForWin(wxWindow *win, const wxRect *rect) } else { + m_winRect = r; DFBRectangle dfbrect = { r.x, r.y, r.width, r.height }; surface = win->GetDfbSurface()->GetSubSurface(&dfbrect); @@ -176,7 +190,7 @@ void wxWindowDC::InitForWin(wxWindow *win, const wxRect *rect) r.x, r.y, r.GetRight(), r.GetBottom(), origin.x, origin.y); - Init(surface); + DFBInit(surface); SetFont(win->GetFont()); // offset coordinates to account for subsurface's origin coordinates: @@ -195,6 +209,10 @@ wxWindowDC::~wxWindowDC() if ( m_shouldFlip ) { + // paint overlays on top of the surface being drawn to by this DC + // before showing anything on the screen: + m_win->PaintOverlays(m_winRect); + DFBSurfaceCapabilities caps = DSCAPS_NONE; surface->GetCapabilities(&caps); if ( caps & DSCAPS_DOUBLE )