[gimp] app: expect event == NULL in gimp_device_info_get_event_coords().



commit b31729f82193182ad14fd174a2e23d07d5c8dafa
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.
    
    (cherry picked from commit b1fe1675cebaad7806a55db68874d471fe62aac0)
    
    Note: this was not absolutely necessary on master (no CRITICALs), but I
    can see that the same piece of code applies, so I may as well sync.

 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 5b7fc6c4c9..5c032a0ba9 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]