From b31729f82193182ad14fd174a2e23d07d5c8dafa Mon Sep 17 00:00:00 2001 From: Jehan Date: Tue, 8 Jan 2019 14:19:11 +0100 Subject: [PATCH] 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;