summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Rameau <quinq@fifth.space>2015-11-22 15:31:15 +0100
committerQuentin Rameau <quinq@fifth.space>2015-11-22 15:31:15 +0100
commitd0020bad4fc40f3a84e828936c2588232bb687bf (patch)
tree9fd25420886c197f2788adf05fb46728495f03e3
parentc3a827d621fbedfb974db9d137d3e5bea66490b4 (diff)
downloadsurf-d0020bad4fc40f3a84e828936c2588232bb687bf.tar.gz
surf-d0020bad4fc40f3a84e828936c2588232bb687bf.tar.bz2
surf-d0020bad4fc40f3a84e828936c2588232bb687bf.zip
Adapt togglestyle()
We can't apply an empty stylesheet anymore, instead remove any previous stylesheet.
-rw-r--r--surf.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/surf.c b/surf.c
index f5c7d1e..30464d5 100644
--- a/surf.c
+++ b/surf.c
@@ -1368,7 +1368,12 @@ void
togglestyle(Client *c, const Arg *a)
{
enablestyle = !enablestyle;
- setstyle(c, enablestyle ? getstyle(geturi(c)) : "");
+
+ if (enablestyle)
+ setstyle(c, getstyle(geturi(c)));
+ else
+ webkit_user_content_manager_remove_all_style_sheets(
+ webkit_web_view_get_user_content_manager(c->view));
updatetitle(c);
}