[gtk+/wip/baedert/gtkimageview: 570/625] GtkImageView: Don't crash on scroll-events if !image_surface
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/baedert/gtkimageview: 570/625] GtkImageView: Don't crash on scroll-events if !image_surface
- Date: Sat, 19 Mar 2016 08:47:51 +0000 (UTC)
commit f94cf4ee9662d0cece78c696f1e4bd7fd0a022c3
Author: Timm Bäder <mail baedert org>
Date: Mon Jan 25 16:49:12 2016 +0100
GtkImageView: Don't crash on scroll-events if !image_surface
gtk/gtkimageview.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkimageview.c b/gtk/gtkimageview.c
index 9b4e544..af3a246 100644
--- a/gtk/gtkimageview.c
+++ b/gtk/gtkimageview.c
@@ -1578,11 +1578,14 @@ gtk_image_view_scroll_event (GtkWidget *widget,
double new_scale = priv->scale - (0.1 * event->delta_y);
State state;
+ if (!priv->image_surface)
+ return GDK_EVENT_PROPAGATE;
+
gtk_image_view_get_current_state (image_view, &state);
gtk_image_view_set_scale_internal (image_view, new_scale);
- if (priv->hadjustment != NULL && priv->vadjustment != NULL)
+ if (priv->hadjustment && priv->vadjustment)
{
gtk_image_view_fix_anchor (image_view,
event->x,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]