From: Enno Boland (Gottox) Date: Sat, 6 Jun 2009 15:48:24 +0000 (+0200) Subject: typo X-Git-Url: https://git.danieliu.xyz/?a=commitdiff_plain;h=5df6c8d6c5ef19e3e70630ba804271666aa84e1e;p=surf.git typo --- diff --git a/surf.c b/surf.c index bc4aea1..42b250a 100644 --- a/surf.c +++ b/surf.c @@ -159,7 +159,6 @@ loadcommit(WebKitWebView *view, WebKitWebFrame *f, gpointer d) { XChangeProperty(dpy, GDK_WINDOW_XID(GTK_WIDGET(c->win)->window), urlprop, XA_STRING, 8, PropModeReplace, (unsigned char *)uri, strlen(uri) + 1); - gtk_entry_set_text(GTK_ENTRY(c->urlbar), uri); } void @@ -201,25 +200,27 @@ void destroyclient(Client *c) { Client *p; - gtk_widget_destroy(c->win); + gtk_widget_destroy(GTK_WIDGET(webkit_web_view_new())); gtk_widget_destroy(c->scroll); - gtk_widget_destroy(c->vbox); gtk_widget_destroy(c->urlbar); -/* gtk_widget_destroy(c->urllist);*/ + gtk_widget_destroy(c->urllist); gtk_widget_destroy(c->searchbar); - if(clients == c && c->next == NULL) - gtk_main_quit(); + gtk_widget_destroy(c->vbox); + gtk_widget_destroy(c->win); for(p = clients; p && p->next != c; p = p->next); if(p) p->next = c->next; else clients = c->next; free(c); + if(clients == NULL) + gtk_main_quit(); } gboolean keypress(GtkWidget* w, GdkEventKey *ev, gpointer d) { Client *c = (Client *)d; + gchar *uri; if(ev->type != GDK_KEY_PRESS) return FALSE; @@ -236,6 +237,9 @@ keypress(GtkWidget* w, GdkEventKey *ev, gpointer d) { return TRUE; case GDK_g: gtk_widget_hide(c->searchbar); + if(!(uri = (gchar *)webkit_web_view_get_uri(c->view))) + uri = "(null)"; + gtk_entry_set_text(GTK_ENTRY(c->urlbar), uri); gtk_widget_show(c->urlbar); gtk_widget_grab_focus(c->urlbar); return TRUE;