mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 19:00:08 +00:00
wayland: Add defines to convert between event sequences and touch slots
This makes it clearer in code what's going on there. GDK_SLOT_TO_EVENT_SEQUENCE isn't used yet, but will be useful in the future.
This commit is contained in:
parent
5bc437d2bc
commit
ba83a2757e
@ -120,6 +120,9 @@ G_DEFINE_TYPE (GdkWaylandDevice, gdk_wayland_device, GDK_TYPE_DEVICE)
|
||||
#define GDK_IS_WAYLAND_DEVICE_MANAGER_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_WAYLAND_DEVICE_MANAGER))
|
||||
#define GDK_WAYLAND_DEVICE_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_WAYLAND_DEVICE_MANAGER, GdkWaylandDeviceManagerClass))
|
||||
|
||||
#define GDK_SLOT_TO_EVENT_SEQUENCE(s) ((GdkEventSequence *) GUINT_TO_POINTER((s) + 1))
|
||||
#define GDK_EVENT_SEQUENCE_TO_SLOT(s) (GPOINTER_TO_UINT(s) - 1)
|
||||
|
||||
typedef struct _GdkWaylandDeviceManager GdkWaylandDeviceManager;
|
||||
typedef struct _GdkWaylandDeviceManagerClass GdkWaylandDeviceManagerClass;
|
||||
|
||||
@ -1349,7 +1352,7 @@ _create_touch_event (GdkWaylandDeviceData *device,
|
||||
event->touch.time = time;
|
||||
event->touch.state = device->modifiers;
|
||||
gdk_event_set_screen (event, display->screen);
|
||||
event->touch.sequence = GUINT_TO_POINTER (touch->id + 1);
|
||||
event->touch.sequence = GDK_SLOT_TO_EVENT_SEQUENCE (touch->id);
|
||||
|
||||
if (touch->initial_touch)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user