Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/7c552edf87f93387321bcd003c825d8c4ba68d00
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/7c552edf87f93387321bcd003c825d8c4ba68d00
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/7c552edf87f93387321bcd003c825d8c4ba68d00

The branch, vince/gtk-tab-restyle has been updated
       via  7c552edf87f93387321bcd003c825d8c4ba68d00 (commit)
      from  c67c4aa999f44b728bc508ff24060ea605f17e1e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=7c552edf87f93387321bcd003c825d8c4ba68d00
commit 7c552edf87f93387321bcd003c825d8c4ba68d00
Author: Vincent Sanders <[email protected]>
Commit: Vincent Sanders <[email protected]>

    ensure pixbuf references are updated correctly to avoid leaks

diff --git a/frontends/gtk/compat.c b/frontends/gtk/compat.c
index a8321d6..bd3f46e 100644
--- a/frontends/gtk/compat.c
+++ b/frontends/gtk/compat.c
@@ -635,7 +635,9 @@ void nsgtk_widget_set_margins(GtkWidget *widget, gint 
hmargin, gint vmargin)
        gtk_widget_set_margin_top(widget, vmargin);
        gtk_widget_set_margin_bottom(widget, vmargin);
 #else
-       gtk_misc_set_padding(GTK_MISC(widget), hmargin, vmargin);
+       if (GTK_IS_MISC(widget)) {
+               gtk_misc_set_padding(GTK_MISC(widget), hmargin, vmargin);
+       }
 #endif
 }
 
diff --git a/frontends/gtk/gui.c b/frontends/gtk/gui.c
index 205c548..a87ef72 100644
--- a/frontends/gtk/gui.c
+++ b/frontends/gtk/gui.c
@@ -258,10 +258,10 @@ static nserror set_defaults(struct nsoption_s *defaults)
  */
 static nserror nsgtk_add_named_icons_to_theme(void)
 {
-       #if GTK_CHECK_VERSION(3,14,0)
+#if GTK_CHECK_VERSION(3,14,0)
        gtk_icon_theme_add_resource_path(gtk_icon_theme_get_default(),
                                          "/org/netsurf/icons");
-       #else
+#else
        GdkPixbuf *pixbuf;
        nserror res;
 
diff --git a/frontends/gtk/tabs.c b/frontends/gtk/tabs.c
index 04e90b9..6f4b22b 100644
--- a/frontends/gtk/tabs.c
+++ b/frontends/gtk/tabs.c
@@ -424,8 +424,10 @@ void nsgtk_tab_add(struct gui_window *gw,
 
        nsgtk_tab_add_page(notebook, tab_contents, background, title, 
icon_pixbuf);
 
+#if 0
        gtk_widget_grab_focus(GTK_WIDGET(nsgtk_scaffolding_urlbar(
                        nsgtk_get_scaffold(gw))));
+#endif
 }
 
 
diff --git a/frontends/gtk/toolbar.c b/frontends/gtk/toolbar.c
index f7a18e7..8d6c092 100644
--- a/frontends/gtk/toolbar.c
+++ b/frontends/gtk/toolbar.c
@@ -333,8 +333,7 @@ make_toolbar_item_websearch(bool sensitivity)
 
        res = search_web_get_provider_bitmap(&bitmap);
        if ((res == NSERROR_OK) && (bitmap != NULL)) {
-               pixbuf = nsgdk_pixbuf_get_from_surface(bitmap->surface,
-                                                      16, 16);
+               pixbuf = nsgdk_pixbuf_get_from_surface(bitmap->surface, 32, 32);
        }
 
        entry = nsgtk_entry_new();
@@ -347,6 +346,7 @@ make_toolbar_item_websearch(bool sensitivity)
                nsgtk_entry_set_icon_from_pixbuf(entry,
                                                 GTK_ENTRY_ICON_PRIMARY,
                                                 pixbuf);
+               g_object_unref(pixbuf);
        } else {
                nsgtk_entry_set_icon_from_icon_name(entry,
                                                    GTK_ENTRY_ICON_PRIMARY,
@@ -1284,7 +1284,6 @@ toolbar_customisation_create_toolbox(struct 
nsgtk_toolbar_customisation *tbc,
 static nserror
 customisation_toolbar_update(struct nsgtk_toolbar_customisation *tbc)
 {
-       GtkEntry *entry;
        nserror res;
 
        res = apply_user_button_customisation(&tbc->toolbar);
@@ -1312,18 +1311,6 @@ customisation_toolbar_update(struct 
nsgtk_toolbar_customisation *tbc)
                return res;
        }
 
-       if (tbc->toolbar.items[URL_BAR_ITEM].location != INACTIVE_LOCATION) {
-               entry = 
GTK_ENTRY(gtk_bin_get_child(GTK_BIN(tbc->toolbar.items[URL_BAR_ITEM].button)));
-
-               gtk_widget_set_sensitive(GTK_WIDGET(entry), FALSE);
-       }
-
-       if (tbc->toolbar.items[WEBSEARCH_ITEM].location != INACTIVE_LOCATION) {
-               entry = 
GTK_ENTRY(gtk_bin_get_child(GTK_BIN(tbc->toolbar.items[WEBSEARCH_ITEM].button)));
-
-               gtk_widget_set_sensitive(GTK_WIDGET(entry), FALSE);
-       }
-
        return NSERROR_OK;
 }
 
@@ -1365,6 +1352,22 @@ customisation_reset_clicked_cb(GtkWidget *widget, 
gpointer data)
 }
 
 
+/**
+ * customisation container delete handler
+ */
+static gboolean
+customisation_container_delete_cb(GtkWidget *widget,
+                                 GdkEvent *event,
+                                 gpointer data)
+{
+       struct nsgtk_toolbar_customisation *tbc;
+       tbc = (struct nsgtk_toolbar_customisation *)data;
+
+       free(tbc);
+
+       return FALSE;
+}
+
 /*
  * Toolbar button clicked handlers
  */
@@ -1482,16 +1485,13 @@ static gboolean cutomize_button_clicked_cb(GtkWidget 
*widget, gpointer data)
                         G_CALLBACK(customisation_reset_clicked_cb),
                         tbc);
 
