diff options
author | mutantturkey <crazycal00@gmail.com> | 2010-05-06 18:10:23 -0400 |
---|---|---|
committer | mutantturkey <crazycal00@gmail.com> | 2010-05-06 18:10:23 -0400 |
commit | f38ee0de0af05f684337e328cf941458f4501973 (patch) | |
tree | 42a2bc64ca106398410a23099b89e14311df3b6f | |
parent | 0d891bed50a361c09e688778f87101c056623dbb (diff) |
fixed titles bug
-rw-r--r-- | sb.c | 17 |
1 files changed, 5 insertions, 12 deletions
@@ -12,9 +12,8 @@ static struct { GtkWidget *win; GtkWidget *bar; GtkWidget *search; GtkWidget *vb static GQuark term_data_id = 0; static void activate_uri_entry_cb(GtkWidget* entry, gpointer data); -static void update_title(const gchar* title, gchar* linkhover); static void link_hover_cb (WebKitWebView* page, const gchar* title, const gchar* link, gpointer data); -static void title_change_cb (WebKitWebView* web_view, WebKitWebFrame* web_frame, const gchar* title, gpointer data); +static void title_change_cb(WebKitWebView *v, WebKitWebFrame *f, const char *title, tab *t); static void progress_change_cb (WebKitWebView* page, gint progress, gpointer data); static void load_commit_cb (WebKitWebView* page, WebKitWebFrame* frame, gpointer data); static void destroy_cb (GtkWidget* widget, gpointer data); @@ -41,13 +40,6 @@ static void close_tab() { if (gtk_notebook_get_n_pages(GTK_NOTEBOOK(w.notebook)) == 0) { gtk_main_quit(); } } -static void update_title (const gchar* title, gchar* linkhover) { - if (linkhover) title = g_strdup(linkhover); - struct tab *t = get_tab(NULL, gtk_notebook_get_current_page(GTK_NOTEBOOK(w.notebook))); - gtk_window_set_title(GTK_WINDOW(w.win), title); - gtk_label_set_label(GTK_LABEL(t->label), title); - g_free(linkhover); -} static void link_hover_cb (WebKitWebView* page, const gchar* title, const gchar* link, gpointer data) { /* gchar *linkhover; @@ -55,8 +47,9 @@ static void link_hover_cb (WebKitWebView* page, const gchar* title, const gchar* */ } -static void title_change_cb (WebKitWebView* web_view, WebKitWebFrame* web_frame, const gchar* title, gpointer data) { - update_title (title, NULL); +static void title_change_cb(WebKitWebView *v, WebKitWebFrame *f, const char *title, tab *t) { + gtk_window_set_title(GTK_WINDOW(w.win), title); + gtk_label_set_label(GTK_LABEL(t->label), title); } static void progress_change_cb (WebKitWebView* p, gint progress, gpointer data) { @@ -103,7 +96,7 @@ static void new_tab() { /*callbacks*/ - g_signal_connect (G_OBJECT (t->view), "title-changed", G_CALLBACK (title_change_cb), t->view); + g_signal_connect (G_OBJECT (t->view), "title-changed", G_CALLBACK (title_change_cb), t); g_signal_connect (G_OBJECT (t->view), "load-progress-changed", G_CALLBACK (progress_change_cb), t->view); g_signal_connect (G_OBJECT (t->view), "load-committed", G_CALLBACK (load_commit_cb), t->view); g_signal_connect (G_OBJECT (t->view), "hovering-over-link", G_CALLBACK (link_hover_cb), t->view); |