]> git.armaanb.net Git - chorizo.git/commitdiff
^G jumps to page specified in command line
authorPeter Hofmann <scm@uninformativ.de>
Sat, 14 Jun 2014 14:44:05 +0000 (16:44 +0200)
committerPeter Hofmann <scm@uninformativ.de>
Sat, 14 Jun 2014 14:44:05 +0000 (16:44 +0200)
zea.c

diff --git a/zea.c b/zea.c
index 2e43442dd533c345341a59cc92c54a38968904b3..b80ea8db905028c98fef5253b247814ee23088c4 100644 (file)
--- a/zea.c
+++ b/zea.c
@@ -35,6 +35,7 @@ static Window embed = 0;
 static gint clients = 0;
 static gdouble global_zoom = 1.0;
 static gchar *search_text = NULL;
+static gchar *first_uri = NULL;
 
 
 struct Client
@@ -399,6 +400,12 @@ zea_web_view_key(GtkWidget *widget, GdkEvent *event, gpointer data)
                                zea_search(c, -1);
                                return TRUE;
                        }
+                       else if (((GdkEventKey *)event)->keyval == GDK_KEY_g)
+                       {
+                               webkit_web_view_load_uri(WEBKIT_WEB_VIEW(c->web_view),
+                                                        first_uri);
+                               return TRUE;
+                       }
                }
                else if (((GdkEventKey *)event)->keyval == GDK_KEY_Escape)
                {
@@ -437,7 +444,9 @@ main(int argc, char **argv)
                exit(EXIT_FAILURE);
        }
 
-       zea_new_client(argv[optind]);
+       first_uri = g_strdup(argv[optind]);
+
+       zea_new_client(first_uri);
        gtk_main();
        exit(EXIT_SUCCESS);
 }