From 6574f6ff3080da79007a1ea311628a4716fdbe37 Mon Sep 17 00:00:00 2001 From: Gabriele Barbero Date: Wed, 18 Jun 2025 18:58:57 +0200 Subject: [PATCH] display: avoid critical on master devices When the device is of type GDK_DEVICE_TYPE_MASTER, calling gdk_device_get_vendor_id() and gdk_device_get_product_id() fails and triggers a CRITICAL warning. This commit avoids invoking these functions on master devices, where failure is guaranteed. See #14219 --- app/display/gimpmodifiersmanager.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/display/gimpmodifiersmanager.c b/app/display/gimpmodifiersmanager.c index 944b29f5e6..e048f7b9ea 100644 --- a/app/display/gimpmodifiersmanager.c +++ b/app/display/gimpmodifiersmanager.c @@ -513,13 +513,17 @@ gimp_modifiers_manager_get_keys (GdkDevice *device, gchar **actions_key, gchar **buttons_key) { - const gchar *vendor_id; - const gchar *product_id; + const gchar *vendor_id = NULL; + const gchar *product_id = NULL; g_return_if_fail (GDK_IS_DEVICE (device) || device == NULL); - vendor_id = device ? gdk_device_get_vendor_id (device) : NULL; - product_id = device ? gdk_device_get_product_id (device) : NULL; + if (device && gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_MASTER) + { + vendor_id = gdk_device_get_vendor_id (device); + product_id = gdk_device_get_product_id (device); + } + modifiers = modifiers & gimp_get_all_modifiers_mask (); if (actions_key)