Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/6af0496a390b38ce842577137313de4768b228b7
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/6af0496a390b38ce842577137313de4768b228b7
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/6af0496a390b38ce842577137313de4768b228b7

The branch, vince/gtk-tab-restyle has been updated
       via  6af0496a390b38ce842577137313de4768b228b7 (commit)
      from  0a9c64352001ea9c094f275c52d220d768ab73ac (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=6af0496a390b38ce842577137313de4768b228b7
commit 6af0496a390b38ce842577137313de4768b228b7
Author: Vincent Sanders <[email protected]>
Commit: Vincent Sanders <[email protected]>

    fix resource release and stopping throbber on toolbar widget destruction

diff --git a/frontends/gtk/toolbar.c b/frontends/gtk/toolbar.c
index 0d868a0..af75b89 100644
--- a/frontends/gtk/toolbar.c
+++ b/frontends/gtk/toolbar.c
@@ -1353,19 +1353,14 @@ customisation_reset_clicked_cb(GtkWidget *widget, 
gpointer data)
 
 
 /**
- * customisation container delete handler
+ * customisation container destroy handler
  */
-static gboolean
-customisation_container_delete_cb(GtkWidget *widget,
-                                 GdkEvent *event,
-                                 gpointer data)
+static void customisation_container_destroy_cb(GtkWidget *widget, gpointer 
data)
 {
        struct nsgtk_toolbar_customisation *tbc;
        tbc = (struct nsgtk_toolbar_customisation *)data;
 
        free(tbc);
-
-       return FALSE;
 }
 
 /*
@@ -1487,8 +1482,8 @@ static gboolean cutomize_button_clicked_cb(GtkWidget 
*widget, gpointer data)
 
        /* close and cleanup on delete signal */
        g_signal_connect(tbc->container,
-                        "delete-event",
-                        G_CALLBACK(customisation_container_delete_cb),
+                        "destroy",
+                        G_CALLBACK(customisation_container_destroy_cb),
                         tbc);
 
 
@@ -3175,6 +3170,22 @@ toolbar_popup_context_menu_cb(GtkToolbar *toolbar,
        return TRUE;
 }
 
+
+/**
+ * toolbar delete signal handler
+ */
+static void toolbar_destroy_cb(GtkWidget *widget, gpointer data)
+{
+       struct nsgtk_toolbar *tb;
+       tb = (struct nsgtk_toolbar *)data;
+
+       /* ensure any throbber scheduled is stopped */
+       nsgtk_schedule(-1, next_throbber_frame, tb);
+
+       free(tb);
+}
+
+
 /* exported interface documented in toolbar.h */
 nserror
 nsgtk_toolbar_create(GtkBuilder *builder,
@@ -3204,18 +3215,22 @@ nsgtk_toolbar_create(GtkBuilder *builder,
                         G_CALLBACK(toolbar_popup_context_menu_cb),
                         tb);
 
+       /* close and cleanup on delete signal */
+       g_signal_connect(tb->widget,
+                        "destroy",
+                        G_CALLBACK(toolbar_destroy_cb),
+                        tb);
+
        /* allocate button contexts */
        for (bidx = BACK_BUTTON; bidx < PLACEHOLDER_BUTTON; bidx++) {
                res = toolbar_item_create(bidx, &tb->items[bidx]);
                if (res != NSERROR_OK) {
-                       free(tb);
                        return res;
                }
        }
 
        res = nsgtk_toolbar_update(tb);
        if (res != NSERROR_OK) {
-               free(tb);
                return res;
        }
 
@@ -3225,14 +3240,6 @@ nsgtk_toolbar_create(GtkBuilder *builder,
 
 
 /* exported interface documented in toolbar.h */
-nserror nsgtk_toolbar_destroy(struct nsgtk_toolbar *tb)
-{
-       /** \todo free buttons and destroy toolbar container (and widgets) */
-       free(tb);
-       return NSERROR_OK;
-}
-
-/* exported interface documented in toolbar.h */
 nserror nsgtk_toolbar_restyle(struct nsgtk_toolbar *tb)
 {
        /*
@@ -3283,8 +3290,6 @@ nserror nsgtk_toolbar_throbber(struct nsgtk_toolbar *tb, 
bool active)
        nserror res;
        struct browser_window *bw;
 
-       bw = tb->get_bw(tb->get_ctx);
-
        /* when activating the throbber simply schedule the next frame update */
        if (active) {
                nsgtk_schedule(THROBBER_FRAME_TIME, next_throbber_frame, tb);
@@ -3301,6 +3306,8 @@ nserror nsgtk_toolbar_throbber(struct nsgtk_toolbar *tb, 
bool active)
        res =  set_throbber_frame(tb->items[THROBBER_ITEM].button,
                                  tb->throb_frame);
 
+       bw = tb->get_bw(tb->get_ctx);
+
        /* adjust sensitivity of other items */
        set_item_sensitivity(&tb->items[STOP_BUTTON], false);
        set_item_sensitivity(&tb->items[RELOAD_BUTTON], true);
diff --git a/frontends/gtk/toolbar.h b/frontends/gtk/toolbar.h
index e895d0b..6be45b0 100644
--- a/frontends/gtk/toolbar.h
+++ b/frontends/gtk/toolbar.h
@@ -36,15 +36,6 @@ nserror nsgtk_toolbar_create(GtkBuilder *builder, struct 
browser_window *(*get_b
 
 
 /**
- * Destroy toolbar previously created
- *
- * \param toolbar A toolbar returned from a creation
- * \return NSERROR_OK on success
- */
-nserror nsgtk_toolbar_destroy(struct nsgtk_toolbar *toolbar);
-
-
-/**
  * Update the toolbar items being shown based on current settings
  *
  * \param toolbar A toolbar returned from a creation
diff --git a/frontends/gtk/window.c b/frontends/gtk/window.c
index a26c76c..f4812bd 100644
--- a/frontends/gtk/window.c
+++ b/frontends/gtk/window.c
@@ -1480,13 +1480,6 @@ struct nsgtk_scaffolding *nsgtk_get_scaffold(struct 
gui_window *g)
 
 
 /* exported interface documented in window.h */
-struct gtk_search *nsgtk_window_get_search(struct gui_window *gw)
-{
-       return gw->search;
-}
-
-
-/* exported interface documented in window.h */
 struct browser_window *nsgtk_get_browser_window(struct gui_window *g)
 {
        return g->bw;
diff --git a/frontends/gtk/window.h b/frontends/gtk/window.h
index 69b1cdc..3c807c0 100644
--- a/frontends/gtk/window.h
+++ b/frontends/gtk/window.h
@@ -102,11 +102,6 @@ GtkLayout *nsgtk_window_get_layout(struct gui_window *gw);
 
 
 /**
- * get search from window handle
- */
-struct gtk_search *nsgtk_window_get_search(struct gui_window *gw);
-
-/**
  * activate the handler for a item in a toolbar of a gui window
  *
  * \param gw The gui window handle


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

Summary of changes:
 frontends/gtk/toolbar.c |   49 +++++++++++++++++++++++++++--------------------
 frontends/gtk/toolbar.h |    9 ---------
 frontends/gtk/window.c  |    7 -------
 frontends/gtk/window.h  |    5 -----
 4 files changed, 28 insertions(+), 42 deletions(-)

diff --git a/frontends/gtk/toolbar.c b/frontends/gtk/toolbar.c
index 0d868a0..af75b89 100644
--- a/frontends/gtk/toolbar.c
+++ b/frontends/gtk/toolbar.c
@@ -1353,19 +1353,14 @@ customisation_reset_clicked_cb(GtkWidget *widget, 
gpointer data)
 
 
 /**
- * customisation container delete handler
+ * customisation container destroy handler
  */
-static gboolean
-customisation_container_delete_cb(GtkWidget *widget,
-                                 GdkEvent *event,
-                                 gpointer data)
+static void customisation_container_destroy_cb(GtkWidget *widget, gpointer 
data)
 {
        struct nsgtk_toolbar_customisation *tbc;
        tbc = (struct nsgtk_toolbar_customisation *)data;
 
        free(tbc);
-
-       return FALSE;
 }
 
 /*
@@ -1487,8 +1482,8 @@ static gboolean cutomize_button_clicked_cb(GtkWidget 
*widget, gpointer data)
 
        /* close and cleanup on delete signal */
        g_signal_connect(tbc->container,
-                        "delete-event",
-                        G_CALLBACK(customisation_container_delete_cb),
+                        "destroy",
+                        G_CALLBACK(customisation_container_destroy_cb),
                         tbc);
 
 
@@ -3175,6 +3170,22 @@ toolbar_popup_context_menu_cb(GtkToolbar *toolbar,
        return TRUE;
 }
 
+
+/**
+ * toolbar delete signal handler
+ */
+static void toolbar_destroy_cb(GtkWidget *widget, gpointer data)
+{
+       struct nsgtk_toolbar *tb;
+       tb = (struct nsgtk_toolbar *)data;
+
+       /* ensure any throbber scheduled is stopped */
+       nsgtk_schedule(-1, next_throbber_frame, tb);
+
+       free(tb);
+}
+
+
 /* exported interface documented in toolbar.h */
 nserror
 nsgtk_toolbar_create(GtkBuilder *builder,
@@ -3204,18 +3215,22 @@ nsgtk_toolbar_create(GtkBuilder *builder,
                         G_CALLBACK(toolbar_popup_context_menu_cb),
                         tb);
 
+       /* close and cleanup on delete signal */
+       g_signal_connect(tb->widget,
+                        "destroy",
+                        G_CALLBACK(toolbar_destroy_cb),
+                        tb);
+
        /* allocate button contexts */
        for (bidx = BACK_BUTTON; bidx < PLACEHOLDER_BUTTON; bidx++) {
                res = toolbar_item_create(bidx, &tb->items[bidx]);
                if (res != NSERROR_OK) {
-                       free(tb);
                        return res;
                }
        }
 
        res = nsgtk_toolbar_update(tb);
        if (res != NSERROR_OK) {
-               free(tb);
                return res;
        }
 
@@ -3225,14 +3240,6 @@ nsgtk_toolbar_create(GtkBuilder *builder,
 
 
 /* exported interface documented in toolbar.h */
-nserror nsgtk_toolbar_destroy(struct nsgtk_toolbar *tb)
-{
-       /** \todo free buttons and destroy toolbar container (and widgets) */
-       free(tb);
-       return NSERROR_OK;
-}
-
-/* exported interface documented in toolbar.h */
 nserror nsgtk_toolbar_restyle(struct nsgtk_toolbar *tb)
 {
        /*
@@ -3283,8 +3290,6 @@ nserror nsgtk_toolbar_throbber(struct nsgtk_toolbar *tb, 
bool active)
        nserror res;
        struct browser_window *bw;
 
-       bw = tb->get_bw(tb->get_ctx);
-
        /* when activating the throbber simply schedule the next frame update */
        if (active) {
                nsgtk_schedule(THROBBER_FRAME_TIME, next_throbber_frame, tb);
@@ -3301,6 +3306,8 @@ nserror nsgtk_toolbar_throbber(struct nsgtk_toolbar *tb, 
bool active)
        res =  set_throbber_frame(tb->items[THROBBER_ITEM].button,
                                  tb->throb_frame);
 
+       bw = tb->get_bw(tb->get_ctx);
+
        /* adjust sensitivity of other items */
        set_item_sensitivity(&tb->items[STOP_BUTTON], false);
        set_item_sensitivity(&tb->items[RELOAD_BUTTON], true);
diff --git a/frontends/gtk/toolbar.h b/frontends/gtk/toolbar.h
index e895d0b..6be45b0 100644
--- a/frontends/gtk/toolbar.h
+++ b/frontends/gtk/toolbar.h
@@ -36,15 +36,6 @@ nserror nsgtk_toolbar_create(GtkBuilder *builder, struct 
browser_window *(*get_b
 
 
 /**
- * Destroy toolbar previously created
- *
- * \param toolbar A toolbar returned from a creation
- * \return NSERROR_OK on success
- */
-nserror nsgtk_toolbar_destroy(struct nsgtk_toolbar *toolbar);
-
-
-/**
  * Update the toolbar items being shown based on current settings
  *
  * \param toolbar A toolbar returned from a creation
diff --git a/frontends/gtk/window.c b/frontends/gtk/window.c
index a26c76c..f4812bd 100644
--- a/frontends/gtk/window.c
+++ b/frontends/gtk/window.c
@@ -1480,13 +1480,6 @@ struct nsgtk_scaffolding *nsgtk_get_scaffold(struct 
gui_window *g)
 
 
 /* exported interface documented in window.h */
-struct gtk_search *nsgtk_window_get_search(struct gui_window *gw)
-{
-       return gw->search;
-}
-
-
-/* exported interface documented in window.h */
 struct browser_window *nsgtk_get_browser_window(struct gui_window *g)
 {
        return g->bw;
diff --git a/frontends/gtk/window.h b/frontends/gtk/window.h
index 69b1cdc..3c807c0 100644
--- a/frontends/gtk/window.h
+++ b/frontends/gtk/window.h
@@ -102,11 +102,6 @@ GtkLayout *nsgtk_window_get_layout(struct gui_window *gw);
 
 
 /**
- * get search from window handle
- */
-struct gtk_search *nsgtk_window_get_search(struct gui_window *gw);
-
-/**
  * activate the handler for a item in a toolbar of a gui window
  *
  * \param gw The gui window handle


-- 
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