summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2015-06-30 11:09:45 (GMT)
committer Vincent Sanders <vince@kyllikki.org>2015-06-30 11:09:45 (GMT)
commit55260cc9a06e7d62c5d242c4420ab5e5474242b0 (patch)
tree9b9c88f1f960c038c6619e06cc39f13c72fb7de4 /gtk
parent65ef60d2b5ac0a39a14538b8abab5cdd9da6fad6 (diff)
downloadnetsurf-55260cc9a06e7d62c5d242c4420ab5e5474242b0.tar.gz
netsurf-55260cc9a06e7d62c5d242c4420ab5e5474242b0.tar.bz2
Ensure gtk windows have a default favicon at creation.
This ensures newly created gtk gui windows have a default favicon set. This is necessary because new tab creation displays the new windows contents before an icon has been set and the icon will not be changed from the previously viewed tabs icon.
Diffstat (limited to 'gtk')
-rw-r--r--gtk/window.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/gtk/window.c b/gtk/window.c
index 481ae3b..c50ed20 100644
--- a/gtk/window.c
+++ b/gtk/window.c
@@ -765,13 +765,14 @@ gui_window_create(struct browser_window *bw,
/* attach scaffold */
if (flags & GW_CREATE_TAB) {
+ /* open in new tab, attach to existing scaffold */
if (existing != NULL) {
g->scaffold = existing->scaffold;
} else {
g->scaffold = nsgtk_current_scaffolding();
}
} else {
- /* Now construct and attach a scaffold */
+ /* open in new window, create and attach to scaffold */
g->scaffold = nsgtk_new_scaffolding(g);
}
if (g->scaffold == NULL) {
@@ -788,6 +789,9 @@ gui_window_create(struct browser_window *bw,
g->paned = GTK_PANED(gtk_builder_get_object(tab_builder, "hpaned1"));
g->input_method = gtk_im_multicontext_new();
+ /* set a default favicon */
+ g_object_ref(favicon_pixbuf);
+ g->icon = favicon_pixbuf;
/* add new gui window to global list (push_top) */
if (window_list) {
@@ -850,13 +854,13 @@ gui_window_create(struct browser_window *bw,
nsgtk_paned_notify__position, g);
/* gtk container destructor */
- CONNECT(g->container, "destroy",
- window_destroy, g);
+ CONNECT(g->container, "destroy", window_destroy, g);
/* input method */
gtk_im_context_set_client_window(g->input_method,
nsgtk_layout_get_bin_window(g->layout));
gtk_im_context_set_use_preedit(g->input_method, FALSE);
+
/* input method signals */
CONNECT(g->input_method, "commit",
nsgtk_window_input_method_commit, g);
@@ -936,7 +940,10 @@ static void gui_window_destroy(struct gui_window *g)
}
/**
- * set favicon
+ * favicon setting for gtk gui window.
+ *
+ * \param gw gtk gui window to set favicon on.
+ * \param icon A handle to the new favicon content.
*/
static void gui_window_set_icon(struct gui_window *gw, hlcache_handle *icon)
{