X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a752b8c4e028fb42f20625d9017b8685ed863924..a83ea9c15a7ac7bbdc6686164cfcbbc21ae5031a:/src/gtk1/window.cpp diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index 41a21c2a14..11167b3844 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -230,12 +230,12 @@ static GdkGC *g_eraseGC = NULL; static wxWindowGTK *g_captureWindow = (wxWindowGTK*) NULL; static bool g_captureWindowHasMouse = FALSE; -/* extern */ wxWindowGTK *g_focusWindow = (wxWindowGTK*) NULL; +wxWindowGTK *g_focusWindow = (wxWindowGTK*) NULL; // the last window which had the focus - this is normally never NULL (except // if we never had focus at all) as even when g_focusWindow is NULL it still // keeps its previous value -static wxWindowGTK *g_focusWindowLast = (wxWindowGTK*) NULL; +wxWindowGTK *g_focusWindowLast = (wxWindowGTK*) NULL; // If a window get the focus set but has not been realized // yet, defer setting the focus to idle time. @@ -967,6 +967,9 @@ static void wxFillOtherKeyEventFields(wxKeyEvent& event, event.m_scanCode = gdk_event->keyval; event.m_rawCode = (wxUint32) gdk_event->keyval; event.m_rawFlags = 0; +#if wxUSE_UNICODE + event.m_uniChar = gdk_keyval_to_unicode(gdk_event->keyval); +#endif event.m_x = x; event.m_y = y; event.SetEventObject( win ); @@ -1200,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 )