static void linkopen(Client *c, const Arg *arg);
static void linkopenembed(Client *c, const Arg *arg);
static void reload(Client *c, const Arg *arg);
-static void scroll_h(Client *c, const Arg *arg);
-static void scroll_v(Client *c, const Arg *arg);
-static void scroll(GtkAdjustment *a, const Arg *arg);
+static void scroll_h(Client *c, const Arg *a);
+static void scroll_v(Client *c, const Arg *a);
static void setatom(Client *c, int a, const char *v);
static void setup(void);
static void sigchld(int unused);
}
void
-scroll_h(Client *c, const Arg *arg)
+scroll_h(Client *c, const Arg *a)
{
- scroll(gtk_scrolled_window_get_hadjustment(
- GTK_SCROLLED_WINDOW(c->scroll)), arg);
+ evalscript(c, "window.scrollBy(%d * (window.innerWidth / 100), 0)",
+ a->i);
}
void
-scroll_v(Client *c, const Arg *arg)
+scroll_v(Client *c, const Arg *a)
{
- scroll(gtk_scrolled_window_get_vadjustment(
- GTK_SCROLLED_WINDOW(c->scroll)), arg);
-}
-
-void
-scroll(GtkAdjustment *a, const Arg *arg)
-{
- gdouble v;
-
- v = gtk_adjustment_get_value(a);
- switch (arg->i) {
- case +10000:
- case -10000:
- v += gtk_adjustment_get_page_increment(a) * (arg->i / 10000);
- break;
- case +20000:
- case -20000:
- default:
- v += gtk_adjustment_get_step_increment(a) * 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);
+ evalscript(c, "window.scrollBy(0, %d * (window.innerHeight / 100))",
+ a->i);
}
void