X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/288059b2b9d1d4b562e1a0d06f7026936793bc79..f7292ebebae552238c50f8009db572edc44a315e:/src/gtk1/window.cpp diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index a2c0ea57b2..a18db75fb5 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -1912,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); @@ -2275,21 +2275,6 @@ wxWindow *wxWindowBase::FindFocus() return (wxWindow *)g_focusWindow; } -//----------------------------------------------------------------------------- -// "destroy" event -//----------------------------------------------------------------------------- - -// VZ: Robert commented the code using out so it generates warnings: should -// be either fixed or removed completely -#if 0 - -static void gtk_window_destroy_callback( GtkWidget* widget, wxWindow *win ) -{ - wxWindowDestroyEvent event(win); - win->GetEventHandler()->ProcessEvent(event); -} - -#endif // 0 //----------------------------------------------------------------------------- // "realize" from m_widget @@ -2735,6 +2720,8 @@ bool wxWindowGTK::Create( wxWindow *parent, wxWindowGTK::~wxWindowGTK() { + SendDestroyEvent(); + if (g_focusWindow == this) g_focusWindow = NULL; @@ -2940,11 +2927,6 @@ void wxWindowGTK::ConnectWidget( GtkWidget *widget ) gtk_signal_connect( GTK_OBJECT(widget), "leave_notify_event", GTK_SIGNAL_FUNC(gtk_window_leave_callback), (gpointer)this ); - - // This keeps crashing on me. RR. - // - // gtk_signal_connect( GTK_OBJECT(widget), "destroy", - // GTK_SIGNAL_FUNC(gtk_window_destroy_callback), (gpointer)this ); } bool wxWindowGTK::Destroy() @@ -3438,7 +3420,7 @@ int wxWindowGTK::GetCharHeight() const pango_layout_line_get_extents(line, NULL, &rect); g_object_unref( G_OBJECT( layout ) ); - + return (int) (rect.height / PANGO_SCALE); #else GdkFont *font = m_font.GetInternalFont( 1.0 ); @@ -3471,7 +3453,7 @@ int wxWindowGTK::GetCharWidth() const pango_layout_line_get_extents(line, NULL, &rect); g_object_unref( G_OBJECT( layout ) ); - + return (int) (rect.width / PANGO_SCALE); #else GdkFont *font = m_font.GetInternalFont( 1.0 ); @@ -4152,7 +4134,7 @@ void wxWindowGTK::SetWidgetStyle() pango_font_description_copy( m_font.GetNativeFontInfo()->description ); #else gdk_font_unref( style->font ); - style->font = gdk_font_ref( m_font.GetInternalFont( 1.0 ) ) + style->font = gdk_font_ref( m_font.GetInternalFont( 1.0 ) ); #endif }