gesture stylus: Fix condition
authorMatthias Clasen <mclasen@redhat.com>
Sun, 9 Apr 2023 12:33:15 +0000 (08:33 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 21 Apr 2023 07:14:22 +0000 (09:14 +0200)
Now that the paint demo lets us test this, it has
become apparent that this condition is wrong, and
we don't get the expected events if stylus-only is
FALSE.

gtk/gtkgesturestylus.c

index bc3da9351dd96c3834921b92b107456c0c36905d..d2e2248e99bf25ddbe38e83af65a525438ab812a 100644 (file)
@@ -103,7 +103,7 @@ gtk_gesture_stylus_handle_event (GtkEventController *controller,
   priv = gtk_gesture_stylus_get_instance_private (GTK_GESTURE_STYLUS (controller));
   GTK_EVENT_CONTROLLER_CLASS (gtk_gesture_stylus_parent_class)->handle_event (controller, event, x, y);
 
-  if (!(priv->stylus_only || gdk_event_get_device_tool (event)))
+  if (priv->stylus_only && !gdk_event_get_device_tool (event))
     return FALSE;
 
   switch ((guint) gdk_event_get_event_type (event))