logo

badwolf

Minimalist and privacy-oriented WebKitGTK+ browser
commit: e1d8015f772e81538e7dcc9a839e5e3fef1582ca
parent: da6a593ea5bc329b6d1a91c6b388acaccd5964b0
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Mon, 11 Mar 2019 03:52:51 +0100

WIP: Attempt with container property

Diffstat:

Mbadwolf.c12+++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/badwolf.c b/badwolf.c @@ -371,12 +371,14 @@ void closeCb_clicked(GtkButton *close, gpointer user_data) (void)close; struct Client *browser = (struct Client *)user_data; GtkNotebook *notebook = GTK_NOTEBOOK(browser->window->notebook); - gint current_page = gtk_notebook_get_current_page(notebook); + GValue *position; - if(current_page > 0){ - gtk_notebook_remove_page(notebook, current_page); - free(browser); - } + gtk_container_child_get_property(GTK_CONTAINER(notebook), browser->box, "position", position); + + gint *page_pos = (gint *)g_value_peek_pointer(position); + + gtk_notebook_remove_page(notebook, *page_pos); + free(browser); } int main(int argc, char *argv[])