From 5c6d2c8e870b7b99f57cfeefe3f0895c760fd562 Mon Sep 17 00:00:00 2001 From: hrdl <7808331-hrdl@users.noreply.gitlab.com> Date: Sun, 15 May 2022 22:48:22 +0200 Subject: [PATCH 1/2] Fixes incorrect grabbing behaviour causing subsequent rejection of input mouse_location can be set to NULL in gtk_range_update_mouse_location(). This causes a match with stepper_?_gadget in gtk_range_multipress_gesture_pressed(), as both are NULL. This leads to a grab being added internally and as well, a critical error message, and a subsequent rejection of touch inputs. Returning early when mouse_location is NULL prevents this. Closes #4947 --- gtk/gtkrange.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c index 774174df52..b52a21017b 100644 --- a/gtk/gtkrange.c +++ b/gtk/gtkrange.c @@ -2711,6 +2711,11 @@ gtk_range_multipress_gesture_pressed (GtkGestureMultiPress *gesture, priv->mouse_y = y; gtk_range_update_mouse_location (range); + if (!priv->mouse_location) + { + g_warning(G_STRLOC "value of mouse_location is 'NULL'"); + return; + } gtk_css_gadget_get_margin_box (priv->slider_gadget, &slider_alloc); g_object_get (gtk_widget_get_settings (widget), From 15f0ac6f93d1581fe38d9c6bbd4ca64926bbc1f8 Mon Sep 17 00:00:00 2001 From: hrdl <79064-hrdl@users.noreply.gitlab.gnome.org> Date: Sat, 28 Jan 2023 14:20:49 +0100 Subject: [PATCH 2/2] Remove warning --- gtk/gtkrange.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c index b52a21017b..f53e08434d 100644 --- a/gtk/gtkrange.c +++ b/gtk/gtkrange.c @@ -2712,10 +2712,8 @@ gtk_range_multipress_gesture_pressed (GtkGestureMultiPress *gesture, gtk_range_update_mouse_location (range); if (!priv->mouse_location) - { - g_warning(G_STRLOC "value of mouse_location is 'NULL'"); - return; - } + return; + gtk_css_gadget_get_margin_box (priv->slider_gadget, &slider_alloc); g_object_get (gtk_widget_get_settings (widget),