summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Rameau <quinq@fifth.space>2016-01-09 13:42:50 +0100
committerQuentin Rameau <quinq@fifth.space>2016-07-05 13:01:56 +0200
commit1206b2c587f7e4067dbd1e9c64c0a757ff343b06 (patch)
tree7fdef0af19167b74ce47b12975833a8db6fb4108
parentc8fdd4d5839cac08daf5fcbae9a83db60793486a (diff)
downloadsurf-1206b2c587f7e4067dbd1e9c64c0a757ff343b06.tar.gz
surf-1206b2c587f7e4067dbd1e9c64c0a757ff343b06.tar.bz2
surf-1206b2c587f7e4067dbd1e9c64c0a757ff343b06.zip
Fix inspector toggling
Always get the inspector object, and let the user eventually close it even if it's disabled for the current page.
-rw-r--r--surf.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/surf.c b/surf.c
index 1c194a3..acb3efe 100644
--- a/surf.c
+++ b/surf.c
@@ -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);
@@ -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