summaryrefslogtreecommitdiff
path: root/surf.c
diff options
context:
space:
mode:
authorQuentin Rameau <quinq@fifth.space>2017-05-21 22:53:56 +0200
committerQuentin Rameau <quinq@fifth.space>2017-05-30 10:33:36 +0200
commita0c3c80ee6e48c57e541cfbcaeb1fb0e66121985 (patch)
tree463228a267eec773a731bc912b603610890f13f5 /surf.c
parenta8bf2068276e27dcbd2919cb72d926b9f4f3882e (diff)
downloadsurf-a0c3c80ee6e48c57e541cfbcaeb1fb0e66121985.tar.gz
surf-a0c3c80ee6e48c57e541cfbcaeb1fb0e66121985.tar.bz2
surf-a0c3c80ee6e48c57e541cfbcaeb1fb0e66121985.zip
Store modified parameters list
Diffstat (limited to 'surf.c')
-rw-r--r--surf.c29
1 files changed, 11 insertions, 18 deletions
diff --git a/surf.c b/surf.c
index 61448fb..0f8b9c9 100644
--- a/surf.c
+++ b/surf.c
@@ -241,6 +241,7 @@ static GdkDevice *gdkkb;
static char *stylefile;
static const char *useragent;
static Parameter *curconfig;
+static int modparams[ParameterLast];
char *argv0;
static ParamName loadtransient[] = {
@@ -673,41 +674,31 @@ cookiepolicy_set(const WebKitCookieAcceptPolicy p)
void
seturiparameters(Client *c, const char *uri, ParamName *params)
{
- Parameter *config, *newconfig = NULL;
+ Parameter *config, *uriconfig = NULL;
int i, p;
for (i = 0; i < LENGTH(uriparams); ++i) {
if (uriparams[i].uri &&
!regexec(&(uriparams[i].re), uri, 0, NULL, 0)) {
- newconfig = uriparams[i].config;
+ uriconfig = uriparams[i].config;
break;
}
}
- if (!newconfig)
- newconfig = defconfig;
+ curconfig = uriconfig ? uriconfig : defconfig;
for (i = 0; (p = params[i]) != ParameterLast; ++i) {
switch(p) {
+ default: /* FALLTHROUGH */
+ if (!(defconfig[p].prio < curconfig[p].prio ||
+ defconfig[p].prio < modparams[p]))
+ continue;
case Certificate:
case CookiePolicies:
case Style:
- config = (newconfig[p].prio > defconfig[p].prio) ?
- newconfig : defconfig;
- break;
- default:
- if (newconfig[p].prio > defconfig[p].prio)
- config = newconfig;
- else if (curconfig[p].prio > defconfig[p].prio)
- config = defconfig;
- else
- continue;
+ setparameter(c, 0, p, &curconfig[p].val);
}
-
- setparameter(c, 0, p, &config[p].val);
}
-
- curconfig = newconfig;
}
void
@@ -716,6 +707,8 @@ setparameter(Client *c, int refresh, ParamName p, const Arg *a)
GdkRGBA bgcolor = { 0 };
WebKitSettings *s = webkit_web_view_get_settings(c->view);
+ modparams[p] = curconfig[p].prio;
+
switch (p) {
case AcceleratedCanvas:
webkit_settings_set_enable_accelerated_2d_canvas(s, a->i);