summary refs log tree commit diff stats
path: root/src/fe-gtk/search.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fe-gtk/search.c')
-rw-r--r--src/fe-gtk/search.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/fe-gtk/search.c b/src/fe-gtk/search.c
index 41a1a642..a8bcfbe2 100644
--- a/src/fe-gtk/search.c
+++ b/src/fe-gtk/search.c
@@ -32,7 +32,6 @@
 #include <gtk/gtkvseparator.h>
 #include <gtk/gtkradiobutton.h>
 #include <gtk/gtktogglebutton.h>
-#include <gdk/gdkkeysyms.h>
 
 #include "../common/hexchat.h"
 #include "../common/fe.h"
@@ -119,14 +118,6 @@ search_entry_cb (GtkWidget * entry, session * sess)
 	search_search (sess, gtk_entry_get_text (GTK_ENTRY (entry)));
 }
 
-static gboolean 
-search_key_cb (GtkWidget * window, GdkEventKey * key, gpointer userdata)
-{
-	if (key->keyval == GDK_Escape)
-		gtk_widget_destroy (window);
-	return FALSE;
-}
-
 static void
 search_caseign_cb (GtkToggleButton * but, session * sess)
 {
@@ -152,6 +143,7 @@ search_highlight_cb (GtkToggleButton * but, session * sess)
 	search_search (sess, NULL);
 }
 
+int RBHesc = 0;
 void
 search_open (session * sess)
 {
@@ -238,7 +230,7 @@ search_open (session * sess)
 	add_tip (wid, "Close this box, reset highlighted search items, and stop searching new lines.");
 
 	/* Add recognition of the ESC key to close the box */
-	g_signal_connect (G_OBJECT (win), "key_press_event", G_CALLBACK (search_key_cb), win);
+	gtkutil_destroy_on_esc (win);
 
 	/* That's all, folks */
 	searchwin = win;