tAdapt togglestyle() - surf - customized build of surf, the suckless webkit browser (HTM) git clone git://src.adamsgaard.dk/surf (DIR) Log (DIR) Files (DIR) Refs (DIR) README (DIR) LICENSE --- (DIR) commit d0020bad4fc40f3a84e828936c2588232bb687bf (DIR) parent c3a827d621fbedfb974db9d137d3e5bea66490b4 (HTM) Author: Quentin Rameau <quinq@fifth.space> Date: Sun, 22 Nov 2015 15:31:15 +0100 Adapt togglestyle() We can't apply an empty stylesheet anymore, instead remove any previous stylesheet. Diffstat: M surf.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- (DIR) diff --git a/surf.c b/surf.c t@@ -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); }