gdkseatdefault: Use TABLET_STYLUS capability for styli/erasers/cursors

Those are devices created for drawing tablets, so using the "pointer"
capability is far too generic.
This commit is contained in:
Carlos Garnacho 2017-11-27 21:24:54 +01:00
parent 7decad177c
commit cabfdd5c48

View File

@ -222,11 +222,12 @@ device_get_capability (GdkDevice *device)
return GDK_SEAT_CAPABILITY_KEYBOARD;
case GDK_SOURCE_TOUCHSCREEN:
return GDK_SEAT_CAPABILITY_TOUCH;
case GDK_SOURCE_MOUSE:
case GDK_SOURCE_TOUCHPAD:
case GDK_SOURCE_PEN:
case GDK_SOURCE_ERASER:
case GDK_SOURCE_CURSOR:
return GDK_SEAT_CAPABILITY_TABLET_STYLUS;
case GDK_SOURCE_MOUSE:
case GDK_SOURCE_TOUCHPAD:
case GDK_SOURCE_TRACKPOINT:
case GDK_SOURCE_TABLET_PAD:
default:
@ -265,7 +266,7 @@ gdk_seat_default_get_slaves (GdkSeat *seat,
priv = gdk_seat_default_get_instance_private (GDK_SEAT_DEFAULT (seat));
if (capabilities & (GDK_SEAT_CAPABILITY_POINTER | GDK_SEAT_CAPABILITY_TOUCH))
if (capabilities & (GDK_SEAT_CAPABILITY_ALL_POINTING))
devices = append_filtered (devices, priv->slave_pointers, capabilities);
if (capabilities & GDK_SEAT_CAPABILITY_KEYBOARD)
@ -359,7 +360,7 @@ gdk_seat_default_add_slave (GdkSeatDefault *seat,
priv = gdk_seat_default_get_instance_private (seat);
capability = device_get_capability (device);
if (capability & (GDK_SEAT_CAPABILITY_POINTER | GDK_SEAT_CAPABILITY_TOUCH))
if (capability & GDK_SEAT_CAPABILITY_ALL_POINTING)
priv->slave_pointers = g_list_prepend (priv->slave_pointers, g_object_ref (device));
else if (capability & GDK_SEAT_CAPABILITY_KEYBOARD)
priv->slave_keyboards = g_list_prepend (priv->slave_keyboards, g_object_ref (device));
@ -391,7 +392,7 @@ gdk_seat_default_remove_slave (GdkSeatDefault *seat,
{
priv->slave_pointers = g_list_remove (priv->slave_pointers, device);
priv->capabilities &= ~(GDK_SEAT_CAPABILITY_POINTER | GDK_SEAT_CAPABILITY_TOUCH);
priv->capabilities &= ~(GDK_SEAT_CAPABILITY_ALL_POINTING);
for (l = priv->slave_pointers; l; l = l->next)
priv->capabilities |= device_get_capability (GDK_DEVICE (l->data));