+titlechangeleave(void *a, void *b, Client *c)
+{
+ c->linkhover = NULL;
+ updatetitle(c);
+}
+
+void
+toggle(Client *c, const Arg *arg)
+{
+ WebKitWebSettings *settings;
+ char *name = (char *)arg->v;
+ gboolean value;
+ Arg a = { .b = FALSE };
+
+ settings = webkit_web_view_get_settings(c->view);
+ g_object_get(G_OBJECT(settings), name, &value, NULL);
+ g_object_set(G_OBJECT(settings), name, !value, NULL);
+
+ reload(c, &a);
+}
+
+void
+togglecookiepolicy(Client *c, const Arg *arg)
+{
+ SoupCookieJar *jar;
+ SoupCookieJarAcceptPolicy policy;
+
+ jar = SOUP_COOKIE_JAR(soup_session_get_feature(
+ webkit_get_default_session(),
+ SOUP_TYPE_COOKIE_JAR));
+ g_object_get(G_OBJECT(jar), "accept-policy", &policy, NULL);
+
+ policysel++;
+ if (policysel >= strlen(cookiepolicies))
+ policysel = 0;
+
+ g_object_set(G_OBJECT(jar), "accept-policy", cookiepolicy_get(), NULL);
+
+ updatetitle(c);
+ /* Do not reload. */
+}
+
+void
+togglegeolocation(Client *c, const Arg *arg)
+{
+ Arg a = { .b = FALSE };
+
+ allowgeolocation ^= 1;
+ reload(c, &a);
+}
+
+void
+twitch(Client *c, const Arg *arg)
+{
+ GtkAdjustment *a;
+ gdouble v;
+
+ a = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(
+ c->scroll));
+
+ v = gtk_adjustment_get_value(a);
+
+ v += arg->i;
+
+ v = MAX(v, 0.0);
+ v = MIN(v, gtk_adjustment_get_upper(a) -
+ gtk_adjustment_get_page_size(a));
+ gtk_adjustment_set_value(a, v);
+}
+
+void
+togglescrollbars(Client *c, const Arg *arg)
+{
+ GtkPolicyType vspolicy;
+ Arg a;
+
+ gtk_scrolled_window_get_policy(GTK_SCROLLED_WINDOW(c->scroll), NULL,
+ &vspolicy);
+
+ if (vspolicy == GTK_POLICY_AUTOMATIC) {
+ gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(c->scroll),
+ GTK_POLICY_NEVER,
+ GTK_POLICY_NEVER);
+ } else {
+ gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(c->scroll),
+ GTK_POLICY_AUTOMATIC,
+ GTK_POLICY_AUTOMATIC);
+ a.i = +1;
+ twitch(c, &a);
+ a.i = -1;
+ twitch(c, &a);
+ }
+}
+
+void
+togglestyle(Client *c, const Arg *arg)
+{
+ enablestyle = !enablestyle;
+ setstyle(c, enablestyle ? getstyle(geturi(c)) : "");
+
+ updatetitle(c);
+}
+
+void
+gettogglestat(Client *c)
+{
+ gboolean value;
+ int p = 0;
+ WebKitWebSettings *settings = webkit_web_view_get_settings(c->view);
+
+ togglestat[p++] = cookiepolicy_set(cookiepolicy_get());
+
+ g_object_get(G_OBJECT(settings), "enable-caret-browsing", &value,
+ NULL);
+ togglestat[p++] = value? 'C': 'c';
+
+ togglestat[p++] = allowgeolocation? 'G': 'g';
+
+ togglestat[p++] = enablediskcache? 'D': 'd';
+
+ g_object_get(G_OBJECT(settings), "auto-load-images", &value, NULL);
+ togglestat[p++] = value? 'I': 'i';