static void decidenavigation(WebKitPolicyDecision *d, Client *c);
static void decidenewwindow(WebKitPolicyDecision *d, Client *c);
static void decideresource(WebKitPolicyDecision *d, Client *c);
+static void closeview(WebKitWebView *v, Client *c);
static void destroyclient(Client *c);
static void destroywin(GtkWidget* w, Client *c);
static void die(const char *errstr, ...);
Client *p;
webkit_web_view_stop_loading(c->view);
- gtk_widget_destroy(GTK_WIDGET(c->view));
- gtk_widget_destroy(c->scroll);
- gtk_widget_destroy(c->vbox);
+ /* Not needed, has already been called
gtk_widget_destroy(c->win);
+ */
for (p = clients; p && p->next != c; p = p->next)
;
else
clients = c->next;
free(c);
- if (clients == NULL)
- gtk_main_quit();
+}
+
+void
+closeview(WebKitWebView *v, Client *c)
+{
+ gtk_widget_destroy(c->win);
}
void
destroywin(GtkWidget* w, Client *c)
{
destroyclient(c);
+ if (clients == NULL)
+ gtk_main_quit();
}
void
g_signal_connect(G_OBJECT(v),
"button-release-event",
G_CALLBACK(buttonreleased), c);
+ g_signal_connect(G_OBJECT(v), "close",
+ G_CALLBACK(closeview), c);
return v;
}