From 19aaa5a74b16fd6fafbfaf6081e4f89491f0f344 Mon Sep 17 00:00:00 2001 From: "Enno Boland (tox)" Date: Wed, 24 Mar 2010 22:04:36 +0100 Subject: [PATCH 01/16] gotheaders will now be called correctly. --- surf.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/surf.c b/surf.c index b3b4f91..37135d8 100644 --- a/surf.c +++ b/surf.c @@ -353,6 +353,8 @@ gboolean initdownload(WebKitWebView *view, WebKitDownload *o, Client *c) { const char *filename; char *uri, *html; + WebKitWebBackForwardList *h; + WebKitWebHistoryItem *i; stop(c, NULL); c->download = o; @@ -366,6 +368,9 @@ initdownload(WebKitWebView *view, WebKitDownload *o, Client *c) { html = g_strdup_printf("Download %s...", filename); webkit_web_view_load_html_string(c->view, html, webkit_download_get_uri(c->download)); + h = webkit_web_view_get_back_forward_list(c->view); + i = webkit_web_history_item_new_with_data(webkit_download_get_uri(c->download), filename); + webkit_web_back_forward_list_add_item(h, i); g_signal_connect(c->download, "notify::progress", G_CALLBACK(updatedownload), c); g_signal_connect(c->download, "notify::status", G_CALLBACK(updatedownload), c); webkit_download_start(c->download); @@ -587,6 +592,7 @@ newrequest(SoupSession *s, SoupMessage *msg, gpointer v) { if((c = getcookies(uri))) { soup_message_headers_append(h, "Cookie", c); } + g_signal_connect_after(G_OBJECT(msg), "got-headers", G_CALLBACK(gotheaders), NULL); } void @@ -739,7 +745,6 @@ setup(void) { soup_session_remove_feature_by_type(s, soup_cookie_get_type()); soup_session_remove_feature_by_type(s, soup_cookie_jar_get_type()); g_signal_connect_after(G_OBJECT(s), "request-started", G_CALLBACK(newrequest), NULL); - g_signal_connect_after(G_OBJECT(s), "got-headers", G_CALLBACK(gotheaders), NULL); /* proxy */ -- 2.20.1 From 3ede1035565e387fb56f98b10e6f4026557af099 Mon Sep 17 00:00:00 2001 From: "Enno Boland (tox)" Date: Wed, 24 Mar 2010 23:18:03 +0100 Subject: [PATCH 02/16] fixing downloads --- surf.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/surf.c b/surf.c index 37135d8..5a7f72b 100644 --- a/surf.c +++ b/surf.c @@ -263,6 +263,7 @@ download(Client *c, const Arg *arg) { r = webkit_network_request_new(uri); dl = webkit_download_new(r); initdownload(c->view, dl, c); + webkit_download_start(c->download); } void @@ -352,11 +353,10 @@ gotheaders(SoupMessage *msg, gpointer v) { gboolean initdownload(WebKitWebView *view, WebKitDownload *o, Client *c) { const char *filename; - char *uri, *html; + char *uri; WebKitWebBackForwardList *h; WebKitWebHistoryItem *i; - stop(c, NULL); c->download = o; filename = webkit_download_get_suggested_filename(o); if(!strcmp("", filename)) @@ -364,20 +364,14 @@ initdownload(WebKitWebView *view, WebKitDownload *o, Client *c) { uri = g_strconcat("file://", dldir, "/", filename, NULL); webkit_download_set_destination_uri(c->download, uri); c->progress = 0; - g_free(uri); - html = g_strdup_printf("Download %s...", filename); - webkit_web_view_load_html_string(c->view, html, - webkit_download_get_uri(c->download)); h = webkit_web_view_get_back_forward_list(c->view); i = webkit_web_history_item_new_with_data(webkit_download_get_uri(c->download), filename); webkit_web_back_forward_list_add_item(h, i); g_signal_connect(c->download, "notify::progress", G_CALLBACK(updatedownload), c); g_signal_connect(c->download, "notify::status", G_CALLBACK(updatedownload), c); - webkit_download_start(c->download); c->title = copystr(&c->title, filename); update(c); - g_free(html); return TRUE; } @@ -422,6 +416,8 @@ linkhover(WebKitWebView *v, const char* t, const char* l, Client *c) { void loadstatuschange(WebKitWebView *view, GParamSpec *pspec, Client *c) { + if(c->download) + stop(c, NULL); switch(webkit_web_view_get_load_status (c->view)) { case WEBKIT_LOAD_COMMITTED: setatom(c, uriprop, geturi(c)); @@ -827,6 +823,8 @@ updatedownload(WebKitDownload *o, GParamSpec *pspec, Client *c) { if(status == WEBKIT_DOWNLOAD_STATUS_STARTED || status == WEBKIT_DOWNLOAD_STATUS_CREATED) { c->progress = (gint)(webkit_download_get_progress(c->download)*100); } + else + stop(c, NULL); update(c); } -- 2.20.1 From 62dc599a048a773265e094c3da420d0dc91a11e9 Mon Sep 17 00:00:00 2001 From: "Enno Boland (tox)" Date: Wed, 24 Mar 2010 23:55:41 +0100 Subject: [PATCH 03/16] fixing argument parsing. --- surf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/surf.c b/surf.c index 5a7f72b..aa29780 100644 --- a/surf.c +++ b/surf.c @@ -900,6 +900,8 @@ main(int argc, char *argv[]) { break; case 'v': die("surf-"VERSION", © 2009 surf engineers, see LICENSE for details\n"); + default: + usage(); } } if(i < argc) -- 2.20.1 From a05bcc653e3ee1ae856b3073707ffb5aec13940e Mon Sep 17 00:00:00 2001 From: "Enno Boland (tox)" Date: Thu, 25 Mar 2010 00:05:37 +0100 Subject: [PATCH 04/16] updating manpage, reformating help output. --- surf.1 | 20 +++++++++++++++----- surf.c | 8 ++++---- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/surf.1 b/surf.1 index 11c1292..f66913b 100644 --- a/surf.1 +++ b/surf.1 @@ -3,8 +3,12 @@ surf \- simple webkit-based browser .SH SYNOPSIS .B surf -.RB [ \-hvx ] -.RB [ \-e xid ] +.RB [-e\ xid] +.RB [-i] +.RB [-p] +.RB [-s] +.RB [-v] +.RB [-x] .RB "URI" .SH DESCRIPTION surf is a simple Web browser based on WebKit/GTK+. It is able @@ -14,10 +18,16 @@ one can point surf to another URI by setting its XProperties. .SH OPTIONS .TP .B \-e xid -reparents to window specified by xid. +Reparents to window specified by xid. .TP -.B \-h -Prints usage information to standard output, then exits. +.B \-i +Disable Images +.TP +.B \-p +Disable Plugins +.TP +.B \-s +Disable Javascript .TP .B \-v Prints version information to standard output, then exits. diff --git a/surf.c b/surf.c index aa29780..a046a5a 100644 --- a/surf.c +++ b/surf.c @@ -837,7 +837,7 @@ updatewinid(Client *c) { void usage(void) { fputs("surf - simple browser\n", stderr); - die("usage: surf [-e Window] [-x] [-i] [-p] [-s] [uri]\n"); + die("usage: surf [-e xid] [-i] [-p] [-s] [-v] [-x] [uri]\n"); } void @@ -880,9 +880,6 @@ main(int argc, char *argv[]) { break; } switch(argv[i][1]) { - case 'x': - showxid = TRUE; - break; case 'e': if(++i < argc) embed = atoi(argv[i]); @@ -898,6 +895,9 @@ main(int argc, char *argv[]) { case 's': script = 0; break; + case 'x': + showxid = TRUE; + break; case 'v': die("surf-"VERSION", © 2009 surf engineers, see LICENSE for details\n"); default: -- 2.20.1 From a7f2765da47529142d61c369f0cea6a68db4ed20 Mon Sep 17 00:00:00 2001 From: "Enno Boland (tox)" Date: Thu, 25 Mar 2010 09:59:30 +0100 Subject: [PATCH 05/16] reimplementing cookies. Now we need some file locking. --- surf.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/surf.c b/surf.c index a046a5a..0ed831c 100644 --- a/surf.c +++ b/surf.c @@ -306,7 +306,11 @@ find(Client *c, const Arg *arg) { const char * getcookies(SoupURI *uri) { - return NULL; + const char *c; + SoupCookieJar *j = soup_cookie_jar_text_new(cookiefile, TRUE); + c = soup_cookie_jar_get_cookies(j, uri, TRUE); + g_object_unref(j); + return c; } const char * @@ -700,7 +704,15 @@ scroll(Client *c, const Arg *arg) { void setcookie(SoupCookie *c) { - + SoupDate *e; + SoupCookieJar *j = soup_cookie_jar_text_new(cookiefile, FALSE); + c = soup_cookie_copy(c); + if(c && c->expires == NULL) { + e = soup_date_new_from_time_t(time(NULL) + sessiontime); + soup_cookie_set_expires(c, e); + } + soup_cookie_jar_add_cookie(j, c); + g_object_unref(j); } void -- 2.20.1 From 981e52d5a755f7a30fc59595ab84f9df05a84f01 Mon Sep 17 00:00:00 2001 From: "Enno Boland (tox)" Date: Fri, 26 Mar 2010 21:44:48 +0100 Subject: [PATCH 06/16] typofix. --- config.mk | 6 +++--- surf.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config.mk b/config.mk index a5f0b6d..ff7f604 100644 --- a/config.mk +++ b/config.mk @@ -7,8 +7,8 @@ VERSION = 0.4 PREFIX = /usr/local MANPREFIX = ${PREFIX}/share/man -GTKINC=$(shell pkg-config --cflags gtk+-2.0 webkit-1.0) -GTKLIB=$(shell pkg-config --libs gtk+-2.0 webkit-1.0) +GTKINC=$(shell pkg-config --static --cflags gtk+-2.0 webkit-1.0) +GTKLIB=$(shell pkg-config --static --libs gtk+-2.0 webkit-1.0) # includes and libs @@ -18,7 +18,7 @@ LIBS = -L/usr/lib -lc ${GTKLIB} -lgthread-2.0 # flags CPPFLAGS = -DVERSION=\"${VERSION}\" CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS} -LDFLAGS = -g ${LIBS} +LDFLAGS = -g ${LIBS} -static # Solaris #CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\" diff --git a/surf.c b/surf.c index 0ed831c..cac31d6 100644 --- a/surf.c +++ b/surf.c @@ -613,7 +613,7 @@ newwindow(Client *c, const Arg *arg) { if(!plugin) cmd[i++] = "-p"; if(!loadimage) - cmd[i++] = "-l"; + cmd[i++] = "-i"; if(showxid) cmd[i++] = "-x"; cmd[i++] = "--"; @@ -707,7 +707,7 @@ setcookie(SoupCookie *c) { SoupDate *e; SoupCookieJar *j = soup_cookie_jar_text_new(cookiefile, FALSE); c = soup_cookie_copy(c); - if(c && c->expires == NULL) { + if(c->expires == NULL) { e = soup_date_new_from_time_t(time(NULL) + sessiontime); soup_cookie_set_expires(c, e); } -- 2.20.1 From 8aabfa5b4591b020173441a7a6df631ba3ecae3f Mon Sep 17 00:00:00 2001 From: "Enno Boland (tox)" Date: Mon, 29 Mar 2010 17:49:34 +0200 Subject: [PATCH 07/16] whoops... linking Oo --- config.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config.mk b/config.mk index ff7f604..a5f0b6d 100644 --- a/config.mk +++ b/config.mk @@ -7,8 +7,8 @@ VERSION = 0.4 PREFIX = /usr/local MANPREFIX = ${PREFIX}/share/man -GTKINC=$(shell pkg-config --static --cflags gtk+-2.0 webkit-1.0) -GTKLIB=$(shell pkg-config --static --libs gtk+-2.0 webkit-1.0) +GTKINC=$(shell pkg-config --cflags gtk+-2.0 webkit-1.0) +GTKLIB=$(shell pkg-config --libs gtk+-2.0 webkit-1.0) # includes and libs @@ -18,7 +18,7 @@ LIBS = -L/usr/lib -lc ${GTKLIB} -lgthread-2.0 # flags CPPFLAGS = -DVERSION=\"${VERSION}\" CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS} -LDFLAGS = -g ${LIBS} -static +LDFLAGS = -g ${LIBS} # Solaris #CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\" -- 2.20.1 From 4b1b1b8a2070793e7f6467f2005d6fbd1ae63065 Mon Sep 17 00:00:00 2001 From: pancake Date: Thu, 8 Apr 2010 20:28:32 +0200 Subject: [PATCH 08/16] remove empty lines --- surf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/surf.c b/surf.c index cac31d6..b96ecf3 100644 --- a/surf.c +++ b/surf.c @@ -589,9 +589,8 @@ newrequest(SoupSession *s, SoupMessage *msg, gpointer v) { soup_message_headers_remove(h, "Cookie"); uri = soup_message_get_uri(msg); - if((c = getcookies(uri))) { + if((c = getcookies(uri))) soup_message_headers_append(h, "Cookie", c); - } g_signal_connect_after(G_OBJECT(msg), "got-headers", G_CALLBACK(gotheaders), NULL); } @@ -754,7 +753,6 @@ setup(void) { soup_session_remove_feature_by_type(s, soup_cookie_jar_get_type()); g_signal_connect_after(G_OBJECT(s), "request-started", G_CALLBACK(newrequest), NULL); - /* proxy */ if((proxy = getenv("http_proxy")) && strcmp(proxy, "")) { new_proxy = g_strrstr(proxy, "http://") ? g_strdup(proxy) : -- 2.20.1 From e9c9715f52afd3b4e3d512aea9d021e7e1980f63 Mon Sep 17 00:00:00 2001 From: "Enno Boland (tox)" Date: Sun, 2 May 2010 10:59:28 +0200 Subject: [PATCH 09/16] Adding small fix by Alex Puterbaugh. Thanks. --- config.mk | 2 +- surf.c | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/config.mk b/config.mk index a5f0b6d..c40df0b 100644 --- a/config.mk +++ b/config.mk @@ -17,7 +17,7 @@ LIBS = -L/usr/lib -lc ${GTKLIB} -lgthread-2.0 # flags CPPFLAGS = -DVERSION=\"${VERSION}\" -CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS} +CFLAGS = -std=c99 -pedantic -Wall -O0 -g ${INCS} ${CPPFLAGS} LDFLAGS = -g ${LIBS} # Solaris diff --git a/surf.c b/surf.c index b96ecf3..448c762 100644 --- a/surf.c +++ b/surf.c @@ -254,7 +254,7 @@ void download(Client *c, const Arg *arg) { char *uri; WebKitNetworkRequest *r; - WebKitDownload *dl; + WebKitDownload *dl; if(arg->v) uri = (char *)arg->v; @@ -420,18 +420,17 @@ linkhover(WebKitWebView *v, const char* t, const char* l, Client *c) { void loadstatuschange(WebKitWebView *view, GParamSpec *pspec, Client *c) { - if(c->download) - stop(c, NULL); switch(webkit_web_view_get_load_status (c->view)) { case WEBKIT_LOAD_COMMITTED: - setatom(c, uriprop, geturi(c)); + if(c->download) + stop(c, NULL); + setatom(c, uriprop, geturi(c)); break; case WEBKIT_LOAD_FINISHED: c->progress = 0; update(c); break; - case WEBKIT_LOAD_PROVISIONAL: - case WEBKIT_LOAD_FIRST_VISUALLY_NON_EMPTY_LAYOUT: + default: break; } } -- 2.20.1 From f9a411f22d413f01aecd553c3d5bc22a3e1e196e Mon Sep 17 00:00:00 2001 From: "Enno Boland (tox)" Date: Thu, 6 May 2010 13:06:50 +0200 Subject: [PATCH 10/16] fixing config.mk --- config.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.mk b/config.mk index ff7f604..47f427b 100644 --- a/config.mk +++ b/config.mk @@ -18,7 +18,7 @@ LIBS = -L/usr/lib -lc ${GTKLIB} -lgthread-2.0 # flags CPPFLAGS = -DVERSION=\"${VERSION}\" CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS} -LDFLAGS = -g ${LIBS} -static +LDFLAGS = -g ${LIBS} # Solaris #CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\" -- 2.20.1 From bef892f513db0e4c30ce16d7431f6773a44c1546 Mon Sep 17 00:00:00 2001 From: "Enno Boland (tox)" Date: Thu, 6 May 2010 13:09:54 +0200 Subject: [PATCH 11/16] fixing compilerwarning in newer webkit versions --- surf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/surf.c b/surf.c index cac31d6..6e3db36 100644 --- a/surf.c +++ b/surf.c @@ -430,8 +430,7 @@ loadstatuschange(WebKitWebView *view, GParamSpec *pspec, Client *c) { c->progress = 0; update(c); break; - case WEBKIT_LOAD_PROVISIONAL: - case WEBKIT_LOAD_FIRST_VISUALLY_NON_EMPTY_LAYOUT: + default: break; } } -- 2.20.1 From 602eb616231b4606ca09dc2f98b1c3d22b8538d5 Mon Sep 17 00:00:00 2001 From: "Enno Boland (tox)" Date: Thu, 6 May 2010 13:58:49 +0200 Subject: [PATCH 12/16] implementing naive file locking. --- surf.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/surf.c b/surf.c index 6e3db36..01b6fb1 100644 --- a/surf.c +++ b/surf.c @@ -18,6 +18,7 @@ #include #include #include +#include #define LENGTH(x) (sizeof x / sizeof x[0]) #define CLEANMASK(mask) (mask & ~(GDK_MOD2_MASK)) @@ -703,6 +704,10 @@ scroll(Client *c, const Arg *arg) { void setcookie(SoupCookie *c) { + int lock; + + lock = open(cookiefile, 0); + flock(lock, LOCK_EX); SoupDate *e; SoupCookieJar *j = soup_cookie_jar_text_new(cookiefile, FALSE); c = soup_cookie_copy(c); @@ -712,6 +717,8 @@ setcookie(SoupCookie *c) { } soup_cookie_jar_add_cookie(j, c); g_object_unref(j); + flock(lock, LOCK_UN); + close(lock); } void -- 2.20.1 From 11039e5e2b8cef231f49bef1175c4d4d94ee6ba3 Mon Sep 17 00:00:00 2001 From: pancake Date: Sat, 8 May 2010 21:43:53 +0200 Subject: [PATCH 13/16] Do not set cookie session time if set to 0 Add NOBACKGROUND config.def.h option - requires body {background-color} in style.css - fixes white background when loading pages --- config.def.h | 3 ++- surf.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/config.def.h b/config.def.h index 6c143ae..1110acc 100644 --- a/config.def.h +++ b/config.def.h @@ -6,7 +6,8 @@ static char *stylefile = ".surf/style.css"; static char *scriptfile = ".surf/script.js"; static char *cookiefile = ".surf/cookies.txt"; static char *dldir = ".surf/dl/"; -static time_t sessiontime = 3600; +static time_t sessiontime = 0; +#define NOBACKGROUND 0 #define SETPROP(p) { .v = (char *[]){ "/bin/sh", "-c", \ "prop=\"`xprop -id $1 $0 | cut -d '\"' -f 2 | dmenu`\" &&" \ diff --git a/surf.c b/surf.c index 448c762..652889b 100644 --- a/surf.c +++ b/surf.c @@ -567,6 +567,8 @@ newclient(void) { g_free(uri); setatom(c, findprop, ""); setatom(c, uriprop, ""); + if(!NOBACKGROUND) + webkit_web_view_set_transparent(c->view, TRUE); c->download = NULL; c->title = NULL; @@ -705,7 +707,7 @@ setcookie(SoupCookie *c) { SoupDate *e; SoupCookieJar *j = soup_cookie_jar_text_new(cookiefile, FALSE); c = soup_cookie_copy(c); - if(c->expires == NULL) { + if(c->expires == NULL && sessiontime) { e = soup_date_new_from_time_t(time(NULL) + sessiontime); soup_cookie_set_expires(c, e); } -- 2.20.1 From 168da3730fcaabf56f9cb7508cbff1699e5b33b1 Mon Sep 17 00:00:00 2001 From: "Enno Boland (tox)" Date: Sun, 9 May 2010 19:37:46 +0200 Subject: [PATCH 14/16] added js-fix by Troels Henriksen. Thanks :) --- surf.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/surf.c b/surf.c index 01b6fb1..3ac7665 100644 --- a/surf.c +++ b/surf.c @@ -150,6 +150,19 @@ cleanup(void) { g_free(stylefile); } +void +runscript(WebKitWebFrame *frame, JSContextRef js) { + JSStringRef jsscript; + char *script; + JSValueRef exception = NULL; + GError *error; + + if(g_file_get_contents(scriptfile, &script, NULL, &error)) { + jsscript = JSStringCreateWithUTF8CString(script); + JSEvaluateScript(js, jsscript, JSContextGetGlobalObject(js), NULL, 0, &exception); + } +} + void clipboard(Client *c, const Arg *arg) { gboolean paste = *(gboolean *)arg; @@ -470,6 +483,7 @@ newclient(void) { int i; Client *c; WebKitWebSettings *settings; + WebKitWebFrame *frame; GdkGeometry hints = { 1, 1 }; char *uri, *ua; @@ -556,6 +570,8 @@ newclient(void) { gdk_window_set_events(GTK_WIDGET(c->win)->window, GDK_ALL_EVENTS_MASK); gdk_window_add_filter(GTK_WIDGET(c->win)->window, processx, c); webkit_web_view_set_full_content_zoom(c->view, TRUE); + frame = webkit_web_view_get_main_frame(c->view); + runscript(frame, webkit_web_frame_get_global_context(frame)); settings = webkit_web_view_get_settings(c->view); if(!(ua = getenv("SURF_USERAGENT"))) ua = useragent; @@ -860,15 +876,7 @@ usage(void) { void windowobjectcleared(GtkWidget *w, WebKitWebFrame *frame, JSContextRef js, JSObjectRef win, Client *c) { - JSStringRef jsscript; - char *script; - JSValueRef exception = NULL; - GError *error; - - if(g_file_get_contents(scriptfile, &script, NULL, &error)) { - jsscript = JSStringCreateWithUTF8CString(script); - JSEvaluateScript(js, jsscript, JSContextGetGlobalObject(js), NULL, 0, &exception); - } + runscript(frame, js); } void -- 2.20.1 From 8acc31bbde28b79be906269c0dbcc59974bbb800 Mon Sep 17 00:00:00 2001 From: "Enno Boland (tox)" Date: Sun, 9 May 2010 22:46:22 +0200 Subject: [PATCH 15/16] changing default value of NOBACKGROUND --- config.def.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.def.h b/config.def.h index 1110acc..4792570 100644 --- a/config.def.h +++ b/config.def.h @@ -7,7 +7,7 @@ static char *scriptfile = ".surf/script.js"; static char *cookiefile = ".surf/cookies.txt"; static char *dldir = ".surf/dl/"; static time_t sessiontime = 0; -#define NOBACKGROUND 0 +#define NOBACKGROUND 1 #define SETPROP(p) { .v = (char *[]){ "/bin/sh", "-c", \ "prop=\"`xprop -id $1 $0 | cut -d '\"' -f 2 | dmenu`\" &&" \ -- 2.20.1 From 424936e96c375bbfc0c624ea213112520c71534f Mon Sep 17 00:00:00 2001 From: pancake Date: Sun, 9 May 2010 22:51:26 +0200 Subject: [PATCH 16/16] Fix NOBACKGROUND meaning --- config.def.h | 2 +- surf.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config.def.h b/config.def.h index 4792570..1110acc 100644 --- a/config.def.h +++ b/config.def.h @@ -7,7 +7,7 @@ static char *scriptfile = ".surf/script.js"; static char *cookiefile = ".surf/cookies.txt"; static char *dldir = ".surf/dl/"; static time_t sessiontime = 0; -#define NOBACKGROUND 1 +#define NOBACKGROUND 0 #define SETPROP(p) { .v = (char *[]){ "/bin/sh", "-c", \ "prop=\"`xprop -id $1 $0 | cut -d '\"' -f 2 | dmenu`\" &&" \ diff --git a/surf.c b/surf.c index 09cf840..eabaf17 100644 --- a/surf.c +++ b/surf.c @@ -584,7 +584,7 @@ newclient(void) { g_free(uri); setatom(c, findprop, ""); setatom(c, uriprop, ""); - if(!NOBACKGROUND) + if(NOBACKGROUND) webkit_web_view_set_transparent(c->view, TRUE); c->download = NULL; -- 2.20.1