X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=surf.c;h=e40bfd0b5f2bdf93c53fac9e5209fa0d2b2447be;hb=d3d32fd6c754c9e4528471efe10706638a1192dd;hp=367ba1c8111491acbaa529f430be2afc4237bf7e;hpb=25b9ae3ce442f03e7667eeb54efee83fa1368524;p=surf.git diff --git a/surf.c b/surf.c index 367ba1c..e40bfd0 100644 --- a/surf.c +++ b/surf.c @@ -115,6 +115,7 @@ static void update(Client *c); static void windowobjectcleared(GtkWidget *w, WebKitWebFrame *frame, JSContextRef js, JSObjectRef win, Client *c); static void zoom(Client *c, const Arg *arg); +/* configuration, allows nested code to access above variables */ #include "config.h" void @@ -450,10 +451,10 @@ newclient(void) { gdk_window_add_filter(GTK_WIDGET(c->win)->window, processx, c); webkit_web_view_set_full_content_zoom(c->view, TRUE); settings = webkit_web_view_get_settings(c->view); - g_object_set (G_OBJECT(settings), "user-agent", "surf", NULL); + g_object_set(G_OBJECT(settings), "user-agent", "surf", NULL); filename = g_build_filename(workdir, "style.css", NULL); filename = g_strdup_printf("file://%s", filename); - g_object_set (G_OBJECT(settings), "user-stylesheet-uri", filename, NULL); + g_object_set(G_OBJECT(settings), "user-stylesheet-uri", filename, NULL); c->download = NULL; c->title = NULL; @@ -589,7 +590,6 @@ setup(void) { session = webkit_get_default_session(); urlprop = XInternAtom(dpy, "_SURF_URL", False); - /* create dirs and files */ home = g_get_home_dir(); workdir = g_strdup(g_build_filename(home, ".surf", NULL)); @@ -603,7 +603,6 @@ setup(void) { if((tmp = g_fopen(name, "a"))); fclose(tmp); - /* cookie persistance */ s = webkit_get_default_session(); name = g_build_filename(workdir, "cookies.txt", NULL);