From: Robert Roebling Date: Sun, 8 Dec 2002 18:02:30 +0000 (+0000) Subject: Catching dclick event from a spinbutton or spin control X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/df135f2b4d0c876017986aec051029b5abc9a148?ds=inline Catching dclick event from a spinbutton or spin control crashes GTK 1.2 sooner or later. Just disable this event for now. Should also be in 2.4, actually. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18112 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index bf5f12cdb8..2cee058d32 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -1695,6 +1695,20 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, wxPrintf( wxT(".\n") ); */ +#ifndef __WXGTK20__ + if (event_type == wxEVT_LEFT_DCLICK) + { + // GTK 1.2 crashes when intercepting double + // click events from both wxSpinButton and + // wxSpinCtrl + if (GTK_IS_SPIN_BUTTON(win->m_widget)) + { + // Just disable this event for now. + return FALSE; + } + } +#endif + if (win->GetEventHandler()->ProcessEvent( event )) { gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "button_press_event" ); @@ -1898,7 +1912,7 @@ static gint gtk_window_focus_in_callback( GtkWidget *widget, wxLogTrace(TRACE_FOCUS, _T("%s: focus in"), win->GetName().c_str()); - + #ifdef HAVE_XIM if (win->m_ic) gdk_im_begin(win->m_ic, win->m_wxwindow->window); diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index bf5f12cdb8..2cee058d32 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -1695,6 +1695,20 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, wxPrintf( wxT(".\n") ); */ +#ifndef __WXGTK20__ + if (event_type == wxEVT_LEFT_DCLICK) + { + // GTK 1.2 crashes when intercepting double + // click events from both wxSpinButton and + // wxSpinCtrl + if (GTK_IS_SPIN_BUTTON(win->m_widget)) + { + // Just disable this event for now. + return FALSE; + } + } +#endif + if (win->GetEventHandler()->ProcessEvent( event )) { gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "button_press_event" ); @@ -1898,7 +1912,7 @@ static gint gtk_window_focus_in_callback( GtkWidget *widget, wxLogTrace(TRACE_FOCUS, _T("%s: focus in"), win->GetName().c_str()); - + #ifdef HAVE_XIM if (win->m_ic) gdk_im_begin(win->m_ic, win->m_wxwindow->window);