From 710968c3aa9be5b1de7469e1a9a4da0cd2481b6c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 19 Mar 2002 15:04:53 +0000 Subject: [PATCH] fixed GTK critical warning when closing MDI child (patch 529369) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14684 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/toplevel.cpp | 6 +++++- src/gtk1/toplevel.cpp | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index 8f33dbd97b..dbe2a3a928 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -515,7 +515,11 @@ wxTopLevelWindowGTK::~wxTopLevelWindowGTK() { m_isBeingDeleted = TRUE; - gtk_window_set_focus( GTK_WINDOW(m_widget), NULL ); + // it may also be GtkScrolledWindow in the case of an MDI child + if (GTK_IS_WINDOW(m_widget)) + { + gtk_window_set_focus( GTK_WINDOW(m_widget), NULL ); + } wxTopLevelWindows.DeleteObject( this ); diff --git a/src/gtk1/toplevel.cpp b/src/gtk1/toplevel.cpp index 8f33dbd97b..dbe2a3a928 100644 --- a/src/gtk1/toplevel.cpp +++ b/src/gtk1/toplevel.cpp @@ -515,7 +515,11 @@ wxTopLevelWindowGTK::~wxTopLevelWindowGTK() { m_isBeingDeleted = TRUE; - gtk_window_set_focus( GTK_WINDOW(m_widget), NULL ); + // it may also be GtkScrolledWindow in the case of an MDI child + if (GTK_IS_WINDOW(m_widget)) + { + gtk_window_set_focus( GTK_WINDOW(m_widget), NULL ); + } wxTopLevelWindows.DeleteObject( this ); -- 2.45.2