[gtk+/wip/baedert/gtkimageview: 45992/46001] 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: 45992/46001] GtkImageView: Don't crash on scroll-events if !image_surface
- Date: Wed, 27 Jan 2016 15:28:31 +0000 (UTC)
commit 2e3c44f99e157aa73a5966078f496671d680dd7d
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]