summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--src/gui/panels/glance.c8
2 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 6dcedb6..f5e628d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
12-11-20 Cyrille Bagard <nocbos@gmail.com>
+ * src/gui/panels/glance.c:
+ Avoid flickering when playing on the borders of the glance panel.
+
+12-11-20 Cyrille Bagard <nocbos@gmail.com>
+
* plugins/androhelpers/try_n_catch.c:
Fix some links to Dalvik exception handlers.
diff --git a/src/gui/panels/glance.c b/src/gui/panels/glance.c
index fb1723a..abbe6a1 100644
--- a/src/gui/panels/glance.c
+++ b/src/gui/panels/glance.c
@@ -626,6 +626,7 @@ static gboolean on_mouse_motion_over_glance(GtkWidget *widget, GdkEventMotion *e
gdouble diff_y; /* Evolution sur les ordonnées */
GtkAdjustment *hadj; /* Gestionnaire du défilement */
GtkAdjustment *vadj; /* Gestionnaire du défilement */
+ gdouble value; /* Nouvelle valeur bornée */
if (panel->view != NULL && event->state & GDK_BUTTON1_MASK && panel->valid)
{
@@ -635,8 +636,11 @@ static gboolean on_mouse_motion_over_glance(GtkWidget *widget, GdkEventMotion *e
hadj = gtk_scrolled_window_get_hadjustment(panel->support);
vadj = gtk_scrolled_window_get_vadjustment(panel->support);
- gtk_adjustment_set_value(hadj, panel->ref_h + diff_x);
- gtk_adjustment_set_value(vadj, panel->ref_v + diff_y);
+ value = CLAMP(panel->ref_h + diff_x, hadj->lower, hadj->upper - hadj->page_size);
+ gtk_adjustment_set_value(hadj, value);
+
+ value = CLAMP(panel->ref_v + diff_y, vadj->lower, vadj->upper - vadj->page_size);
+ gtk_adjustment_set_value(vadj, value);
}