X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f7108f16cc2996120dd54f4641a28240a5cb0bb9..0f30d8e39e7f896fc3767d086fe747efc1696d3b:/src/gtk/window.cpp diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 0138ad5c26..d98386fe20 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -56,6 +56,12 @@ #include "wx/math.h" #include +// FIXME: Due to a hack we use GtkCombo in here, which is deprecated since gtk2.3.0 +#include +#if defined(GTK_DISABLE_DEPRECATED) && GTK_CHECK_VERSION(2,3,0) +#undef GTK_DISABLE_DEPRECATED +#endif + #include "wx/gtk/private.h" #include #include @@ -1877,15 +1883,15 @@ static gboolean gtk_window_focus_in_callback( GtkWidget *widget, (void)DoSendFocusEvents(win); - ret = TRUE; + ret = true; } // Disable default focus handling for custom windows // since the default GTK+ handler issues a repaint if (win->m_wxwindow) - g_signal_stop_emission_by_name (widget, "focus_in_event"); + return ret; - return ret; + return false; } } @@ -1943,15 +1949,15 @@ static gboolean gtk_window_focus_out_callback( GtkWidget *widget, (void)win->GetEventHandler()->ProcessEvent( event ); - ret = TRUE; + ret = true; } // Disable default focus handling for custom windows // since the default GTK+ handler issues a repaint if (win->m_wxwindow) - g_signal_stop_emission_by_name (widget, "focus_out_event"); + return ret; - return ret; + return false; } } @@ -2748,10 +2754,20 @@ void wxWindowGTK::PostCreation() if (m_focusWidget == NULL) m_focusWidget = m_widget; - g_signal_connect (m_focusWidget, "focus_in_event", + if (m_wxwindow) + { + g_signal_connect (m_focusWidget, "focus_in_event", G_CALLBACK (gtk_window_focus_in_callback), this); - g_signal_connect_after (m_focusWidget, "focus_out_event", + g_signal_connect (m_focusWidget, "focus_out_event", G_CALLBACK (gtk_window_focus_out_callback), this); + } + else + { + g_signal_connect_after (m_focusWidget, "focus_in_event", + G_CALLBACK (gtk_window_focus_in_callback), this); + g_signal_connect_after (m_focusWidget, "focus_out_event", + G_CALLBACK (gtk_window_focus_out_callback), this); + } } // connect to the various key and mouse handlers