summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnno Boland (Gottox) <gottox@s01.de>2009-06-06 17:48:24 +0200
committerEnno Boland (Gottox) <gottox@s01.de>2009-06-06 17:48:24 +0200
commit5df6c8d6c5ef19e3e70630ba804271666aa84e1e (patch)
tree7bb13e848665ce8653df6f16c0c2da366194f8f1
parent90289f602371acb058e1cb4140ac22d59af59e12 (diff)
downloadsurf-5df6c8d6c5ef19e3e70630ba804271666aa84e1e.tar.gz
surf-5df6c8d6c5ef19e3e70630ba804271666aa84e1e.tar.bz2
surf-5df6c8d6c5ef19e3e70630ba804271666aa84e1e.zip
typo
-rw-r--r--surf.c16
1 files changed, 10 insertions, 6 deletions
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;