Don't allow DestroyClippingRegion() to remove paint update area clipping with GTK3
See #18560
This commit is contained in:
@@ -63,8 +63,13 @@ public:
|
||||
|
||||
class wxPaintDCImpl: public wxGTKCairoDCImpl
|
||||
{
|
||||
typedef wxGTKCairoDCImpl BaseType;
|
||||
public:
|
||||
wxPaintDCImpl(wxPaintDC* owner, wxWindow* window);
|
||||
virtual void DestroyClippingRegion() wxOVERRIDE;
|
||||
|
||||
private:
|
||||
const wxRegion& m_clip;
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxPaintDCImpl);
|
||||
};
|
||||
|
@@ -337,6 +337,7 @@ wxClientDCImpl::wxClientDCImpl(wxClientDC* owner, wxWindow* window)
|
||||
|
||||
wxPaintDCImpl::wxPaintDCImpl(wxPaintDC* owner, wxWindow* window)
|
||||
: wxGTKCairoDCImpl(owner, window)
|
||||
, m_clip(window->m_nativeUpdateRegion)
|
||||
{
|
||||
cairo_t* cr = window->GTKPaintContext();
|
||||
wxCHECK_RET(cr, "using wxPaintDC without being in a native paint event");
|
||||
@@ -345,6 +346,18 @@ wxPaintDCImpl::wxPaintDCImpl(wxPaintDC* owner, wxWindow* window)
|
||||
gc->EnableOffset(m_contentScaleFactor <= 1);
|
||||
SetGraphicsContext(gc);
|
||||
}
|
||||
|
||||
void wxPaintDCImpl::DestroyClippingRegion()
|
||||
{
|
||||
BaseType::DestroyClippingRegion();
|
||||
|
||||
// re-establish clip for paint update area
|
||||
int x, y, w, h;
|
||||
m_clip.GetBox(x, y, w, h);
|
||||
cairo_t* cr = static_cast<cairo_t*>(GetCairoContext());
|
||||
cairo_rectangle(cr, x, y, w, h);
|
||||
cairo_clip(cr);
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
wxScreenDCImpl::wxScreenDCImpl(wxScreenDC* owner)
|
||||
|
@@ -5074,6 +5074,7 @@ void wxWindowGTK::GTKSendPaintEvents(const GdkRegion* region)
|
||||
|
||||
m_paintContext = cr;
|
||||
m_updateRegion = wxRegion(int(x1), int(y1), int(x2 - x1), int(y2 - y1));
|
||||
m_nativeUpdateRegion = m_updateRegion;
|
||||
#else // !__WXGTK3__
|
||||
m_updateRegion = wxRegion(region);
|
||||
#if wxGTK_HAS_COMPOSITING_SUPPORT
|
||||
|
Reference in New Issue
Block a user