Fixed wrong mode if new window was opened.
authorDaniel Carl <danielcarl@gmx.de>
Thu, 21 Feb 2013 21:03:59 +0000 (22:03 +0100)
committerDaniel Carl <danielcarl@gmx.de>
Thu, 21 Feb 2013 21:03:59 +0000 (22:03 +0100)
If there was opened a uri into a new window the first window kept in command
mode. This caused that the normal mode keybindings did not work until <esc>
was pressed.

src/main.c

index fa47b68..c6cc1e4 100644 (file)
@@ -327,6 +327,10 @@ gboolean vp_load_uri(const Arg* arg)
     } else {
         uri = g_strrstr(path, "://") ? g_strdup(path) : g_strdup_printf("http://%s", path);
     }
+
+    /* change state to normal mode */
+    vp_set_mode(VP_MODE_NORMAL, FALSE);
+
     if (arg->i == VP_TARGET_NEW) {
         char *argv[64];
 
@@ -346,9 +350,6 @@ gboolean vp_load_uri(const Arg* arg)
         /* spawn a new browser instance */
         g_spawn_async(NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL);
     } else {
-        /* change state to normal mode */
-        vp_set_mode(VP_MODE_NORMAL, FALSE);
-
         /* Load a web page into the browser instance */
         webkit_web_view_load_uri(vp.gui.webview, uri);
     }