don't assume size-allocate implies a widget is realized

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@78466 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett
2015-02-09 18:19:14 +00:00
parent e1ebfd29ac
commit e19a2263bd

View File

@@ -3094,7 +3094,12 @@ void wxWindowGTK::DoClientToScreen( int *x, int *y ) const
{
wxCHECK_RET( (m_widget != NULL), wxT("invalid window") );
if (!m_useCachedClientSize && !IsTopLevel() && m_parent)
GtkWidget* widget = m_widget;
if (m_wxwindow)
widget = m_wxwindow;
GdkWindow* source = gtk_widget_get_window(widget);
if ((!m_useCachedClientSize || source == NULL) && !IsTopLevel() && m_parent)
{
m_parent->DoClientToScreen(x, y);
int xx, yy;
@@ -3126,12 +3131,6 @@ void wxWindowGTK::DoClientToScreen( int *x, int *y ) const
return;
}
GdkWindow *source = NULL;
if (m_wxwindow)
source = gtk_widget_get_window(m_wxwindow);
else
source = gtk_widget_get_window(m_widget);
wxCHECK_RET(source, "ClientToScreen failed on unrealized window");
int org_x = 0;
@@ -3165,7 +3164,12 @@ void wxWindowGTK::DoScreenToClient( int *x, int *y ) const
{
wxCHECK_RET( (m_widget != NULL), wxT("invalid window") );
if (!m_useCachedClientSize && !IsTopLevel() && m_parent)
GtkWidget* widget = m_widget;
if (m_wxwindow)
widget = m_wxwindow;
GdkWindow* source = gtk_widget_get_window(widget);
if ((!m_useCachedClientSize || source == NULL) && !IsTopLevel() && m_parent)
{
m_parent->DoScreenToClient(x, y);
int xx, yy;
@@ -3197,12 +3201,6 @@ void wxWindowGTK::DoScreenToClient( int *x, int *y ) const
return;
}
GdkWindow *source = NULL;
if (m_wxwindow)
source = gtk_widget_get_window(m_wxwindow);
else
source = gtk_widget_get_window(m_widget);
wxCHECK_RET(source, "ScreenToClient failed on unrealized window");
int org_x = 0;