Fix inspector handling when inspector is disabled.
authorQuentin Rameau <quinq+hackers@fifth.space>
Tue, 3 Nov 2015 14:42:30 +0000 (15:42 +0100)
committerChristoph Lohmann <20h@r-36.net>
Tue, 3 Nov 2015 18:45:04 +0000 (19:45 +0100)
Do not try to show the inspector window when the inspector is disabled.

Signed-off-by: Christoph Lohmann <20h@r-36.net>
surf.c

diff --git a/surf.c b/surf.c
index ff2496d..dd9c306 100644 (file)
--- a/surf.c
+++ b/surf.c
@@ -695,10 +695,12 @@ initdownload(WebKitWebView *view, WebKitDownload *o, Client *c)
 void
 inspector(Client *c, const Arg *arg)
 {
-       if (c->isinspecting)
-               webkit_web_inspector_close(c->inspector);
-       else
-               webkit_web_inspector_show(c->inspector);
+       if (enableinspector) {
+               if (c->isinspecting)
+                       webkit_web_inspector_close(c->inspector);
+               else
+                       webkit_web_inspector_show(c->inspector);
+       }
 }
 
 WebKitWebView *