gdk: Conflate GDK devices

Make GdkEvents hold a single GdkDevice. This device is closer to
the logical device conceptually, although it must be sufficient for
device checks (i.e. GdkInputSource), which makes it similar to the
physical devices.

Make the logical devices have a more accurate GdkInputSource where
needed, and conflate the event devices altogether.
This commit is contained in:
Carlos Garnacho 2020-07-29 00:03:48 +02:00
parent 25ea17a6fc
commit cab1dcb696
30 changed files with 65 additions and 224 deletions

View File

@ -475,7 +475,6 @@ gdk_event_unref
gdk_event_get_event_type
gdk_event_get_surface
gdk_event_get_device
gdk_event_get_source_device
gdk_event_get_device_tool
gdk_event_get_time
gdk_event_get_display

View File

@ -100,7 +100,6 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
event = gdk_crossing_event_new (GDK_ENTER_NOTIFY,
surface,
display_broadway->core_pointer,
display_broadway->pointer,
message->base.time,
message->pointer.state,
message->pointer.win_x,
@ -119,7 +118,6 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
event = gdk_crossing_event_new (GDK_LEAVE_NOTIFY,
surface,
display_broadway->core_pointer,
display_broadway->pointer,
message->base.time,
message->pointer.state,
message->pointer.win_x,
@ -140,7 +138,6 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
{
event = gdk_motion_event_new (surface,
display_broadway->core_pointer,
display_broadway->pointer,
NULL,
message->base.time,
message->pointer.state,
@ -167,7 +164,6 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
: GDK_BUTTON_RELEASE,
surface,
display_broadway->core_pointer,
display_broadway->pointer,
NULL,
message->base.time,
message->pointer.state,
@ -187,7 +183,6 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
{
event = gdk_scroll_event_new_discrete (surface,
display_broadway->core_pointer,
display_broadway->pointer,
NULL,
message->base.time,
0,
@ -234,7 +229,6 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
GUINT_TO_POINTER (message->touch.sequence_id),
surface,
display_broadway->core_pointer,
display_broadway->touchscreen,
message->base.time,
state,
message->touch.win_x,
@ -263,7 +257,6 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
: GDK_KEY_RELEASE,
surface,
display_broadway->core_keyboard,
display_broadway->keyboard,
message->base.time,
message->key.key,
message->key.state,
@ -320,7 +313,6 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
{
event = gdk_focus_event_new (surface,
display_broadway->core_keyboard,
display_broadway->keyboard,
FALSE);
node = _gdk_event_queue_append (display, event);
@ -331,7 +323,6 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
{
event = gdk_focus_event_new (surface,
display_broadway->core_keyboard,
display_broadway->keyboard,
TRUE);
node = _gdk_event_queue_append (display, event);

View File

@ -491,7 +491,6 @@ generate_grab_broken_event (GdkDisplay *display,
GdkEvent *event;
event = gdk_grab_broken_event_new (surface,
device,
device,
grab_surface,
implicit);

View File

@ -153,7 +153,6 @@ gdk_event_finalize (GdkEvent *self)
g_clear_object (&self->surface);
g_clear_object (&self->device);
g_clear_object (&self->source_device);
g_type_free_instance ((GTypeInstance *) self);
}
@ -398,7 +397,6 @@ type_name ## _get_type (void) \
* @event_type: the #GdkEventType to allocate
* @surface: (nullable): the #GdkSurface of the event
* @device: (nullable): the #GdkDevice of the event
* @source_device: (nullable): the source #GdkDevice of the event
* @time_: the event serial
*
* Allocates a #GdkEvent for the given @event_type, and sets its
@ -410,7 +408,6 @@ static gpointer
gdk_event_alloc (GdkEventType event_type,
GdkSurface *surface,
GdkDevice *device,
GdkDevice *source_device,
guint32 time_)
{
g_assert (event_type >= GDK_DELETE && event_type < GDK_EVENT_LAST);
@ -428,7 +425,6 @@ gdk_event_alloc (GdkEventType event_type,
event->event_type = event_type;
event->surface = surface != NULL ? g_object_ref (surface) : NULL;
event->device = device != NULL ? g_object_ref (device) : NULL;
event->source_device = source_device != NULL ? g_object_ref (source_device) : NULL;
event->time = time_;
return event;
@ -487,15 +483,6 @@ check_event_sanity (GdkEvent *event)
return FALSE;
}
if (event->source_device != NULL &&
gdk_surface_get_display (event->surface) != gdk_device_get_display (event->source_device))
{
char *type = g_enum_to_string (GDK_TYPE_EVENT_TYPE, event->event_type);
g_warning ("Event of type %s with mismatched source device display", type);
g_free (type);
return FALSE;
}
return TRUE;
}
#endif
@ -704,7 +691,6 @@ gdk_event_queue_handle_scroll_compression (GdkDisplay *display)
gdk_scroll_event_get_deltas (old_event, &dx, &dy);
event = gdk_scroll_event_new (surface,
device,
gdk_event_get_source_device (old_event),
gdk_event_get_device_tool (old_event),
gdk_event_get_time (old_event),
gdk_event_get_modifier_state (old_event),
@ -1214,33 +1200,6 @@ gdk_event_get_device (GdkEvent *event)
return event->device;
}
/**
* gdk_event_get_source_device:
* @event: a #GdkEvent
*
* This function returns the physical #GdkDevice that has triggered
* the event, falling back to the logical device, as returned by
* gdk_event_get_device(), if the event wasnt caused by
* interaction with a hardware device. This may happen for example
* in synthesized crossing events after a #GdkSurface updates its
* geometry or a grab is acquired/released.
*
* If the event does not contain a device field, this function will
* return %NULL.
*
* Returns: (nullable) (transfer none): a #GdkDevice, or %NULL.
**/
GdkDevice *
gdk_event_get_source_device (GdkEvent *event)
{
g_return_val_if_fail (GDK_IS_EVENT (event), NULL);
if (event->source_device)
return event->source_device;
return event->device;
}
/**
* gdk_event_get_device_tool:
* @event: a #GdkEvent
@ -1399,7 +1358,7 @@ gdk_button_event_get_axes (GdkEvent *event,
guint *n_axes)
{
GdkButtonEvent *self = (GdkButtonEvent *) event;
GdkDevice *source_device = gdk_event_get_source_device (event);
GdkDevice *source_device = gdk_event_get_device (event);
if (source_device == NULL)
return FALSE;
@ -1430,7 +1389,6 @@ GdkEvent *
gdk_button_event_new (GdkEventType type,
GdkSurface *surface,
GdkDevice *device,
GdkDevice *source_device,
GdkDeviceTool *tool,
guint32 time,
GdkModifierType state,
@ -1442,7 +1400,7 @@ gdk_button_event_new (GdkEventType type,
g_return_val_if_fail (type == GDK_BUTTON_PRESS ||
type == GDK_BUTTON_RELEASE, NULL);
GdkButtonEvent *self = gdk_event_alloc (type, surface, device, source_device, time);
GdkButtonEvent *self = gdk_event_alloc (type, surface, device, time);
self->tool = tool != NULL ? g_object_ref (tool) : NULL;
self->axes = axes;
@ -1507,7 +1465,6 @@ GDK_DEFINE_EVENT_TYPE (GdkKeyEvent, gdk_key_event,
* @type: the event type, either %GDK_KEY_PRESS or %GDK_KEY_RELEASE
* @surface: the #GdkSurface of the event
* @device: the #GdkDevice related to the event
* @source_device: the source #GdkDevice related to the event
* @time: the event's timestamp
* @keycode: the keycode of the event
* @state: the modifiers state
@ -1523,7 +1480,6 @@ GdkEvent *
gdk_key_event_new (GdkEventType type,
GdkSurface *surface,
GdkDevice *device,
GdkDevice *source_device,
guint32 time,
guint keycode,
GdkModifierType state,
@ -1534,7 +1490,7 @@ gdk_key_event_new (GdkEventType type,
g_return_val_if_fail (type == GDK_KEY_PRESS ||
type == GDK_KEY_RELEASE, NULL);
GdkKeyEvent *self = gdk_event_alloc (type, surface, device, source_device, time);
GdkKeyEvent *self = gdk_event_alloc (type, surface, device, time);
GdkEvent *event = (GdkEvent *) self;
self->keycode = keycode;
@ -1898,7 +1854,7 @@ gdk_configure_event_new (GdkSurface *surface,
g_return_val_if_fail (width >= 0 && height >= 0, NULL);
self = gdk_event_alloc (GDK_CONFIGURE, surface, NULL, NULL, GDK_CURRENT_TIME);
self = gdk_event_alloc (GDK_CONFIGURE, surface, NULL, GDK_CURRENT_TIME);
self->width = width;
self->height = height;
@ -1976,7 +1932,7 @@ gdk_touch_event_get_axes (GdkEvent *event,
guint *n_axes)
{
GdkTouchEvent *self = (GdkTouchEvent *) event;
GdkDevice *source_device = gdk_event_get_source_device (event);
GdkDevice *source_device = gdk_event_get_device (event);
if (source_device == NULL)
return FALSE;
@ -2010,7 +1966,6 @@ gdk_touch_event_new (GdkEventType type,
GdkEventSequence *sequence,
GdkSurface *surface,
GdkDevice *device,
GdkDevice *source_device,
guint32 time,
GdkModifierType state,
double x,
@ -2025,7 +1980,7 @@ gdk_touch_event_new (GdkEventType type,
type == GDK_TOUCH_UPDATE ||
type == GDK_TOUCH_CANCEL, NULL);
self = gdk_event_alloc (type, surface, device, source_device, time);
self = gdk_event_alloc (type, surface, device, time);
self->sequence = sequence;
self->state = state;
self->x = x;
@ -2114,7 +2069,6 @@ GdkEvent *
gdk_crossing_event_new (GdkEventType type,
GdkSurface *surface,
GdkDevice *device,
GdkDevice *source_device,
guint32 time,
GdkModifierType state,
double x,
@ -2127,7 +2081,7 @@ gdk_crossing_event_new (GdkEventType type,
g_return_val_if_fail (type == GDK_ENTER_NOTIFY ||
type == GDK_LEAVE_NOTIFY, NULL);
self = gdk_event_alloc (type, surface, device, source_device, time);
self = gdk_event_alloc (type, surface, device, time);
self->state = state;
self->x = x;
@ -2220,7 +2174,7 @@ GDK_DEFINE_EVENT_TYPE (GdkDeleteEvent, gdk_delete_event,
GdkEvent *
gdk_delete_event_new (GdkSurface *surface)
{
return gdk_event_alloc (GDK_DELETE, surface, NULL, NULL, GDK_CURRENT_TIME);
return gdk_event_alloc (GDK_DELETE, surface, NULL, GDK_CURRENT_TIME);
}
/* }}} */
@ -2245,10 +2199,9 @@ GDK_DEFINE_EVENT_TYPE (GdkFocusEvent, gdk_focus_event,
GdkEvent *
gdk_focus_event_new (GdkSurface *surface,
GdkDevice *device,
GdkDevice *source_device,
gboolean focus_in)
{
GdkFocusEvent *self = gdk_event_alloc (GDK_FOCUS_CHANGE, surface, device, source_device, GDK_CURRENT_TIME);
GdkFocusEvent *self = gdk_event_alloc (GDK_FOCUS_CHANGE, surface, device, GDK_CURRENT_TIME);
self->focus_in = focus_in;
@ -2325,7 +2278,6 @@ GDK_DEFINE_EVENT_TYPE (GdkScrollEvent, gdk_scroll_event,
GdkEvent *
gdk_scroll_event_new (GdkSurface *surface,
GdkDevice *device,
GdkDevice *source_device,
GdkDeviceTool *tool,
guint32 time,
GdkModifierType state,
@ -2333,7 +2285,7 @@ gdk_scroll_event_new (GdkSurface *surface,
double delta_y,
gboolean is_stop)
{
GdkScrollEvent *self = gdk_event_alloc (GDK_SCROLL, surface, device, source_device, time);
GdkScrollEvent *self = gdk_event_alloc (GDK_SCROLL, surface, device, time);
self->tool = tool != NULL ? g_object_ref (tool) : NULL;
self->state = state;
@ -2348,14 +2300,13 @@ gdk_scroll_event_new (GdkSurface *surface,
GdkEvent *
gdk_scroll_event_new_discrete (GdkSurface *surface,
GdkDevice *device,
GdkDevice *source_device,
GdkDeviceTool *tool,
guint32 time,
GdkModifierType state,
GdkScrollDirection direction,
gboolean emulated)
{
GdkScrollEvent *self = gdk_event_alloc (GDK_SCROLL, surface, device, source_device, time);
GdkScrollEvent *self = gdk_event_alloc (GDK_SCROLL, surface, device, time);
self->tool = tool != NULL ? g_object_ref (tool) : NULL;
self->state = state;
@ -2478,7 +2429,6 @@ GDK_DEFINE_EVENT_TYPE (GdkTouchpadEvent, gdk_touchpad_event,
GdkEvent *
gdk_touchpad_event_new_swipe (GdkSurface *surface,
GdkDevice *device,
GdkDevice *source_device,
guint32 time,
GdkModifierType state,
GdkTouchpadGesturePhase phase,
@ -2488,7 +2438,7 @@ gdk_touchpad_event_new_swipe (GdkSurface *surface,
double dx,
double dy)
{
GdkTouchpadEvent *self = gdk_event_alloc (GDK_TOUCHPAD_SWIPE, surface, device, source_device, time);
GdkTouchpadEvent *self = gdk_event_alloc (GDK_TOUCHPAD_SWIPE, surface, device, time);
self->state = state;
self->phase = phase;
@ -2504,7 +2454,6 @@ gdk_touchpad_event_new_swipe (GdkSurface *surface,
GdkEvent *
gdk_touchpad_event_new_pinch (GdkSurface *surface,
GdkDevice *device,
GdkDevice *source_device,
guint32 time,
GdkModifierType state,
GdkTouchpadGesturePhase phase,
@ -2516,7 +2465,7 @@ gdk_touchpad_event_new_pinch (GdkSurface *surface,
double scale,
double angle_delta)
{
GdkTouchpadEvent *self = gdk_event_alloc (GDK_TOUCHPAD_PINCH, surface, device, source_device, time);
GdkTouchpadEvent *self = gdk_event_alloc (GDK_TOUCHPAD_PINCH, surface, device, time);
self->state = state;
self->phase = phase;
@ -2658,14 +2607,13 @@ GDK_DEFINE_EVENT_TYPE (GdkPadEvent, gdk_pad_event,
GdkEvent *
gdk_pad_event_new_ring (GdkSurface *surface,
GdkDevice *device,
GdkDevice *source_device,
guint32 time,
guint group,
guint index,
guint mode,
double value)
{
GdkPadEvent *self = gdk_event_alloc (GDK_PAD_RING, surface, device, source_device, time);
GdkPadEvent *self = gdk_event_alloc (GDK_PAD_RING, surface, device, time);
self->group = group;
self->index = index;
@ -2678,14 +2626,13 @@ gdk_pad_event_new_ring (GdkSurface *surface,
GdkEvent *
gdk_pad_event_new_strip (GdkSurface *surface,
GdkDevice *device,
GdkDevice *source_device,
guint32 time,
guint group,
guint index,
guint mode,
double value)
{
GdkPadEvent *self = gdk_event_alloc (GDK_PAD_STRIP, surface, device, source_device, time);
GdkPadEvent *self = gdk_event_alloc (GDK_PAD_STRIP, surface, device, time);
self->group = group;
self->index = index;
@ -2699,7 +2646,6 @@ GdkEvent *
gdk_pad_event_new_button (GdkEventType type,
GdkSurface *surface,
GdkDevice *device,
GdkDevice *source_device,
guint32 time,
guint group,
guint button,
@ -2710,7 +2656,7 @@ gdk_pad_event_new_button (GdkEventType type,
g_return_val_if_fail (type == GDK_PAD_BUTTON_PRESS ||
type == GDK_PAD_BUTTON_RELEASE, NULL);
self = gdk_event_alloc (type, surface, device, source_device, time);
self = gdk_event_alloc (type, surface, device, time);
self->group = group;
self->button = button;
@ -2722,12 +2668,11 @@ gdk_pad_event_new_button (GdkEventType type,
GdkEvent *
gdk_pad_event_new_group_mode (GdkSurface *surface,
GdkDevice *device,
GdkDevice *source_device,
guint32 time,
guint group,
guint mode)
{
GdkPadEvent *self = gdk_event_alloc (GDK_PAD_GROUP_MODE, surface, device, source_device, time);
GdkPadEvent *self = gdk_event_alloc (GDK_PAD_GROUP_MODE, surface, device, time);
self->group = group;
self->mode = mode;
@ -2856,7 +2801,7 @@ gdk_motion_event_get_axes (GdkEvent *event,
guint *n_axes)
{
GdkMotionEvent *self = (GdkMotionEvent *) event;
GdkDevice *source_device = gdk_event_get_source_device (event);
GdkDevice *source_device = gdk_event_get_device (event);
if (source_device == NULL)
return FALSE;
@ -2885,7 +2830,6 @@ GDK_DEFINE_EVENT_TYPE (GdkMotionEvent, gdk_motion_event,
GdkEvent *
gdk_motion_event_new (GdkSurface *surface,
GdkDevice *device,
GdkDevice *source_device,
GdkDeviceTool *tool,
guint32 time,
GdkModifierType state,
@ -2893,7 +2837,7 @@ gdk_motion_event_new (GdkSurface *surface,
double y,
double *axes)
{
GdkMotionEvent *self = gdk_event_alloc (GDK_MOTION_NOTIFY, surface, device, source_device, time);
GdkMotionEvent *self = gdk_event_alloc (GDK_MOTION_NOTIFY, surface, device, time);
self->tool = tool ? g_object_ref (tool) : NULL;
self->state = state;
@ -3001,7 +2945,6 @@ GdkEvent *
gdk_proximity_event_new (GdkEventType type,
GdkSurface *surface,
GdkDevice *device,
GdkDevice *source_device,
GdkDeviceTool *tool,
guint32 time)
{
@ -3010,7 +2953,7 @@ gdk_proximity_event_new (GdkEventType type,
g_return_val_if_fail (type == GDK_PROXIMITY_IN ||
type == GDK_PROXIMITY_OUT, NULL);
self = gdk_event_alloc (type, surface, device, source_device, time);
self = gdk_event_alloc (type, surface, device, time);
self->tool = tool ? g_object_ref (tool) : NULL;
@ -3086,7 +3029,7 @@ gdk_dnd_event_new (GdkEventType type,
type == GDK_DRAG_LEAVE ||
type == GDK_DROP_START, NULL);
self = gdk_event_alloc (type, surface, device, NULL, time);
self = gdk_event_alloc (type, surface, device, time);
self->drop = drop != NULL ? g_object_ref (drop) : NULL;
self->x = x;
@ -3139,11 +3082,10 @@ GDK_DEFINE_EVENT_TYPE (GdkGrabBrokenEvent, gdk_grab_broken_event,
GdkEvent *
gdk_grab_broken_event_new (GdkSurface *surface,
GdkDevice *device,
GdkDevice *source_device,
GdkSurface *grab_surface,
gboolean implicit)
{
GdkGrabBrokenEvent *self = gdk_event_alloc (GDK_GRAB_BROKEN, surface, device, source_device, GDK_CURRENT_TIME);
GdkGrabBrokenEvent *self = gdk_event_alloc (GDK_GRAB_BROKEN, surface, device, GDK_CURRENT_TIME);
self->grab_surface = grab_surface;
self->implicit = implicit;

View File

@ -350,9 +350,6 @@ GdkSeat * gdk_event_get_seat (GdkEvent *event);
GDK_AVAILABLE_IN_ALL
GdkDevice * gdk_event_get_device (GdkEvent *event);
GDK_AVAILABLE_IN_ALL
GdkDevice * gdk_event_get_source_device (GdkEvent *event);
GDK_AVAILABLE_IN_ALL
GdkDeviceTool * gdk_event_get_device_tool (GdkEvent *event);

View File

@ -42,7 +42,6 @@ typedef struct _GdkEventClass GdkEventClass;
* @event_type: the specialized event type
* @surface: the surface of the event
* @device: the device of the event
* @source_device: the source device
* @time: a serial identifier of the event that can be used to order
* two events
* @flags: event flags
@ -63,7 +62,6 @@ struct _GdkEvent
/* The devices associated to the event */
GdkDevice *device;
GdkDevice *source_device;
guint32 time;
guint16 flags;
@ -450,7 +448,6 @@ void gdk_event_init_types (void);
GdkEvent * gdk_button_event_new (GdkEventType type,
GdkSurface *surface,
GdkDevice *device,
GdkDevice *source_device,
GdkDeviceTool *tool,
guint32 time,
GdkModifierType state,
@ -461,7 +458,6 @@ GdkEvent * gdk_button_event_new (GdkEventType type,
GdkEvent * gdk_motion_event_new (GdkSurface *surface,
GdkDevice *device,
GdkDevice *source_device,
GdkDeviceTool *tool,
guint32 time,
GdkModifierType state,
@ -472,7 +468,6 @@ GdkEvent * gdk_motion_event_new (GdkSurface *surface,
GdkEvent * gdk_crossing_event_new (GdkEventType type,
GdkSurface *surface,
GdkDevice *device,
GdkDevice *source_device,
guint32 time,
GdkModifierType state,
double x,
@ -483,14 +478,12 @@ GdkEvent * gdk_crossing_event_new (GdkEventType type,
GdkEvent * gdk_proximity_event_new (GdkEventType type,
GdkSurface *surface,
GdkDevice *device,
GdkDevice *source_device,
GdkDeviceTool *tool,
guint32 time);
GdkEvent * gdk_key_event_new (GdkEventType type,
GdkSurface *surface,
GdkDevice *device,
GdkDevice *source_device,
guint32 time,
guint keycode,
GdkModifierType modifiers,
@ -500,7 +493,6 @@ GdkEvent * gdk_key_event_new (GdkEventType type,
GdkEvent * gdk_focus_event_new (GdkSurface *surface,
GdkDevice *device,
GdkDevice *source_device,
gboolean focus_in);
GdkEvent * gdk_configure_event_new (GdkSurface *surface,
@ -511,7 +503,6 @@ GdkEvent * gdk_delete_event_new (GdkSurface *surface);
GdkEvent * gdk_scroll_event_new (GdkSurface *surface,
GdkDevice *device,
GdkDevice *source_device,
GdkDeviceTool *tool,
guint32 time,
GdkModifierType state,
@ -521,7 +512,6 @@ GdkEvent * gdk_scroll_event_new (GdkSurface *surface,
GdkEvent * gdk_scroll_event_new_discrete (GdkSurface *surface,
GdkDevice *device,
GdkDevice *source_device,
GdkDeviceTool *tool,
guint32 time,
GdkModifierType state,
@ -532,7 +522,6 @@ GdkEvent * gdk_touch_event_new (GdkEventType type,
GdkEventSequence *sequence,
GdkSurface *surface,
GdkDevice *device,
GdkDevice *source_device,
guint32 time,
GdkModifierType state,
double x,
@ -542,7 +531,6 @@ GdkEvent * gdk_touch_event_new (GdkEventType type,
GdkEvent * gdk_touchpad_event_new_swipe (GdkSurface *surface,
GdkDevice *device,
GdkDevice *source_device,
guint32 time,
GdkModifierType state,
GdkTouchpadGesturePhase phase,
@ -554,7 +542,6 @@ GdkEvent * gdk_touchpad_event_new_swipe (GdkSurface *surface,
GdkEvent * gdk_touchpad_event_new_pinch (GdkSurface *surface,
GdkDevice *device,
GdkDevice *source_device,
guint32 time,
GdkModifierType state,
GdkTouchpadGesturePhase phase,
@ -568,7 +555,6 @@ GdkEvent * gdk_touchpad_event_new_pinch (GdkSurface *surface,
GdkEvent * gdk_pad_event_new_ring (GdkSurface *surface,
GdkDevice *device,
GdkDevice *source_device,
guint32 time,
guint group,
guint index,
@ -577,7 +563,6 @@ GdkEvent * gdk_pad_event_new_ring (GdkSurface *surface,
GdkEvent * gdk_pad_event_new_strip (GdkSurface *surface,
GdkDevice *device,
GdkDevice *source_device,
guint32 time,
guint group,
guint index,
@ -587,7 +572,6 @@ GdkEvent * gdk_pad_event_new_strip (GdkSurface *surface,
GdkEvent * gdk_pad_event_new_button (GdkEventType type,
GdkSurface *surface,
GdkDevice *device,
GdkDevice *source_device,
guint32 time,
guint group,
guint button,
@ -595,7 +579,6 @@ GdkEvent * gdk_pad_event_new_button (GdkEventType type,
GdkEvent * gdk_pad_event_new_group_mode (GdkSurface *surface,
GdkDevice *device,
GdkDevice *source_device,
guint32 time,
guint group,
guint mode);
@ -610,7 +593,6 @@ GdkEvent * gdk_dnd_event_new (GdkEventType type,
GdkEvent * gdk_grab_broken_event_new (GdkSurface *surface,
GdkDevice *device,
GdkDevice *source_device,
GdkSurface *grab_surface,
gboolean implicit);

View File

@ -2222,13 +2222,12 @@ _gdk_windowing_got_event (GdkDisplay *display,
gboolean unlink_event = FALSE;
GdkDeviceGrabInfo *button_release_grab;
GdkPointerSurfaceInfo *pointer_info = NULL;
GdkDevice *device, *source_device;
GdkDevice *device;
GdkEventType type;
_gdk_display_update_last_event (display, event);
device = gdk_event_get_device (event);
source_device = gdk_event_get_source_device (event);
if (device)
{
@ -2236,12 +2235,7 @@ _gdk_windowing_got_event (GdkDisplay *display,
gdk_device_get_source (device) != GDK_SOURCE_TABLET_PAD)
{
pointer_info = _gdk_display_get_pointer_info (display, device);
if (source_device != pointer_info->last_physical_device &&
gdk_device_get_device_type (source_device) == GDK_DEVICE_TYPE_PHYSICAL)
pointer_info->last_physical_device = source_device;
else if (pointer_info->last_physical_device)
source_device = pointer_info->last_physical_device;
pointer_info->last_physical_device = device;
}
_gdk_display_device_grab_update (display, device, serial);

View File

@ -561,7 +561,6 @@ emulate_crossing (GdkSurface *surface,
event = gdk_crossing_event_new (type,
surface,
device,
device,
time_,
state,
x, y,
@ -586,7 +585,6 @@ emulate_touch_crossing (GdkSurface *surface,
event = gdk_crossing_event_new (type,
surface,
device,
source,
time_,
0,
touch->x, touch->y,
@ -602,7 +600,7 @@ emulate_focus (GdkSurface *surface,
gboolean focus_in,
guint32 time_)
{
GdkEvent *event = gdk_focus_event_new (surface, device, device, focus_in);
GdkEvent *event = gdk_focus_event_new (surface, device, focus_in);
_gdk_wayland_display_deliver_event (gdk_surface_get_display (surface), event);
}
@ -1326,7 +1324,6 @@ flush_discrete_scroll_event (GdkWaylandSeat *seat,
source = get_scroll_device (seat, seat->pointer_info.frame.source);
event = gdk_scroll_event_new_discrete (seat->pointer_info.focus,
seat->logical_pointer,
source,
NULL,
seat->pointer_info.time,
@ -1348,7 +1345,6 @@ flush_smooth_scroll_event (GdkWaylandSeat *seat,
source = get_scroll_device (seat, seat->pointer_info.frame.source);
event = gdk_scroll_event_new (seat->pointer_info.focus,
seat->logical_pointer,
source,
NULL,
seat->pointer_info.time,
@ -1466,7 +1462,6 @@ pointer_handle_enter (void *data,
event = gdk_crossing_event_new (GDK_ENTER_NOTIFY,
seat->pointer_info.focus,
seat->logical_pointer,
seat->pointer,
0,
0,
seat->pointer_info.surface_x,
@ -1521,7 +1516,6 @@ pointer_handle_leave (void *data,
event = gdk_crossing_event_new (GDK_LEAVE_NOTIFY,
seat->pointer_info.focus,
seat->logical_pointer,
seat->pointer,
0,
0,
seat->pointer_info.surface_x,
@ -1565,7 +1559,6 @@ pointer_handle_motion (void *data,
event = gdk_motion_event_new (seat->pointer_info.focus,
seat->logical_pointer,
seat->pointer,
NULL,
time,
device_get_modifiers (seat->logical_pointer),
@ -1629,7 +1622,6 @@ pointer_handle_button (void *data,
event = gdk_button_event_new (state ? GDK_BUTTON_PRESS : GDK_BUTTON_RELEASE,
seat->pointer_info.focus,
seat->logical_pointer,
seat->pointer,
NULL,
time,
device_get_modifiers (seat->logical_pointer),
@ -1893,7 +1885,6 @@ keyboard_handle_enter (void *data,
event = gdk_focus_event_new (seat->keyboard_focus,
seat->logical_keyboard,
seat->keyboard,
TRUE);
GDK_SEAT_NOTE (seat, EVENTS,
@ -1928,7 +1919,6 @@ keyboard_handle_leave (void *data,
event = gdk_focus_event_new (seat->keyboard_focus,
seat->logical_keyboard,
seat->keyboard,
FALSE);
g_object_unref (seat->keyboard_focus);
@ -2055,7 +2045,6 @@ deliver_key_event (GdkWaylandSeat *seat,
event = gdk_key_event_new (state ? GDK_KEY_PRESS : GDK_KEY_RELEASE,
seat->keyboard_focus,
seat->logical_keyboard,
seat->keyboard,
time_,
key,
device_get_modifiers (seat->logical_pointer),
@ -2372,7 +2361,6 @@ touch_handle_down (void *data,
GDK_SLOT_TO_EVENT_SEQUENCE (touch->id),
touch->surface,
seat->logical_touch,
seat->touch,
time,
device_get_modifiers (seat->logical_touch),
touch->x, touch->y,
@ -2415,7 +2403,6 @@ touch_handle_up (void *data,
GDK_SLOT_TO_EVENT_SEQUENCE (touch->id),
touch->surface,
seat->logical_touch,
seat->touch,
time,
device_get_modifiers (seat->logical_touch),
touch->x, touch->y,
@ -2460,7 +2447,6 @@ touch_handle_motion (void *data,
GDK_SLOT_TO_EVENT_SEQUENCE (touch->id),
touch->surface,
seat->logical_touch,
seat->touch,
time,
device_get_modifiers (seat->logical_touch),
touch->x, touch->y,
@ -2506,7 +2492,6 @@ touch_handle_cancel (void *data,
GDK_SLOT_TO_EVENT_SEQUENCE (touch->id),
touch->surface,
seat->logical_touch,
seat->touch,
GDK_CURRENT_TIME,
device_get_modifiers (seat->logical_touch),
touch->x, touch->y,
@ -2535,7 +2520,6 @@ emit_gesture_swipe_event (GdkWaylandSeat *seat,
seat->pointer_info.time = _time;
event = gdk_touchpad_event_new_swipe (seat->pointer_info.focus,
seat->logical_pointer,
seat->pointer,
_time,
device_get_modifiers (seat->logical_pointer),
@ -2632,7 +2616,6 @@ emit_gesture_pinch_event (GdkWaylandSeat *seat,
seat->pointer_info.time = _time;
event = gdk_touchpad_event_new_pinch (seat->pointer_info.focus,
seat->logical_pointer,
seat->pointer,
_time,
device_get_modifiers (seat->logical_pointer),
@ -3054,7 +3037,7 @@ seat_handle_capabilities (void *data,
seat->logical_touch = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
"name", "Wayland Touch Logical Pointer",
"type", GDK_DEVICE_TYPE_LOGICAL,
"source", GDK_SOURCE_MOUSE,
"source", GDK_SOURCE_TOUCHSCREEN,
"has-cursor", TRUE,
"display", seat->display,
"seat", seat,
@ -3102,14 +3085,13 @@ get_scroll_device (GdkWaylandSeat *seat,
{
seat->wheel_scrolling = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
"name", "Wayland Wheel Scrolling",
"type", GDK_DEVICE_TYPE_PHYSICAL,
"type", GDK_DEVICE_TYPE_LOGICAL,
"source", GDK_SOURCE_MOUSE,
"has-cursor", TRUE,
"display", seat->display,
"seat", seat,
NULL);
_gdk_device_set_associated_device (seat->wheel_scrolling, seat->logical_pointer);
gdk_seat_device_added (GDK_SEAT (seat), seat->wheel_scrolling);
gdk_seat_device_added (GDK_SEAT (seat), seat->wheel_scrolling);
}
return seat->wheel_scrolling;
@ -3118,14 +3100,13 @@ get_scroll_device (GdkWaylandSeat *seat,
{
seat->finger_scrolling = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
"name", "Wayland Finger Scrolling",
"type", GDK_DEVICE_TYPE_PHYSICAL,
"type", GDK_DEVICE_TYPE_LOGICAL,
"source", GDK_SOURCE_TOUCHPAD,
"has-cursor", TRUE,
"display", seat->display,
"seat", seat,
NULL);
_gdk_device_set_associated_device (seat->finger_scrolling, seat->logical_pointer);
gdk_seat_device_added (GDK_SEAT (seat), seat->finger_scrolling);
gdk_seat_device_added (GDK_SEAT (seat), seat->finger_scrolling);
}
return seat->finger_scrolling;
@ -3134,14 +3115,13 @@ get_scroll_device (GdkWaylandSeat *seat,
{
seat->continuous_scrolling = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
"name", "Wayland Continuous Scrolling",
"type", GDK_DEVICE_TYPE_PHYSICAL,
"type", GDK_DEVICE_TYPE_LOGICAL,
"source", GDK_SOURCE_TRACKPOINT,
"has-cursor", TRUE,
"display", seat->display,
"seat", seat,
NULL);
_gdk_device_set_associated_device (seat->continuous_scrolling, seat->logical_pointer);
gdk_seat_device_added (GDK_SEAT (seat), seat->continuous_scrolling);
gdk_seat_device_added (GDK_SEAT (seat), seat->continuous_scrolling);
}
return seat->continuous_scrolling;
@ -3428,7 +3408,6 @@ tablet_tool_handle_proximity_in (void *data,
event = gdk_proximity_event_new (GDK_PROXIMITY_IN,
tablet->pointer_info.focus,
tablet->logical_device,
tablet->stylus_device,
tool->tool,
tablet->pointer_info.time);
gdk_wayland_tablet_set_frame_event (tablet, event);
@ -3459,7 +3438,6 @@ tablet_tool_handle_proximity_out (void *data,
event = gdk_proximity_event_new (GDK_PROXIMITY_OUT,
tablet->pointer_info.focus,
tablet->logical_device,
tablet->stylus_device,
tool->tool,
tablet->pointer_info.time);
gdk_wayland_tablet_set_frame_event (tablet, event);
@ -3496,7 +3474,6 @@ tablet_create_button_event_frame (GdkWaylandTabletData *tablet,
event = gdk_button_event_new (evtype,
tablet->pointer_info.focus,
tablet->logical_device,
tablet->stylus_device,
tablet->current_tool->tool,
tablet->pointer_info.time,
device_get_modifiers (seat->logical_pointer),
@ -3561,7 +3538,6 @@ tablet_tool_handle_motion (void *data,
event = gdk_motion_event_new (tablet->pointer_info.focus,
tablet->logical_device,
tablet->stylus_device,
tool->tool,
tablet->pointer_info.time,
device_get_modifiers (tablet->logical_device),
@ -3723,7 +3699,6 @@ tablet_tool_handle_wheel (void *data,
/* Send smooth event */
event = gdk_scroll_event_new (tablet->pointer_info.focus,
tablet->logical_device,
tablet->stylus_device,
tablet->current_tool->tool,
tablet->pointer_info.time,
device_get_modifiers (tablet->logical_device),
@ -3734,7 +3709,6 @@ tablet_tool_handle_wheel (void *data,
/* Send discrete event */
event = gdk_scroll_event_new_discrete (tablet->pointer_info.focus,
tablet->logical_device,
tablet->stylus_device,
tablet->current_tool->tool,
tablet->pointer_info.time,
@ -3845,7 +3819,6 @@ tablet_pad_ring_handle_frame (void *data,
g_message ("tablet pad ring handle frame, ring = %p", wp_tablet_pad_ring));
event = gdk_pad_event_new_ring (seat->keyboard_focus,
pad->device,
pad->device,
time,
g_list_index (pad->mode_groups, group),
@ -3920,7 +3893,6 @@ tablet_pad_strip_handle_frame (void *data,
wp_tablet_pad_strip));
event = gdk_pad_event_new_strip (seat->keyboard_focus,
pad->device,
pad->device,
time,
g_list_index (pad->mode_groups, group),
@ -4046,7 +4018,6 @@ tablet_pad_group_handle_mode (void *data,
n_group = g_list_index (pad->mode_groups, group);
event = gdk_pad_event_new_group_mode (seat->keyboard_focus,
pad->device,
pad->device,
time,
n_group,
@ -4162,7 +4133,6 @@ tablet_pad_handle_button (void *data,
: GDK_PAD_BUTTON_RELEASE,
GDK_WAYLAND_SEAT (pad->seat)->keyboard_focus,
pad->device,
pad->device,
time,
n_group,
button,
@ -4893,7 +4863,7 @@ _gdk_wayland_seat_get_implicit_grab_serial (GdkSeat *seat,
if (event)
{
GdkDevice *source = gdk_event_get_source_device (event);
GdkDevice *source = gdk_event_get_device (event);
GdkWaylandSeat *wayland_seat = GDK_WAYLAND_SEAT (seat);
GList *l;
@ -4976,7 +4946,6 @@ gdk_wayland_device_unset_touch_grab (GdkDevice *gdk_device,
GDK_SLOT_TO_EVENT_SEQUENCE (touch->id),
touch->surface,
seat->logical_touch,
seat->touch,
GDK_CURRENT_TIME,
device_get_modifiers (seat->logical_touch),
touch->x, touch->y,

View File

@ -1061,7 +1061,6 @@ gdk_input_other_event (GdkDisplay *display,
event = gdk_button_event_new (event_type,
window,
device_manager->core_pointer,
GDK_DEVICE (source_device),
NULL,
_gdk_win32_get_next_tick (msg->time),
event_state,
@ -1095,7 +1094,6 @@ gdk_input_other_event (GdkDisplay *display,
event = gdk_motion_event_new (window,
device_manager->core_pointer,
GDK_DEVICE (source_device),
NULL,
_gdk_win32_get_next_tick (msg->time),
event_state,

View File

@ -201,13 +201,11 @@ generate_focus_event (GdkDeviceManagerWin32 *device_manager,
gboolean in)
{
GdkDevice *device;
GdkDevice *source_device;
GdkEvent *event;
device = GDK_DEVICE_MANAGER_WIN32 (device_manager)->core_keyboard;
source_device = GDK_DEVICE_MANAGER_WIN32 (device_manager)->system_keyboard;
event = gdk_focus_event_new (window, device, source_device, in);
event = gdk_focus_event_new (window, device, in);
_gdk_win32_append_event (event);
}
@ -220,22 +218,14 @@ generate_grab_broken_event (GdkDeviceManagerWin32 *device_manager,
{
GdkEvent *event;
GdkDevice *device;
GdkDevice *source_device;
if (keyboard)
{
device = device_manager->core_keyboard;
source_device = device_manager->system_keyboard;
}
device = device_manager->core_keyboard;
else
{
device = device_manager->core_pointer;
source_device = device_manager->system_pointer;
}
device = device_manager->core_pointer;
event = gdk_grab_broken_event_new (window,
device,
source_device,
grab_window,
FALSE);
@ -1079,7 +1069,6 @@ send_crossing_event (GdkDisplay *display,
event = gdk_crossing_event_new (type,
window,
device_manager->core_pointer,
device_manager->system_pointer,
_gdk_win32_get_next_tick (time_),
mask,
pt.x / impl->surface_scale,
@ -1588,7 +1577,6 @@ generate_button_event (GdkEventType type,
event = gdk_button_event_new (type,
window,
device_manager->core_pointer,
device_manager->system_pointer,
NULL,
_gdk_win32_get_next_tick (msg->time),
build_pointer_event_state (msg),
@ -2132,7 +2120,6 @@ gdk_event_translate (MSG *msg,
event = gdk_key_event_new (GDK_KEY_PRESS,
window,
device_manager_win32->core_keyboard,
device_manager_win32->system_keyboard,
_gdk_win32_get_next_tick (msg->time),
0,
0,
@ -2337,7 +2324,6 @@ gdk_event_translate (MSG *msg,
: GDK_KEY_RELEASE,
window,
device_manager_win32->core_keyboard,
device_manager_win32->system_keyboard,
_gdk_win32_get_next_tick (msg->time),
state,
keycode,
@ -2412,7 +2398,6 @@ gdk_event_translate (MSG *msg,
event = gdk_key_event_new (GDK_KEY_PRESS,
window,
device_manager_win32->core_keyboard,
device_manager_win32->system_keyboard,
_gdk_win32_get_next_tick (msg->time),
build_key_event_state (key_state),
0,
@ -2426,7 +2411,6 @@ gdk_event_translate (MSG *msg,
event = gdk_key_event_new (GDK_KEY_RELEASE,
window,
device_manager_win32->core_keyboard,
device_manager_win32->system_keyboard,
_gdk_win32_get_next_tick (msg->time),
build_key_event_state (key_state),
0,
@ -2639,7 +2623,6 @@ gdk_event_translate (MSG *msg,
event = gdk_motion_event_new (window,
device_manager_win32->core_pointer,
device_manager_win32->system_pointer,
NULL,
_gdk_win32_get_next_tick (msg->time),
build_pointer_event_state (msg),
@ -2765,7 +2748,6 @@ gdk_event_translate (MSG *msg,
event = gdk_scroll_event_new (window,
device_manager_win32->core_pointer,
device_manager_win32->system_pointer,
NULL,
_gdk_win32_get_next_tick (msg->time),
build_pointer_event_state (msg),
@ -2788,7 +2770,6 @@ gdk_event_translate (MSG *msg,
event = gdk_scroll_event_new_discrete (window,
device_manager_win32->core_pointer,
device_manager_win32->system_pointer,
NULL,
_gdk_win32_get_next_tick (msg->time),
build_pointer_event_state (msg),

View File

@ -1440,7 +1440,7 @@ _gdk_device_manager_xi2_handle_focus (GdkSurface *surface,
{
GdkEvent *event;
event = gdk_focus_event_new (surface, device, source_device, focus_in);
event = gdk_focus_event_new (surface, device, focus_in);
gdk_display_put_event (gdk_surface_get_display (surface), event);
gdk_event_unref (event);
}
@ -1581,7 +1581,6 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
: GDK_KEY_RELEASE,
surface,
device,
source_device,
xev->time,
xev->detail,
state,
@ -1647,7 +1646,6 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
GUINT_TO_POINTER (xev->sourceid));
event = gdk_scroll_event_new_discrete (surface,
device,
source_device,
NULL,
xev->time,
@ -1681,7 +1679,6 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
: GDK_BUTTON_RELEASE,
surface,
device,
source_device,
source_device->last_tool,
xev->time,
_gdk_x11_device_xi2_translate_state (&xev->mods, &xev->buttons, &xev->group),
@ -1734,7 +1731,6 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
event = gdk_scroll_event_new (surface,
device,
source_device,
NULL,
xev->time,
_gdk_x11_device_xi2_translate_state (&xev->mods, &xev->buttons, &xev->group),
@ -1755,7 +1751,6 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
event = gdk_motion_event_new (surface,
device,
source_device,
source_device->last_tool,
xev->time,
_gdk_x11_device_xi2_translate_state (&xev->mods, &xev->buttons, &xev->group),
@ -1807,7 +1802,6 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
GUINT_TO_POINTER (xev->detail),
surface,
device,
source_device,
xev->time,
state,
x, y,
@ -1855,7 +1849,6 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
GUINT_TO_POINTER (xev->detail),
surface,
device,
source_device,
xev->time,
state,
x, y,
@ -1922,7 +1915,6 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
: GDK_LEAVE_NOTIFY,
surface,
device,
source_device,
xev->time,
state,
(double) xev->event_x / scale,

View File

@ -117,7 +117,6 @@ handle_focus_change (GdkEvent *event)
focus_event = gdk_focus_event_new (gdk_event_get_surface (event),
gdk_event_get_device (event),
gdk_event_get_source_device (event),
focus_in);
gdk_display_put_event (gdk_event_get_display (event), focus_event);
gdk_event_unref (focus_event);
@ -138,7 +137,6 @@ create_synth_crossing_event (GdkEventType evtype,
event = gdk_crossing_event_new (evtype,
gdk_event_get_surface (real_event),
gdk_event_get_device (real_event),
gdk_event_get_source_device (real_event),
gdk_event_get_time (real_event),
gdk_event_get_modifier_state (real_event),
x, y,

View File

@ -258,7 +258,7 @@ gtk_event_controller_scroll_handle_event (GtkEventController *controller,
direction = gdk_scroll_event_get_direction (event);
if (direction == GDK_SCROLL_SMOOTH)
{
GdkDevice *device = gdk_event_get_source_device (event);
GdkDevice *device = gdk_event_get_device (event);
GdkInputSource input_source = gdk_device_get_source (device);
gdk_scroll_event_get_deltas (event, &dx, &dy);

View File

@ -2875,7 +2875,7 @@ gtk_flow_box_click_gesture_released (GtkGestureClick *gesture,
sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
event = gtk_gesture_get_last_event (GTK_GESTURE (gesture), sequence);
source = gdk_device_get_source (gdk_event_get_source_device (event));
source = gdk_device_get_source (gdk_event_get_device (event));
if (source == GDK_SOURCE_TOUCHSCREEN)
modify = !modify;

View File

@ -611,7 +611,7 @@ gtk_gesture_handle_event (GtkEventController *controller,
GdkModifierType state;
GtkWidget *target;
source_device = gdk_event_get_source_device (event);
source_device = gdk_event_get_device (event);
if (!source_device)
return FALSE;

View File

@ -202,7 +202,7 @@ gtk_gesture_click_begin (GtkGesture *gesture,
priv = gtk_gesture_click_get_instance_private (click);
event = gtk_gesture_get_last_event (gesture, sequence);
current = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
device = gdk_event_get_source_device (event);
device = gdk_event_get_device (event);
event_type = gdk_event_get_event_type (event);
if (event_type == GDK_BUTTON_PRESS)

View File

@ -143,7 +143,7 @@ gtk_gesture_single_handle_event (GtkEventController *controller,
gboolean retval, test_touchscreen = FALSE;
GdkEventType event_type;
source_device = gdk_event_get_source_device (event);
source_device = gdk_event_get_device (event);
if (!source_device)
return FALSE;

View File

@ -603,7 +603,6 @@ gtk_im_context_filter_key (GtkIMContext *context,
key = gdk_key_event_new (press ? GDK_KEY_PRESS : GDK_KEY_RELEASE,
surface,
device,
source_device,
time,
keycode,
state,

View File

@ -809,7 +809,6 @@ no_sequence_matches (GtkIMContextSimple *context_simple,
GdkEvent *tmp_event = gdk_key_event_new (GDK_KEY_PRESS,
gdk_event_get_surface (event),
gdk_event_get_device (event),
gdk_event_get_source_device (event),
gdk_event_get_time (event),
priv->compose_buffer[len + i],
gdk_event_get_modifier_state (event),

View File

@ -1849,7 +1849,7 @@ gtk_list_box_click_gesture_released (GtkGestureClick *gesture,
state = gdk_event_get_modifier_state (event);
extend = (state & GDK_SHIFT_MASK) != 0;
modify = (state & GDK_CONTROL_MASK) != 0;
source = gdk_device_get_source (gdk_event_get_source_device (event));
source = gdk_device_get_source (gdk_event_get_device (event));
if (source == GDK_SOURCE_TOUCHSCREEN)
modify = !modify;

View File

@ -1127,7 +1127,6 @@ rewrite_event_for_surface (GdkEvent *event,
return gdk_button_event_new (type,
new_surface,
gdk_event_get_device (event),
gdk_event_get_source_device (event),
gdk_event_get_device_tool (event),
gdk_event_get_time (event),
gdk_event_get_modifier_state (event),
@ -1137,7 +1136,6 @@ rewrite_event_for_surface (GdkEvent *event,
case GDK_MOTION_NOTIFY:
return gdk_motion_event_new (new_surface,
gdk_event_get_device (event),
gdk_event_get_source_device (event),
gdk_event_get_device_tool (event),
gdk_event_get_time (event),
gdk_event_get_modifier_state (event),
@ -1151,7 +1149,6 @@ rewrite_event_for_surface (GdkEvent *event,
gdk_event_get_event_sequence (event),
new_surface,
gdk_event_get_device (event),
gdk_event_get_source_device (event),
gdk_event_get_time (event),
gdk_event_get_modifier_state (event),
x, y,
@ -1161,7 +1158,6 @@ rewrite_event_for_surface (GdkEvent *event,
gdk_touchpad_event_get_deltas (event, &dx, &dy);
return gdk_touchpad_event_new_swipe (new_surface,
gdk_event_get_device (event),
gdk_event_get_source_device (event),
gdk_event_get_time (event),
gdk_event_get_modifier_state (event),
gdk_touchpad_event_get_gesture_phase (event),
@ -1172,7 +1168,6 @@ rewrite_event_for_surface (GdkEvent *event,
gdk_touchpad_event_get_deltas (event, &dx, &dy);
return gdk_touchpad_event_new_pinch (new_surface,
gdk_event_get_device (event),
gdk_event_get_source_device (event),
gdk_event_get_time (event),
gdk_event_get_modifier_state (event),
gdk_touchpad_event_get_gesture_phase (event),
@ -1266,7 +1261,6 @@ rewrite_event_for_toplevel (GdkEvent *event)
return gdk_key_event_new (gdk_event_get_event_type (event),
surface,
gdk_event_get_device (event),
gdk_event_get_source_device (event),
gdk_event_get_time (event),
gdk_key_event_get_keycode (event),
gdk_event_get_modifier_state (event),
@ -1542,6 +1536,17 @@ handle_pointing_event (GdkEvent *event)
type = gdk_event_get_event_type (event);
sequence = gdk_event_get_event_sequence (event);
if (type == GDK_SCROLL &&
(gdk_device_get_source (device) == GDK_SOURCE_TOUCHPAD ||
gdk_device_get_source (device) == GDK_SOURCE_TRACKPOINT ||
gdk_device_get_source (device) == GDK_SOURCE_MOUSE))
{
/* A bit of a kludge, resolve target lookups for scrolling devices
* on the seat pointer.
*/
device = gdk_seat_get_pointer (gdk_event_get_seat (event));
}
switch ((guint) type)
{
case GDK_LEAVE_NOTIFY:

View File

@ -210,7 +210,7 @@ gtk_pad_controller_filter_event (GtkEventController *controller,
return TRUE;
if (pad_controller->pad &&
gdk_event_get_source_device (event) != pad_controller->pad)
gdk_event_get_device (event) != pad_controller->pad)
return TRUE;
return FALSE;
@ -233,7 +233,7 @@ gtk_pad_controller_handle_event (GtkEventController *controller,
if (event_type == GDK_PAD_GROUP_MODE)
{
gtk_pad_controller_handle_mode_switch (pad_controller,
gdk_event_get_source_device (event),
gdk_event_get_device (event),
group,
mode);
return GDK_EVENT_PROPAGATE;

View File

@ -873,7 +873,7 @@ gesture_drag_begin_cb (GtkGestureDrag *gesture,
sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
event = gtk_gesture_get_last_event (GTK_GESTURE (gesture), sequence);
device = gdk_event_get_source_device (event);
device = gdk_event_get_device (event);
paned->panning = FALSE;
is_touch = (gdk_event_get_event_type (event) == GDK_TOUCH_BEGIN ||

View File

@ -1881,7 +1881,7 @@ gtk_range_click_gesture_pressed (GtkGestureClick *gesture,
state_mask = gdk_event_get_modifier_state (event);
shift_pressed = (state_mask & GDK_SHIFT_MASK) != 0;
source_device = gdk_event_get_source_device ((GdkEvent *) event);
source_device = gdk_event_get_device ((GdkEvent *) event);
source = gdk_device_get_source (source_device);
g_object_get (gtk_widget_get_settings (widget),

View File

@ -1254,7 +1254,7 @@ captured_motion (GtkEventController *controller,
state = gtk_event_controller_get_current_event_state (controller);
event = gtk_event_controller_get_current_event (controller);
source_device = gdk_event_get_source_device (event);
source_device = gdk_event_get_device (event);
input_source = gdk_device_get_source (source_device);
if (priv->hscrollbar_visible)

View File

@ -2714,7 +2714,7 @@ gtk_text_click_gesture_pressed (GtkGestureClick *gesture,
sel_end = priv->current_pos;
have_selection = sel_start != sel_end;
source = gdk_event_get_source_device (event);
source = gdk_event_get_device (event);
is_touchscreen = gtk_simulate_touchscreen () ||
gdk_device_get_source (source) == GDK_SOURCE_TOUCHSCREEN;
@ -2991,7 +2991,7 @@ gtk_text_drag_gesture_update (GtkGestureDrag *gesture,
else
tmp_pos = gtk_text_find_position (self, x);
source = gdk_event_get_source_device (event);
source = gdk_event_get_device (event);
input_source = gdk_device_get_source (source);
if (priv->select_words)

View File

@ -5384,7 +5384,7 @@ gtk_text_view_click_gesture_pressed (GtkGestureClick *gesture,
GTK_EVENT_SEQUENCE_CLAIMED);
gtk_text_view_reset_blink_time (text_view);
device = gdk_event_get_source_device ((GdkEvent *) event);
device = gdk_event_get_device ((GdkEvent *) event);
is_touchscreen = gtk_simulate_touchscreen () ||
gdk_device_get_source (device) == GDK_SOURCE_TOUCHSCREEN;
@ -7220,7 +7220,7 @@ gtk_text_view_drag_gesture_update (GtkGestureDrag *gesture,
drag_gesture_get_text_surface_coords (gesture, text_view,
&start_x, &start_y, &x, &y);
device = gdk_event_get_source_device (event);
device = gdk_event_get_device (event);
is_touchscreen = gtk_simulate_touchscreen () ||
gdk_device_get_source (device) == GDK_SOURCE_TOUCHSCREEN;
@ -7355,7 +7355,7 @@ gtk_text_view_drag_gesture_end (GtkGestureDrag *gesture,
return;
event = gtk_gesture_get_last_event (GTK_GESTURE (gesture), sequence);
device = gdk_event_get_source_device (event);
device = gdk_event_get_device (event);
is_touchscreen = gtk_simulate_touchscreen () ||
gdk_device_get_source (device) == GDK_SOURCE_TOUCHSCREEN;

View File

@ -897,7 +897,7 @@ tooltips_enabled (GdkEvent *event)
GDK_BUTTON5_MASK)) != 0)
return FALSE;
source_device = gdk_event_get_source_device (event);
source_device = gdk_event_get_device (event);
if (!source_device)
return FALSE;

View File

@ -1922,7 +1922,6 @@ _gtk_widget_emulate_press (GtkWidget *widget,
gdk_event_get_event_sequence (event),
gdk_event_get_surface (event),
gdk_event_get_device (event),
gdk_event_get_source_device (event),
gdk_event_get_time (event),
gdk_event_get_modifier_state (event),
p.x, p.y,
@ -1934,7 +1933,6 @@ _gtk_widget_emulate_press (GtkWidget *widget,
press = gdk_button_event_new (GDK_BUTTON_PRESS,
gdk_event_get_surface (event),
gdk_event_get_device (event),
gdk_event_get_source_device (event),
gdk_event_get_device_tool (event),
gdk_event_get_time (event),
gdk_event_get_modifier_state (event),
@ -1960,7 +1958,6 @@ _gtk_widget_emulate_press (GtkWidget *widget,
press = gdk_button_event_new (GDK_BUTTON_PRESS,
gdk_event_get_surface (event),
gdk_event_get_device (event),
gdk_event_get_source_device (event),
gdk_event_get_device_tool (event),
gdk_event_get_time (event),
gdk_event_get_modifier_state (event),

View File

@ -21,7 +21,6 @@ key_event_new (GdkEventType event_type,
event->event_type = event_type;
event->surface = g_object_ref (surface);
event->device = g_object_ref (device);
event->source_device = g_object_ref (source_device);
event->time = time_;
key_event->keycode = keycode;