Initialise DC only when needed and deinitilise it properly before, fixes #10543: wxGTK wxDataViewCtrl Assert and Crash
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59375 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
4aee83345e
commit
874edbb70e
@ -1105,10 +1105,15 @@ gtk_wx_cell_renderer_render (GtkCellRenderer *renderer,
|
|||||||
wxRect renderrect( rect.x, rect.y, rect.width, rect.height );
|
wxRect renderrect( rect.x, rect.y, rect.width, rect.height );
|
||||||
wxWindowDC* dc = (wxWindowDC*) cell->GetDC();
|
wxWindowDC* dc = (wxWindowDC*) cell->GetDC();
|
||||||
wxWindowDCImpl *impl = (wxWindowDCImpl *) dc->GetImpl();
|
wxWindowDCImpl *impl = (wxWindowDCImpl *) dc->GetImpl();
|
||||||
// Reinitilise GDK window everytime as drawing can also
|
|
||||||
// be done into DnD drop window.
|
// Reinitilise DC if drawing occurs into a different
|
||||||
|
// window such as a DnD drop window.
|
||||||
|
if (window != impl->m_gdkwindow)
|
||||||
|
{
|
||||||
|
impl->Destroy();
|
||||||
impl->m_gdkwindow = window;
|
impl->m_gdkwindow = window;
|
||||||
impl->SetUpDC();
|
impl->SetUpDC();
|
||||||
|
}
|
||||||
|
|
||||||
int state = 0;
|
int state = 0;
|
||||||
if (flags & GTK_CELL_RENDERER_SELECTED)
|
if (flags & GTK_CELL_RENDERER_SELECTED)
|
||||||
|
Loading…
Reference in New Issue
Block a user