[hackers] [surf] Fix inspector toggling || Quentin Rameau

From: <git_AT_suckless.org>
Date: Tue, 5 Jul 2016 13:02:32 +0200 (CEST)

commit 1206b2c587f7e4067dbd1e9c64c0a757ff343b06
Author: Quentin Rameau <quinq_AT_fifth.space>
AuthorDate: Sat Jan 9 13:42:50 2016 +0100
Commit: Quentin Rameau <quinq_AT_fifth.space>
CommitDate: Tue Jul 5 13:01:56 2016 +0200

    Fix inspector toggling
    
    Always get the inspector object, and let the user eventually close it
    even if it's disabled for the current page.

diff --git a/surf.c b/surf.c
index 1c194a3..acb3efe 100644
--- a/surf.c
+++ b/surf.c
_AT_@ -1084,8 +1084,7 @@ showview(WebKitWebView *v, Client *c)
         GdkWindow *gwin;
 
         c->finder = webkit_web_view_get_find_controller(c->view);
- if (curconfig[Inspector].val.b)
- c->inspector = webkit_web_view_get_inspector(c->view);
+ c->inspector = webkit_web_view_get_inspector(c->view);
 
         c->win = createwindow(c);
 
_AT_@ -1535,12 +1534,10 @@ togglecookiepolicy(Client *c, const Arg *a)
 void
 toggleinspector(Client *c, const Arg *a)
 {
- if (curconfig[Inspector].val.b) {
- if (webkit_web_inspector_is_attached(c->inspector))
- webkit_web_inspector_close(c->inspector);
- else
- webkit_web_inspector_show(c->inspector);
- }
+ if (webkit_web_inspector_is_attached(c->inspector))
+ webkit_web_inspector_close(c->inspector);
+ else if (curconfig[Inspector].val.b)
+ webkit_web_inspector_show(c->inspector);
 }
 
 void
Received on Tue Jul 05 2016 - 13:02:32 CEST

This archive was generated by hypermail 2.3.0 : Tue Jul 05 2016 - 13:12:38 CEST