-       /* close and cleanup on destroy signal */
-#if 0
-
+       /* close and cleanup on delete signal */
        g_signal_connect(tbc->container,
                         "delete-event",
-                        G_CALLBACK(nsgtk_toolbar_delete),
-                        g);
+                        G_CALLBACK(customisation_container_delete_cb),
+                        tbc);
 
 
-#endif
        g_signal_connect(tbc->container,
                         "drag-drop",
                         G_CALLBACK(customisation_container_drag_drop_cb),
diff --git a/frontends/gtk/window.c b/frontends/gtk/window.c
index 9368d70..647f15f 100644
--- a/frontends/gtk/window.c
+++ b/frontends/gtk/window.c
@@ -1408,13 +1408,17 @@ gui_search_web_provider_update(const char *name, struct 
bitmap *bitmap)
        GdkPixbuf *pixbuf = NULL;
 
        if (bitmap != NULL) {
-               pixbuf = nsgdk_pixbuf_get_from_surface(bitmap->surface, 16, 16);
+               pixbuf = nsgdk_pixbuf_get_from_surface(bitmap->surface, 32, 32);
        }
 
        for (gw = window_list; gw != NULL; gw = gw->next) {
                nsgtk_toolbar_set_websearch_image(gw->toolbar, pixbuf);
        }
 
+       if (pixbuf != NULL) {
+               g_object_unref(pixbuf);
+       }
+
        return NSERROR_OK;
 }
 


-----------------------------------------------------------------------

Summary of changes:
 frontends/gtk/compat.c  |    4 +++-
 frontends/gtk/gui.c     |    4 ++--
 frontends/gtk/tabs.c    |    2 ++
 frontends/gtk/toolbar.c |   42 +++++++++++++++++++++---------------------
 frontends/gtk/window.c  |    6 +++++-
 5 files changed, 33 insertions(+), 25 deletions(-)

diff --git a/frontends/gtk/compat.c b/frontends/gtk/compat.c
index a8321d6..bd3f46e 100644
--- a/frontends/gtk/compat.c
+++ b/frontends/gtk/compat.c
@@ -635,7 +635,9 @@ void nsgtk_widget_set_margins(GtkWidget *widget, gint 
hmargin, gint vmargin)
        gtk_widget_set_margin_top(widget, vmargin);
        gtk_widget_set_margin_bottom(widget, vmargin);
 #else
-       gtk_misc_set_padding(GTK_MISC(widget), hmargin, vmargin);
+       if (GTK_IS_MISC(widget)) {
+               gtk_misc_set_padding(GTK_MISC(widget), hmargin, vmargin);
+       }
 #endif
 }
 
