After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 779317 - gtk_pad_controllerpad_set_action issue with incorrect assert
gtk_pad_controllerpad_set_action issue with incorrect assert
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2017-02-27 15:22 UTC by cedlemo
Modified: 2017-03-01 12:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix check on in gtk_pad_controller_set_action (853 bytes, patch)
2017-02-27 17:11 UTC, cedlemo
committed Details | Review

Description cedlemo 2017-02-27 15:22:53 UTC
In the following function:

>void
>gtk_pad_controller_set_action (GtkPadController *controller,
>                               GtkPadActionType type,
>                               gint index,
>                               gint mode,
>                               const gchar *label,
>                               const gchar *action_name);

When setting a type with GTK_PAD_ACTION_STRIP, there is this error message :

> Gtk-CRITICAL **: gtk_pad_controller_set_action: assertion 'type <= GTK_PAD_ACTION_RING' failed

here is a patch :

diff --git a/gtk/gtkpadcontroller.c b/gtk/gtkpadcontroller.c
index c1a9af714e..e7fedfb527 100644
--- a/gtk/gtkpadcontroller.c
+++ b/gtk/gtkpadcontroller.c
@@ -514,7 +514,7 @@ gtk_pad_controller_set_action (GtkPadController *controller,
                               (gchar *) label, (gchar *) action_name };
 
   g_return_if_fail (GTK_IS_PAD_CONTROLLER (controller));
-  g_return_if_fail (type <= GTK_PAD_ACTION_RING);
+  g_return_if_fail (type <= GTK_PAD_ACTION_STRIP);
 
   gtk_pad_controller_add_entry (controller, &entry);
 }


Regards.
Comment 1 Carlos Garnacho 2017-02-27 15:51:49 UTC
Thanks for spotting! The fix is correct, it'd be great if you could attach a git-format'ed patch so authorship is preserved.
Comment 2 cedlemo 2017-02-27 17:11:05 UTC
Created attachment 346837 [details] [review]
Fix check on in gtk_pad_controller_set_action

done!
Comment 3 Carlos Garnacho 2017-03-01 12:01:00 UTC
Thanks! The fix is now in gtk-3-22 and master branches.