[hackers] [surf] Adding nibbles patch || Enno Boland (tox)

From: <hg_AT_suckless.org>
Date: Thu, 9 Sep 2010 09:27:41 +0000 (UTC)

changeset: 223:7a931a352cf9
tag: tip
user: Enno Boland (tox) <tox_AT_s01.de>
date: Thu Sep 09 11:15:02 2010 +0200
files: surf.c
description:
Adding nibbles patch

diff -r 7f1bbc29ba9a -r 7a931a352cf9 surf.c
--- a/surf.c Thu Sep 02 14:02:12 2010 +0200
+++ b/surf.c Thu Sep 09 11:15:02 2010 +0200
@@ -87,7 +87,7 @@
 static void loadstatuschange(WebKitWebView *view, GParamSpec *pspec, Client *c);
 static void loaduri(Client *c, const Arg *arg);
 static void navigate(Client *c, const Arg *arg);
-static Client *newclient(gboolean view);
+static Client *newclient(void);
 static void newwindow(Client *c, const Arg *arg);
 static void newrequest(SoupSession *s, SoupMessage *msg, gpointer v);
 static void pasteuri(GtkClipboard *clipboard, const char *text, gpointer d);
@@ -181,7 +181,7 @@
 
 WebKitWebView *
 createwindow(WebKitWebView *v, WebKitWebFrame *f, Client *c) {
- Client *n = newclient(TRUE);
+ Client *n = newclient();
         return n->view;
 }
 
@@ -211,6 +211,7 @@
 destroyclient(Client *c) {
         Client *p;
 
+ webkit_web_view_stop_loading(c->view);
         gtk_widget_destroy(c->indicator);
         gtk_widget_destroy(GTK_WIDGET(c->view));
         gtk_widget_destroy(c->scroll);
@@ -410,7 +411,7 @@
 }
 
 Client *
-newclient(gboolean newview) {
+newclient(void) {
         Client *c;
         WebKitWebSettings *settings;
         WebKitWebFrame *frame;
@@ -454,18 +455,15 @@
 
         /* Webview */
         c->view = WEBKIT_WEB_VIEW(webkit_web_view_new());
- /* The widget to which the widget is added will handle the signals. */
- if (!newview){
- g_signal_connect(G_OBJECT(c->view), "title-changed", G_CALLBACK(titlechange), c);
- g_signal_connect(G_OBJECT(c->view), "hovering-over-link", G_CALLBACK(linkhover), c);
- g_signal_connect(G_OBJECT(c->view), "create-web-view", G_CALLBACK(createwindow), c);
- g_signal_connect(G_OBJECT(c->view), "new-window-policy-decision-requested", G_CALLBACK(decidewindow), c);
- g_signal_connect(G_OBJECT(c->view), "mime-type-policy-decision-requested", G_CALLBACK(decidedownload), c);
- g_signal_connect(G_OBJECT(c->view), "window-object-cleared", G_CALLBACK(windowobjectcleared), c);
- g_signal_connect(G_OBJECT(c->view), "notify::load-status", G_CALLBACK(loadstatuschange), c);
- g_signal_connect(G_OBJECT(c->view), "notify::progress", G_CALLBACK(progresschange), c);
- g_signal_connect(G_OBJECT(c->view), "download-requested", G_CALLBACK(initdownload), c);
- }
+ g_signal_connect(G_OBJECT(c->view), "title-changed", G_CALLBACK(titlechange), c);
+ g_signal_connect(G_OBJECT(c->view), "hovering-over-link", G_CALLBACK(linkhover), c);
+ g_signal_connect(G_OBJECT(c->view), "create-web-view", G_CALLBACK(createwindow), c);
+ g_signal_connect(G_OBJECT(c->view), "new-window-policy-decision-requested", G_CALLBACK(decidewindow), c);
+ g_signal_connect(G_OBJECT(c->view), "mime-type-policy-decision-requested", G_CALLBACK(decidedownload), c);
+ g_signal_connect(G_OBJECT(c->view), "window-object-cleared", G_CALLBACK(windowobjectcleared), c);
+ g_signal_connect(G_OBJECT(c->view), "notify::load-status", G_CALLBACK(loadstatuschange), c);
+ g_signal_connect(G_OBJECT(c->view), "notify::progress", G_CALLBACK(progresschange), c);
+ g_signal_connect(G_OBJECT(c->view), "download-requested", G_CALLBACK(initdownload), c);
 
         /* Indicator */
         c->indicator = gtk_drawing_area_new();
@@ -839,7 +837,7 @@
         if(i < argc)
                 arg.v = argv[i];
         setup();
- newclient(FALSE);
+ newclient();
         if(arg.v)
                 loaduri(clients, &arg);
         gtk_main();
Received on Thu Sep 09 2010 - 11:27:41 CEST

This archive was generated by hypermail 2.2.0 : Thu Sep 09 2010 - 11:36:05 CEST