diff --git a/frontends/gtk/gui.c b/frontends/gtk/gui.c
index 205c548..a87ef72 100644
--- a/frontends/gtk/gui.c
+++ b/frontends/gtk/gui.c
@@ -258,10 +258,10 @@ static nserror set_defaults(struct nsoption_s *defaults)
  */
 static nserror nsgtk_add_named_icons_to_theme(void)
 {
-       #if GTK_CHECK_VERSION(3,14,0)
+#if GTK_CHECK_VERSION(3,14,0)
        gtk_icon_theme_add_resource_path(gtk_icon_theme_get_default(),
                                          "/org/netsurf/icons");
-       #else
+#else
        GdkPixbuf *pixbuf;
        nserror res;
 
diff --git a/frontends/gtk/tabs.c b/frontends/gtk/tabs.c
index 04e90b9..6f4b22b 100644
--- a/frontends/gtk/tabs.c
+++ b/frontends/gtk/tabs.c
@@ -424,8 +424,10 @@ void nsgtk_tab_add(struct gui_window *gw,
 
        nsgtk_tab_add_page(notebook, tab_contents, background, title, 
icon_pixbuf);
 
+#if 0
        gtk_widget_grab_focus(GTK_WIDGET(nsgtk_scaffolding_urlbar(
                        nsgtk_get_scaffold(gw))));
+#endif
 }
 
 
diff --git a/frontends/gtk/toolbar.c b/frontends/gtk/toolbar.c
index f7a18e7..8d6c092 100644
--- a/frontends/gtk/toolbar.c
+++ b/frontends/gtk/toolbar.c
@@ -333,8 +333,7 @@ make_toolbar_item_websearch(bool sensitivity)
 
        res = search_web_get_provider_bitmap(&bitmap);
        if ((res == NSERROR_OK) && (bitmap != NULL)) {
-               pixbuf = nsgdk_pixbuf_get_from_surface(bitmap->surface,
-                                                      16, 16);
+               pixbuf = nsgdk_pixbuf_get_from_surface(bitmap->surface, 32, 32);
        }
 
        entry = nsgtk_entry_new();
@@ -347,6 +346,7 @@ make_toolbar_item_websearch(bool sensitivity)
                nsgtk_entry_set_icon_from_pixbuf(entry,
                                                 GTK_ENTRY_ICON_PRIMARY,
                                                 pixbuf);
+               g_object_unref(pixbuf);
        } else {
                nsgtk_entry_set_icon_from_icon_name(entry,
                                                    GTK_ENTRY_ICON_PRIMARY,
@@ -1284,7 +1284,6 @@ toolbar_customisation_create_toolbox(struct 
nsgtk_toolbar_customisation *tbc,
 static nserror
 customisation_toolbar_update(struct nsgtk_toolbar_customisation *tbc)
 {
-       GtkEntry *entry;
        nserror res;
 
        res = apply_user_button_customisation(&tbc->toolbar);
@@ -1312,18 +1311,6 @@ customisation_toolbar_update(struct 
nsgtk_toolbar_customisation *tbc)
                return res;
        }
 
-       if (tbc->toolbar.items[URL_BAR_ITEM].location != INACTIVE_LOCATION) {
-               entry = 
GTK_ENTRY(gtk_bin_get_child(GTK_BIN(tbc->toolbar.items[URL_BAR_ITEM].button)));
-
-               gtk_widget_set_sensitive(GTK_WIDGET(entry), FALSE);
-       }
-
-       if (tbc->toolbar.items[WEBSEARCH_ITEM].location != INACTIVE_LOCATION) {
-               entry = 
GTK_ENTRY(gtk_bin_get_child(GTK_BIN(tbc->toolbar.items[WEBSEARCH_ITEM].button)));
-
-               gtk_widget_set_sensitive(GTK_WIDGET(entry), FALSE);
-       }
-
        return NSERROR_OK;
 }
 
@@ -1365,6 +1352,22 @@ customisation_reset_clicked_cb(GtkWidget *widget, 
gpointer data)
 }
 
 
+/**
+ * customisation container delete handler
+ */
+static gboolean
+customisation_container_delete_cb(GtkWidget *widget,
+                                 GdkEvent *event,
+                                 gpointer data)
+{
+       struct nsgtk_toolbar_customisation *tbc;
+       tbc = (struct nsgtk_toolbar_customisation *)data;
+
+       free(tbc);
+
+       return FALSE;
+}
+
 /*
  * Toolbar button clicked handlers
  */
@@ -1482,16 +1485,13 @@ static gboolean cutomize_button_clicked_cb(GtkWidget 
*widget, gpointer data)
                         G_CALLBACK(customisation_reset_clicked_cb),
                         tbc);
 
-       /* close and cleanup on destroy signal */
-#if 0
-
+       /* close and cleanup on delete signal */
        g_signal_connect(tbc->container,
                         "delete-event",
-                        G_CALLBACK(nsgtk_toolbar_delete),
-                        g);
+                        G_CALLBACK(customisation_container_delete_cb),
+                        tbc);
 
 
-#endif
        g_signal_connect(tbc->container,
                         "drag-drop",
                         G_CALLBACK(customisation_container_drag_drop_cb),
diff --git a/frontends/gtk/window.c b/frontends/gtk/window.c
index 9368d70..647f15f 100644
--- a/frontends/gtk/window.c
+++ b/frontends/gtk/window.c
@@ -1408,13 +1408,17 @@ gui_search_web_provider_update(const char *name, struct 
bitmap *bitmap)
        GdkPixbuf *pixbuf = NULL;
 
        if (bitmap != NULL) {
-               pixbuf = nsgdk_pixbuf_get_from_surface(bitmap->surface, 16, 16);
+               pixbuf = nsgdk_pixbuf_get_from_surface(bitmap->surface, 32, 32);
        }
 
        for (gw = window_list; gw != NULL; gw = gw->next) {
                nsgtk_toolbar_set_websearch_image(gw->toolbar, pixbuf);
        }
 
+       if (pixbuf != NULL) {
+               g_object_unref(pixbuf);
+       }
+
        return NSERROR_OK;
 }
 


-- 
NetSurf Browser

_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org

Reply via email to