[hackers] [surf] Fix inspector handling when inspector is disabled.

From: Quentin Rameau <quinq+hackers_AT_fifth.space>
Date: Tue, 3 Nov 2015 15:42:30 +0100

Do not try to show the inspector window when the inspector is disabled.
---
 surf.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/surf.c b/surf.c
index ff2496d..dd9c306 100644
--- a/surf.c
+++ b/surf.c
_AT_@ -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 *
-- 
2.6.2
Received on Tue Nov 03 2015 - 15:42:30 CET

This archive was generated by hypermail 2.3.0 : Tue Nov 03 2015 - 15:48:13 CET