summaryrefslogtreecommitdiff
path: root/src/eom-scroll-view.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/eom-scroll-view.c')
-rw-r--r--src/eom-scroll-view.c55
1 files changed, 21 insertions, 34 deletions
diff --git a/src/eom-scroll-view.c b/src/eom-scroll-view.c
index 7aa9c9c..86541eb 100644
--- a/src/eom-scroll-view.c
+++ b/src/eom-scroll-view.c
@@ -314,9 +314,8 @@ update_scrollbar_values (EomScrollView *view)
{
EomScrollViewPrivate *priv;
int scaled_width, scaled_height;
- int xofs, yofs;
gdouble page_size,page_increment,step_increment;
- gdouble lower, upper, value;
+ gdouble lower, upper;
GtkAllocation allocation;
priv = view->priv;
@@ -338,26 +337,19 @@ update_scrollbar_values (EomScrollView *view)
/* Set scroll bounds and new offsets */
lower = 0;
upper = scaled_width;
- xofs = CLAMP (priv->xofs, 0, upper - page_size);
+ priv->xofs = CLAMP (priv->xofs, 0, upper - page_size);
- if (gtk_adjustment_get_value (priv->hadj) != xofs
- || gtk_adjustment_get_page_size (priv->hadj) != page_size) {
- value = xofs;
- priv->xofs = xofs;
+ g_signal_handlers_block_matched (
+ priv->hadj, G_SIGNAL_MATCH_DATA,
+ 0, 0, NULL, NULL, view);
- g_signal_handlers_block_matched (
- priv->hadj, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, view);
+ gtk_adjustment_configure (priv->hadj, priv->xofs, lower,
+ upper, step_increment,
+ page_increment, page_size);
- gtk_adjustment_configure (priv->hadj, value, lower,
- upper, step_increment,
- page_increment, page_size);
-
- g_signal_handlers_unblock_matched (
- priv->hadj, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, view);
- }
- }
+ g_signal_handlers_unblock_matched (
+ priv->hadj, G_SIGNAL_MATCH_DATA,
+ 0, 0, NULL, NULL, view);
if (gtk_widget_get_visible (GTK_WIDGET (priv->vbar))) {
page_size = MIN (scaled_height, allocation.height);
@@ -366,24 +358,19 @@ update_scrollbar_values (EomScrollView *view)
lower = 0;
upper = scaled_height;
- yofs = CLAMP (priv->yofs, 0, upper - page_size);
-
- if (gtk_adjustment_get_value (priv->vadj) != yofs
- || gtk_adjustment_get_page_size (priv->vadj) != page_size) {
- value = yofs;
- priv->yofs = yofs;
+ priv->yofs = CLAMP (priv->yofs, 0, upper - page_size);
- g_signal_handlers_block_matched (
- priv->vadj, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, view);
+ g_signal_handlers_block_matched (
+ priv->vadj, G_SIGNAL_MATCH_DATA,
+ 0, 0, NULL, NULL, view);
- gtk_adjustment_configure (priv->vadj, value, lower,
- upper, step_increment,
- page_increment, page_size);
+ gtk_adjustment_configure (priv->vadj, priv->yofs, lower,
+ upper, step_increment,
+ page_increment, page_size);
- g_signal_handlers_unblock_matched (
- priv->vadj, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, view);
+ g_signal_handlers_unblock_matched (
+ priv->vadj, G_SIGNAL_MATCH_DATA,
+ 0, 0, NULL, NULL, view);
}
}
}