Fix X 'BadPixmap' crash in Blit() with mask when GTK+ <= 2.16, closes #16303
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76626 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -625,6 +625,7 @@ wxGTK:
|
|||||||
special folder from combobox
|
special folder from combobox
|
||||||
- Fix wxSystemSettings::GetColour() returning transparent colors with GTK3.
|
- Fix wxSystemSettings::GetColour() returning transparent colors with GTK3.
|
||||||
- Fix setting client data when adding items to a sorted wxListBox.
|
- Fix setting client data when adding items to a sorted wxListBox.
|
||||||
|
- Fix X 'BadPixmap' crash in wxDC::Blit() with mask when GTK+ <= 2.16.
|
||||||
|
|
||||||
wxMSW:
|
wxMSW:
|
||||||
|
|
||||||
|
@@ -1199,9 +1199,8 @@ void wxWindowDCImpl::DoDrawBitmap( const wxBitmap &bitmap,
|
|||||||
gdk_gc_set_clip_region(use_gc, clipRegion);
|
gdk_gc_set_clip_region(use_gc, clipRegion);
|
||||||
|
|
||||||
// Notice that we can only release the mask now, we can't do it before
|
// Notice that we can only release the mask now, we can't do it before
|
||||||
// the calls to gdk_draw_xxx() above as they crash with X error with
|
// the calls to gdk_draw_xxx() above as they crash with BadPixmap X
|
||||||
// GTK+ up to 2.20.1 (i.e. it works with 2.20 but is known to not work
|
// error with GTK+ 2.16 and earlier.
|
||||||
// with 2.16.1 and below).
|
|
||||||
if (mask_new)
|
if (mask_new)
|
||||||
g_object_unref(mask_new);
|
g_object_unref(mask_new);
|
||||||
}
|
}
|
||||||
@@ -1311,6 +1310,7 @@ bool wxWindowDCImpl::DoBlit( wxCoord xdest, wxCoord ydest,
|
|||||||
|
|
||||||
GdkGC* const use_gc = m_penGC;
|
GdkGC* const use_gc = m_penGC;
|
||||||
|
|
||||||
|
GdkPixmap* mask_new = NULL;
|
||||||
if (mask)
|
if (mask)
|
||||||
{
|
{
|
||||||
int srcMask_x = src_x;
|
int srcMask_x = src_x;
|
||||||
@@ -1320,7 +1320,6 @@ bool wxWindowDCImpl::DoBlit( wxCoord xdest, wxCoord ydest,
|
|||||||
srcMask_x = source->LogicalToDeviceX(xsrcMask);
|
srcMask_x = source->LogicalToDeviceX(xsrcMask);
|
||||||
srcMask_y = source->LogicalToDeviceY(ysrcMask);
|
srcMask_y = source->LogicalToDeviceY(ysrcMask);
|
||||||
}
|
}
|
||||||
GdkPixmap* mask_new = NULL;
|
|
||||||
if (isScaled)
|
if (isScaled)
|
||||||
{
|
{
|
||||||
mask = ScaleMask(mask, srcMask_x, srcMask_y,
|
mask = ScaleMask(mask, srcMask_x, srcMask_y,
|
||||||
@@ -1343,8 +1342,6 @@ bool wxWindowDCImpl::DoBlit( wxCoord xdest, wxCoord ydest,
|
|||||||
}
|
}
|
||||||
gdk_gc_set_clip_mask(use_gc, mask);
|
gdk_gc_set_clip_mask(use_gc, mask);
|
||||||
gdk_gc_set_clip_origin(use_gc, dst_x - srcMask_x, dst_y - srcMask_y);
|
gdk_gc_set_clip_origin(use_gc, dst_x - srcMask_x, dst_y - srcMask_y);
|
||||||
if (mask_new)
|
|
||||||
g_object_unref(mask_new);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GdkPixmap* pixmap = NULL;
|
GdkPixmap* pixmap = NULL;
|
||||||
@@ -1385,7 +1382,12 @@ bool wxWindowDCImpl::DoBlit( wxCoord xdest, wxCoord ydest,
|
|||||||
if (pixmap)
|
if (pixmap)
|
||||||
g_object_unref(pixmap);
|
g_object_unref(pixmap);
|
||||||
if (mask)
|
if (mask)
|
||||||
|
{
|
||||||
gdk_gc_set_clip_region(use_gc, clipRegion);
|
gdk_gc_set_clip_region(use_gc, clipRegion);
|
||||||
|
// see comment at end of DoDrawBitmap()
|
||||||
|
if (mask_new)
|
||||||
|
g_object_unref(mask_new);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user