Commit Graph

12 Commits

Author SHA1 Message Date
Carlos Garnacho
7531be3510 gdk: Add GDK_SEAT_CAPABILITY_TABLET_PAD
Tablet pads don't adapt really well to any other capability, so add a
distinct one to be able to query those properly.

https://bugzilla.gnome.org/show_bug.cgi?id=790920
2017-12-07 21:27:33 -05:00
Carlos Garnacho
4c45022ed0 gdk: Add gdk_seat_get_master_pointers()
Traditionally (and on most backends) there's a single master pointer driven
by all pointing devices. The notable exception is Wayland though, where
master pointing devices are created per capability in the case of
pointer/touch, and one for each drawing tablet.

This function call makes it easy to access all these.

https://bugzilla.gnome.org/show_bug.cgi?id=790920
2017-12-07 21:27:14 -05:00
Carlos Garnacho
cabfdd5c48 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.
2017-11-27 21:41:25 +01:00
Benjamin Otte
43c212ac28 build: Enable -Wswitch-enum and -Wswitch-default
This patch makes that work using 1 of 2 options:

1. Add all missing enums to the switch statement
  or
2. Cast the switch argument to a uint to avoid having to do that (mostly
   for GdkEventType).

I even found a bug while doing that: clearing a GtkImage with a surface
did not notify thae surface property.

The reason for enabling this flag even though it is tedious at times is
that it is very useful when adding values to an enum, because it makes
GTK immediately warn about all the switch statements where this enum is
relevant.
And I expect changes to enums to be frequent during the GTK4 development
cycle.
2017-10-06 21:23:39 +02:00
Daniel Boles
9c7e996bce gdkseatdefault: Grab touch events where applicable
gdk_seat_default_grab() grabs POINTER_EVENTS if the capability is
GDK_SEAT_CAPABILITY_ALL_POINTING. But that enumerator is a union that
includes GDK_SEAT_CAPABILITY_TOUCH, but we never grabbed TOUCH_EVENTS,
an unused macro that was presumably created with this purpose in mind.

So, check which of the ALL_POINTING capabilities we have, and set the
right mask of POINTER_EVENTS and/or TOUCH_EVENTS as required.

As part of this, explicitly let TABLET_STYLUS take over pointer events,
as this is the intended behaviour and was the effective result before.

This should fix touch events being lost in migrating from Device.grab()
to Seat.grab(GDK_SEAT_CAPABILITY_ALL_POINTING), as found by Inkscape.

https://bugzilla.gnome.org/show_bug.cgi?id=781757
2017-09-20 19:19:35 +01:00
Matthias Clasen
cbe1337aa1 Revert "Remove gdk_device_grab/ungrab from the API"
This reverts commit efc37d0855.

Turns out we need to clean up the dnd code some more, first.
2016-10-25 21:24:37 -04:00
Matthias Clasen
efc37d0855 Remove gdk_device_grab/ungrab from the API
These are still used in a few places internally,
so make them private.
2016-10-25 20:03:34 -04:00
Matthias Clasen
9044f78751 Move GdkDeviceTool into its own files 2016-04-09 15:48:34 -04:00
Carlos Garnacho
5a25c5a9f2 GdkSeatDefault: Add functions to add/remove tools
This may be used by any backend using GdkSeatDefault as its seat
implementation.
2016-04-06 15:43:29 +02:00
Matthias Clasen
1c887b2287 gdk: Strip newlines from g_warning and g_error
g_logv adds one for us already.
2016-02-28 12:23:12 -05:00
Matthias Clasen
e12663378c x11: Update seat capabilities
The default seat implementation was never returning capabilities,
which is broken. It is visible too, since the inspector shows seat
information now.
2016-02-25 06:18:41 -05:00
Carlos Garnacho
0472c088a1 gdk: Add GdkSeatDefault
https://bugzilla.gnome.org/show_bug.cgi?id=759309
2015-12-15 00:16:15 +01:00