diff options
author | uranther <jwheaton@purdue.edu> | 2009-06-06 17:02:56 -0400 |
---|---|---|
committer | uranther <jwheaton@purdue.edu> | 2009-06-06 17:02:56 -0400 |
commit | 4cd8bcf21f6d46773b11d049ee62077aa0dcfdb2 (patch) | |
tree | 8ebb4727b37617cd057da51e5f67380fa456a9a3 /uzbl.c | |
parent | 70c285199e5283044ea50bb9317c1d575dacaa00 (diff) | |
parent | bd6fb013e4ddf7c89f8154ff2ef7bc7f7108ca98 (diff) |
merged with Dieterbe/experimental, finally
Diffstat (limited to 'uzbl.c')
-rw-r--r-- | uzbl.c | 23 |
1 files changed, 15 insertions, 8 deletions
@@ -32,6 +32,7 @@ #define LENGTH(x) (sizeof x / sizeof x[0]) #define MAX_BINDINGS 256 +#define _POSIX_SOURCE #include <gtk/gtk.h> #include <gdk/gdkx.h> @@ -545,6 +546,7 @@ load_start_cb (WebKitWebView* page, WebKitWebFrame* frame, gpointer data) { (void) page; (void) frame; (void) data; + uzbl.gui.sbar.load_progress = 0; g_string_truncate(uzbl.state.keycmd, 0); // don't need old commands to remain on new page? if (uzbl.behave.load_start_handler) run_handler(uzbl.behave.load_start_handler, ""); @@ -732,7 +734,11 @@ static void load_uri (WebKitWebView *web_view, GArray *argv) { if (argv_idx(argv, 0)) { GString* newuri = g_string_new (argv_idx(argv, 0)); - if (g_strrstr (argv_idx(argv, 0), "://") == NULL) + if (g_strstr_len (argv_idx(argv, 0), 11, "javascript:") != NULL) { + run_js(web_view, argv); + return; + } + if (g_strrstr (argv_idx(argv, 0), "://") == NULL && g_strstr_len (argv_idx(argv, 0), 5, "data:") == NULL) g_string_prepend (newuri, "http://"); /* if we do handle cookies, ask our handler for them */ webkit_web_view_load_uri (web_view, newuri->str); @@ -1117,7 +1123,7 @@ sharg_append(GArray *a, const gchar *str) { // make sure that the args string you pass can properly be interpreted (eg properly escaped against whitespace, quotes etc) static gboolean run_command (const gchar *command, const guint npre, const gchar **args, - const gboolean sync, char **stdout) { + const gboolean sync, char **output_stdout) { //command <uzbl conf> <uzbl pid> <uzbl win id> <uzbl fifo file> <uzbl socket file> [args] GError *err = NULL; @@ -1141,10 +1147,10 @@ run_command (const gchar *command, const guint npre, const gchar **args, gboolean result; if (sync) { - if (*stdout) *stdout = strfree(*stdout); + if (*output_stdout) *output_stdout = strfree(*output_stdout); result = g_spawn_sync(NULL, (gchar **)a->data, NULL, G_SPAWN_SEARCH_PATH, - NULL, NULL, stdout, NULL, NULL, &err); + NULL, NULL, output_stdout, NULL, NULL, &err); } else result = g_spawn_async(NULL, (gchar **)a->data, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &err); @@ -1158,8 +1164,8 @@ run_command (const gchar *command, const guint npre, const gchar **args, g_string_append_printf(s, " -- result: %s", (result ? "true" : "false")); printf("%s\n", s->str); g_string_free(s, TRUE); - if(stdout) { - printf("Stdout: %s\n", *stdout); + if(output_stdout) { + printf("Stdout: %s\n", *output_stdout); } } if (err) { @@ -1555,7 +1561,7 @@ set_var_value(gchar *name, gchar *val) { } else if (c->type == TYPE_FLOAT) { float *fp = (float *)c->ptr; buf = expand_vars(val); - *fp = strtof(buf, &endp); + *fp = strtod(buf, &endp); g_free(buf); } @@ -2033,6 +2039,7 @@ create_mainbar () { gtk_misc_set_alignment (GTK_MISC(g->mainbar_label), 0, 0); gtk_misc_set_padding (GTK_MISC(g->mainbar_label), 2, 2); gtk_box_pack_start (GTK_BOX (g->mainbar), g->mainbar_label, TRUE, TRUE, 0); + g_signal_connect (G_OBJECT (g->mainbar), "key-press-event", G_CALLBACK (key_press_cb), NULL); return g->mainbar; } @@ -2252,7 +2259,7 @@ settings_init () { printf ("No configuration file loaded.\n"); } - g_signal_connect(n->soup_session, "request-queued", G_CALLBACK(handle_cookies), NULL); + g_signal_connect_after(n->soup_session, "request-started", G_CALLBACK(handle_cookies), NULL); } static void handle_cookies (SoupSession *session, SoupMessage *msg, gpointer user_data){ |