X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c4d25c01ae813d8fe13d7b2a267864ccaee1840d..0ce5a3a853f2eaa7fe58e494aa0605918531ff3b:/src/gtk1/window.cpp diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index 8878e9dbba..ad92e20c40 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -1203,15 +1203,16 @@ static gint gtk_window_key_press_callback( GtkWidget *widget, key_code = wxTranslateKeySymToWXKey(keysym, TRUE /* isChar */); if ( !key_code ) { - if ( gdk_event->length == 1 ) - { - key_code = (unsigned char)gdk_event->string[0]; - } - else if ( wxIsAsciiKeysym(keysym) ) + if ( wxIsAsciiKeysym(keysym) ) { // ASCII key key_code = (unsigned char)keysym; } + // gdk_event->string is actually deprecated + else if ( gdk_event->length == 1 ) + { + key_code = (unsigned char)gdk_event->string[0]; + } } if ( key_code ) @@ -3866,25 +3867,28 @@ void wxWindowGTK::GtkSendPaintEvents() if (!parent) parent = (wxWindow*)this; - wxRegionIterator upd( m_updateRegion ); - while (upd) + if (GTK_WIDGET_MAPPED(parent->m_widget)) { - GdkRectangle rect; - rect.x = upd.GetX(); - rect.y = upd.GetY(); - rect.width = upd.GetWidth(); - rect.height = upd.GetHeight(); - - gtk_paint_flat_box( parent->m_widget->style, - pizza->bin_window, - (GtkStateType)GTK_WIDGET_STATE(m_wxwindow), - GTK_SHADOW_NONE, - &rect, - parent->m_widget, - (char *)"base", - 0, 0, -1, -1 ); - - upd ++; + wxRegionIterator upd( m_updateRegion ); + while (upd) + { + GdkRectangle rect; + rect.x = upd.GetX(); + rect.y = upd.GetY(); + rect.width = upd.GetWidth(); + rect.height = upd.GetHeight(); + + gtk_paint_flat_box( parent->m_widget->style, + pizza->bin_window, + (GtkStateType)GTK_WIDGET_STATE(m_wxwindow), + GTK_SHADOW_NONE, + &rect, + parent->m_widget, + (char *)"base", + 0, 0, -1, -1 ); + + upd ++; + } } } else