[gimp/gimp-2-10] app: expect event == NULL in gimp_device_info_get_event_coords().



commit b1fe1675cebaad7806a55db68874d471fe62aac0
Author: Jehan <jehan girinstud io>
Date:   Tue Jan 8 14:19:11 2019 +0100

    app: expect event == NULL in gimp_device_info_get_event_coords().
    
    The problem was not happening with the master code of
    gimpdisplayshell-tool-events.c, but I encountered it in gimp-2-10 with
    the layer picking code.
    Even then, it still works, but I need to protect calls to
    gdk_event_get_axis() to avoid CRITICALs.

 app/widgets/gimpdeviceinfo-coords.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/app/widgets/gimpdeviceinfo-coords.c b/app/widgets/gimpdeviceinfo-coords.c
index 05b6021798..93c1d90bea 100644
--- a/app/widgets/gimpdeviceinfo-coords.c
+++ b/app/widgets/gimpdeviceinfo-coords.c
@@ -39,7 +39,7 @@ gimp_device_info_get_event_coords (GimpDeviceInfo *info,
 {
   gdouble x;
 
-  if (gdk_event_get_axis (event, GDK_AXIS_X, &x))
+  if (event && gdk_event_get_axis (event, GDK_AXIS_X, &x))
     {
       *coords = default_coords;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]