and wxTopLevelWindow focus events and the normal
_connect for custom controls.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37620
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
//-----------------------------------------------------------------------------
extern "C" {
//-----------------------------------------------------------------------------
extern "C" {
-static gint gtk_frame_focus_in_callback( GtkWidget *widget,
+static gboolean gtk_frame_focus_in_callback( GtkWidget *widget,
GdkEvent *WXUNUSED(event),
wxTopLevelWindowGTK *win )
{
GdkEvent *WXUNUSED(event),
wxTopLevelWindowGTK *win )
{
event.SetEventObject(g_activeFrame);
g_activeFrame->GetEventHandler()->ProcessEvent(event);
event.SetEventObject(g_activeFrame);
g_activeFrame->GetEventHandler()->ProcessEvent(event);
//-----------------------------------------------------------------------------
extern "C" {
//-----------------------------------------------------------------------------
extern "C" {
-static gint gtk_frame_focus_out_callback( GtkWidget *widget,
+static gboolean gtk_frame_focus_out_callback( GtkWidget *widget,
GdkEventFocus *WXUNUSED(gdk_event),
wxTopLevelWindowGTK *win )
{
GdkEventFocus *WXUNUSED(gdk_event),
wxTopLevelWindowGTK *win )
{
//-----------------------------------------------------------------------------
extern "C" {
//-----------------------------------------------------------------------------
extern "C" {
-static gint gtk_frame_focus_callback( GtkWidget *widget, GtkDirectionType WXUNUSED(d), wxWindow *WXUNUSED(win) )
+static gboolean gtk_frame_focus_callback( GtkWidget *widget, GtkDirectionType WXUNUSED(d), wxWindow *WXUNUSED(win) )
{
if (g_isIdle)
wxapp_install_idle_handler();
{
if (g_isIdle)
wxapp_install_idle_handler();
G_CALLBACK (gtk_frame_focus_callback), this);
// activation
G_CALLBACK (gtk_frame_focus_callback), this);
// activation
- g_signal_connect (m_widget, "focus_in_event",
+ g_signal_connect_after (m_widget, "focus_in_event",
G_CALLBACK (gtk_frame_focus_in_callback), this);
G_CALLBACK (gtk_frame_focus_in_callback), this);
- g_signal_connect (m_widget, "focus_out_event",
+ g_signal_connect_after (m_widget, "focus_out_event",
G_CALLBACK (gtk_frame_focus_out_callback), this);
// decorations
G_CALLBACK (gtk_frame_focus_out_callback), this);
// decorations
(void)DoSendFocusEvents(win);
(void)DoSendFocusEvents(win);
}
// Disable default focus handling for custom windows
// since the default GTK+ handler issues a repaint
if (win->m_wxwindow)
}
// 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");
(void)win->GetEventHandler()->ProcessEvent( event );
(void)win->GetEventHandler()->ProcessEvent( event );
}
// Disable default focus handling for custom windows
// since the default GTK+ handler issues a repaint
if (win->m_wxwindow)
}
// 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");
if (m_focusWidget == NULL)
m_focusWidget = m_widget;
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 (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_CALLBACK (gtk_window_focus_in_callback), this);
- g_signal_connect_after (m_focusWidget, "focus_out_event",
+ g_signal_connect_after (m_focusWidget, "focus_out_event",
G_CALLBACK (gtk_window_focus_out_callback), this);
G_CALLBACK (gtk_window_focus_out_callback), this);
}
// connect to the various key and mouse handlers
}
// connect to the various key and mouse handlers