diff options
author | TingPing <tngpng@gmail.com> | 2013-04-05 16:56:57 -0300 |
---|---|---|
committer | TingPing <tngpng@gmail.com> | 2013-04-05 16:56:57 -0300 |
commit | cca8ab46407d01cc04bff8f6e27e78dc225318bc (patch) | |
tree | 1efc6e8aec19fd26658465b3d0c5c89f945b6757 | |
parent | d964af81428a6d768aeb96906eb0538a30d919ca (diff) |
Fix esc closing detached util tabs
-rw-r--r-- | src/fe-gtk/gtkutil.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/fe-gtk/gtkutil.c b/src/fe-gtk/gtkutil.c index 41948e44..8d358d13 100644 --- a/src/fe-gtk/gtkutil.c +++ b/src/fe-gtk/gtkutil.c @@ -323,8 +323,15 @@ gtkutil_file_req (const char *title, void *callback, void *userdata, char *filte static gboolean gtkutil_esc_destroy (GtkWidget * win, GdkEventKey * key, gpointer userdata) { + GtkWidget *wid = win; + + /* Kill the window of detached utils */ + if (gtk_window_get_type_hint (GTK_WINDOW (gtk_widget_get_parent (win))) == GDK_WINDOW_TYPE_HINT_DIALOG) + wid = gtk_widget_get_parent (win); + if (key->keyval == GDK_Escape) - gtk_widget_destroy (win); + gtk_widget_destroy (wid); /* FIXME: leaves empty tabs */ + return FALSE; } |