[hackers] [surf] Adapt togglestyle() || Quentin Rameau

From: <git_AT_suckless.org>
Date: Sun, 22 Nov 2015 15:35:13 +0100 (CET)

commit d0020bad4fc40f3a84e828936c2588232bb687bf
Author: Quentin Rameau <quinq_AT_fifth.space>
AuthorDate: Sun Nov 22 15:31:15 2015 +0100
Commit: Quentin Rameau <quinq_AT_fifth.space>
CommitDate: Sun Nov 22 15:31:15 2015 +0100

    Adapt togglestyle()
    
    We can't apply an empty stylesheet anymore, instead remove any previous
    stylesheet.

diff --git a/surf.c b/surf.c
index f5c7d1e..30464d5 100644
--- a/surf.c
+++ b/surf.c
_AT_@ -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);
 }
Received on Sun Nov 22 2015 - 15:35:13 CET

This archive was generated by hypermail 2.3.0 : Sun Nov 22 2015 - 15:36:26 CET