From ab70c3bb5c3f169ace49dbf6e0367e6f3bebdf2d Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Sun, 16 Dec 2007 13:54:05 +0000 Subject: [PATCH] probably fixed blit crash in X11 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50742 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/x11/dcclient.h | 2 +- src/x11/dcclient.cpp | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/include/wx/x11/dcclient.h b/include/wx/x11/dcclient.h index 928edfaf56..3144e6b64d 100644 --- a/include/wx/x11/dcclient.h +++ b/include/wx/x11/dcclient.h @@ -103,7 +103,7 @@ public: virtual wxSize GetPPI() const; virtual void DestroyClippingRegion(); - WXWindow GetWindow() const { return m_window; } + WXWindow X11GetWindow() const { return m_window; } virtual void ComputeScaleAndOrigin(); diff --git a/src/x11/dcclient.cpp b/src/x11/dcclient.cpp index 8475d387d0..fe35b9d0a3 100644 --- a/src/x11/dcclient.cpp +++ b/src/x11/dcclient.cpp @@ -1487,6 +1487,14 @@ bool wxWindowDCImpl::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoor } else // use_bitmap_method { + wxDCImpl *impl = srcDC->GetImpl(); + wxWindowDCImpl *x11_impl = wxDynamicCast(impl, wxWindowDCImpl); + if (!x11_impl) + { + SetLogicalFunction( old_logical_func ); + return false; + } + if ((width != ww) || (height != hh)) { /* Draw source window into a bitmap as we cannot scale @@ -1506,7 +1514,7 @@ bool wxWindowDCImpl::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoor // copy including child window contents XSetSubwindowMode( (Display*) m_display, (GC) m_penGC, IncludeInferiors ); - XCopyArea( (Display*) m_display, (Window) srcDC->GetWindow(), (Window) bitmap.GetPixmap(), + XCopyArea( (Display*) m_display, (Window) x11_impl->X11GetWindow(), (Window) bitmap.GetPixmap(), (GC) m_penGC, xsrc, ysrc, width, height, 0, 0 ); XSetSubwindowMode( (Display*) m_display, (GC) m_penGC, ClipByChildren ); @@ -1524,10 +1532,10 @@ bool wxWindowDCImpl::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoor else { // No scaling and not a memory dc with a mask either - + // copy including child window contents XSetSubwindowMode( (Display*) m_display, (GC) m_penGC, IncludeInferiors ); - XCopyArea( (Display*) m_display, (Window) srcDC->GetWindow(), (Window) m_x11window, + XCopyArea( (Display*) m_display, (Window) x11_impl->X11GetWindow(), (Window) m_x11window, (GC) m_penGC, xsrc, ysrc, width, height, xx, yy ); XSetSubwindowMode( (Display*) m_display, (GC) m_penGC, ClipByChildren ); } -- 2.45.2