logo

badwolf

Minimalist and privacy-oriented WebKitGTK+ browser
commit: 5a95d17490a7acbb41ce797e0fc294be259b5d5a
parent: c55a5d9413ccbe4c861d6d9256366ef31b7fa9d8
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Tue, 12 Mar 2019 05:48:11 +0100

badwolf.c: Use position property

Thanks to Chris for the help: https://social.libre.fi/objects/2a8d7707-97ca-4139-84e5-025a3502662b

Diffstat:

Mbadwolf.c9++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/badwolf.c b/badwolf.c @@ -433,13 +433,12 @@ void closeCb_clicked(GtkButton *close, gpointer user_data) (void)close; struct Client *browser = (struct Client *)user_data; GtkNotebook *notebook = GTK_NOTEBOOK(browser->window->notebook); - GValue *position; + GValue position = G_VALUE_INIT; + g_value_init (&position, G_TYPE_INT); - gtk_container_child_get_property(GTK_CONTAINER(notebook), browser->box, "position", position); + 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); + gtk_notebook_remove_page(notebook, g_value_get_int(&position)); free(browser); }