fix another edge case in the floating texture window management

This commit is contained in:
Timothee "TTimo" Besset 2013-08-24 08:17:05 -05:00
parent f2ab6576c6
commit 61aa13c1f9
2 changed files with 11 additions and 5 deletions

View file

@ -1138,6 +1138,13 @@ static void switch_page( GtkNotebook *notebook, GtkNotebookPage *page, guint pag
// ============================================================================= // =============================================================================
// GroupDlg class // 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 // 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 // therefore the message will be intercepted and used as a ID_SELECTION_DESELECT
static gint OnDialogKey( GtkWidget* widget, GdkEventKey* event, gpointer data ) { static gint OnDialogKey( GtkWidget* widget, GdkEventKey* event, gpointer data ) {
@ -1207,7 +1214,7 @@ void GroupDlg::Create(){
load_window_pos( dlg, g_PrefsDlg.mWindowInfo.posEntityWnd ); load_window_pos( dlg, g_PrefsDlg.mWindowInfo.posEntityWnd );
gtk_window_set_title( GTK_WINDOW( dlg ), "Entities" ); 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' // catch 'Esc'
gtk_signal_connect( GTK_OBJECT( dlg ), "key_press_event", GTK_SIGNAL_FUNC( OnDialogKey ), NULL ); gtk_signal_connect( GTK_OBJECT( dlg ), "key_press_event", GTK_SIGNAL_FUNC( OnDialogKey ), NULL );

View file

@ -138,10 +138,9 @@ void load_window_pos( GtkWidget *wnd, window_position_t& pos ){
#endif #endif
} }
gint widget_delete_hide( GtkWidget *widget ){ gint widget_delete_hide( GtkWidget *widget ) {
gtk_widget_hide( widget ); gtk_widget_hide( widget );
return TRUE;
return TRUE;
} }