summary refs log tree commit diff stats
path: root/src/fe-gtk/search.c
diff options
context:
space:
mode:
authorRichardHitt <rbh00@netcom.com>2013-03-17 15:11:23 -0700
committerRichardHitt <rbh00@netcom.com>2013-03-17 15:11:23 -0700
commitecdcc99280d29994791b8bc3273bf03a670d0b7b (patch)
tree947e2145e5cf149f0ccfc4d86d77dd2f2b278943 /src/fe-gtk/search.c
parente8a78b9aa1398deb69d20d599be2a630f721cafa (diff)
ESC key will destroy the windows mentioned at issue 211.
This change implements generic routine gtkutil_destroy_on_esc ()
and adds invocations of it in the requisite window-handling places.
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;