about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMarco Peereboom <marco@conformal.com>2010-02-28 01:04:26 +0000
committerMarco Peereboom <marco@conformal.com>2010-02-28 01:04:26 +0000
commit6da5e93973037ce05d81be7f29ab513433cb3767 (patch)
treee91d44070c2aaac19f01a9e5456c0d1c40e35768
parent3a9f7b4c670b1e8838ba3c6d11012b81b8f7e307 (diff)
downloadxombrero-6da5e93973037ce05d81be7f29ab513433cb3767.tar.gz
add f7 to focus on search entry
-rw-r--r--xxxterm.12
-rw-r--r--xxxterm.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/xxxterm.1 b/xxxterm.1
index 1867adf..1abfedd 100644
--- a/xxxterm.1
+++ b/xxxterm.1
@@ -163,6 +163,8 @@ Focus:
 .Bl -tag -width "tabnew, tabedit, tabe [URI]" -offset indent -compact
 .It Cm F6
 Focus on URI entry
+.It Cm F7
+Focus on search entry
 .El
 .Pp
 Navigation:
diff --git a/xxxterm.c b/xxxterm.c
index 2aaa035..37a5b44 100644
--- a/xxxterm.c
+++ b/xxxterm.c
@@ -160,6 +160,7 @@ struct karg {
 
 #define XT_FOCUS_INVALID	(0)
 #define XT_FOCUS_URI		(1)
+#define XT_FOCUS_SEARCH		(2)
 
 #define XT_SEARCH_INVALID	(0)
 #define XT_SEARCH_NEXT		(1)
@@ -415,11 +416,13 @@ quit(struct tab *t, struct karg *args)
 int
 focus(struct tab *t, struct karg *args)
 {
-	if (t == NULL)
+	if (t == NULL || args == NULL)
 		errx(1, "focus");
 
 	if (args->i == XT_FOCUS_URI)
 		gtk_widget_grab_focus(GTK_WIDGET(t->uri_entry));
+	if (args->i == XT_FOCUS_SEARCH)
+		gtk_widget_grab_focus(GTK_WIDGET(t->search_entry));
 
 	return (0);
 }
@@ -869,6 +872,7 @@ struct key {
 
 	/* focus */
 	{ 0,			0,	GDK_F6,		focus,		{.i = XT_FOCUS_URI} },
+	{ 0,			0,	GDK_F7,		focus,		{.i = XT_FOCUS_SEARCH} },
 
 	/* navigation */
 	{ 0,			0,	GDK_BackSpace,	navaction,	{.i = XT_NAV_BACK} },