Make the escape key hide the overlay again.
This commit is contained in:
parent
1b2e2a1697
commit
a204100856
13
termite.c
13
termite.c
|
@ -35,13 +35,20 @@ static void search(VteTerminal *vte, const char *pattern, bool reverse) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean search_key_press_cb(GtkEntry *entry, GdkEventKey *event, search_panel_info *info) {
|
static gboolean search_key_press_cb(GtkEntry *entry, GdkEventKey *event, search_panel_info *info) {
|
||||||
if (event->keyval == GDK_KEY_Return) {
|
gboolean ret = FALSE;
|
||||||
|
|
||||||
|
if (event->keyval == GDK_KEY_Escape) {
|
||||||
|
ret = TRUE;
|
||||||
|
} else if (event->keyval == GDK_KEY_Return) {
|
||||||
search(VTE_TERMINAL(info->vte), gtk_entry_get_text(GTK_ENTRY(entry)), info->reverse);
|
search(VTE_TERMINAL(info->vte), gtk_entry_get_text(GTK_ENTRY(entry)), info->reverse);
|
||||||
|
ret = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ret) {
|
||||||
gtk_widget_hide(GTK_WIDGET(info->panel));
|
gtk_widget_hide(GTK_WIDGET(info->panel));
|
||||||
gtk_widget_grab_focus(info->vte);
|
gtk_widget_grab_focus(info->vte);
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
return FALSE;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean key_press_cb(GtkWidget *vte, GdkEventKey *event, search_panel_info *info) {
|
static gboolean key_press_cb(GtkWidget *vte, GdkEventKey *event, search_panel_info *info) {
|
||||||
|
|
Loading…
Reference in New Issue