From 61aa13c1f9a594affe331b5e88b165821146d148 Mon Sep 17 00:00:00 2001 From: "Timothee \"TTimo\" Besset" Date: Sat, 24 Aug 2013 08:17:05 -0500 Subject: [PATCH] fix another edge case in the floating texture window management --- radiant/groupdialog.cpp | 9 ++++++++- radiant/gtkmisc.cpp | 7 +++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/radiant/groupdialog.cpp b/radiant/groupdialog.cpp index 75cd814f..a7c088b0 100644 --- a/radiant/groupdialog.cpp +++ b/radiant/groupdialog.cpp @@ -1138,6 +1138,13 @@ static void switch_page( GtkNotebook *notebook, GtkNotebookPage *page, guint pag // ============================================================================= // GroupDlg class +static gint OnDeleteHide( GtkWidget *widget ) { + gtk_widget_hide( widget ); + // see OnDialogKey + gtk_notebook_set_current_page( GTK_NOTEBOOK( g_pGroupDlg->m_pNotebook ), 0 ); + return TRUE; +} + // NOTE: when a key is hit with group window focused, we catch in this handler but it gets propagated to mainframe too // therefore the message will be intercepted and used as a ID_SELECTION_DESELECT static gint OnDialogKey( GtkWidget* widget, GdkEventKey* event, gpointer data ) { @@ -1207,7 +1214,7 @@ void GroupDlg::Create(){ load_window_pos( dlg, g_PrefsDlg.mWindowInfo.posEntityWnd ); gtk_window_set_title( GTK_WINDOW( dlg ), "Entities" ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", GTK_SIGNAL_FUNC( widget_delete_hide ), NULL ); + gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", GTK_SIGNAL_FUNC( OnDeleteHide ), NULL ); // catch 'Esc' gtk_signal_connect( GTK_OBJECT( dlg ), "key_press_event", GTK_SIGNAL_FUNC( OnDialogKey ), NULL ); diff --git a/radiant/gtkmisc.cpp b/radiant/gtkmisc.cpp index 6259d14b..c34ca8cb 100644 --- a/radiant/gtkmisc.cpp +++ b/radiant/gtkmisc.cpp @@ -138,10 +138,9 @@ void load_window_pos( GtkWidget *wnd, window_position_t& pos ){ #endif } -gint widget_delete_hide( GtkWidget *widget ){ - gtk_widget_hide( widget ); - - return TRUE; +gint widget_delete_hide( GtkWidget *widget ) { + gtk_widget_hide( widget ); + return TRUE; }