Commit 64decbfd authored by Carlos Garnacho's avatar Carlos Garnacho

gdk: Remove GdkEventType argument from GdkEvent union

It won't stand true anymore that the GdkEventType argument is the
first field of the GdkEvent* structs. All callers have been updated
to use event->any.type instead.
parent b9db0b55
......@@ -1033,7 +1033,7 @@ gdk_drag_context_handle_dest_event (GdkEvent *event)
{
GdkDragContext *context = NULL;
switch ((guint) event->type)
switch ((guint) event->any.type)
{
case GDK_DRAG_MOTION:
case GDK_DROP_START:
......
......@@ -111,7 +111,7 @@ _gdk_event_queue_find_first (GdkDisplay *display)
if (pending_motion)
return pending_motion;
if (event->event.type == GDK_MOTION_NOTIFY && (event->flags & GDK_EVENT_FLUSHED) == 0)
if (event->event.any.type == GDK_MOTION_NOTIFY && (event->flags & GDK_EVENT_FLUSHED) == 0)
pending_motion = tmp_list;
else
return tmp_list;
......@@ -273,7 +273,7 @@ _gdk_event_queue_handle_motion_compression (GdkDisplay *display)
if (event->flags & GDK_EVENT_PENDING)
break;
if (event->event.type != GDK_MOTION_NOTIFY)
if (event->event.any.type != GDK_MOTION_NOTIFY)
break;
if (pending_motion_window != NULL &&
......@@ -288,7 +288,7 @@ _gdk_event_queue_handle_motion_compression (GdkDisplay *display)
break;
pending_motion_window = event->event.any.window;
pending_motion_device = event->motion.device;
pending_motion_device = event->event.motion.device;
pending_motions = tmp_list;
tmp_list = tmp_list->prev;
......@@ -713,7 +713,7 @@ guint32
gdk_event_get_time (const GdkEvent *event)
{
if (event)
switch (event->type)
switch (event->any.type)
{
case GDK_MOTION_NOTIFY:
return event->motion.time;
......@@ -797,7 +797,7 @@ gdk_event_get_state (const GdkEvent *event,
g_return_val_if_fail (state != NULL, FALSE);
if (event)
switch (event->type)
switch (event->any.type)
{
case GDK_MOTION_NOTIFY:
*state = event->motion.state;
......@@ -885,7 +885,7 @@ gdk_event_get_coords (const GdkEvent *event,
g_return_val_if_fail (event != NULL, FALSE);
switch ((guint) event->type)
switch ((guint) event->any.type)
{
case GDK_CONFIGURE:
x = event->configure.x;
......@@ -957,7 +957,7 @@ gdk_event_get_root_coords (const GdkEvent *event,
g_return_val_if_fail (event != NULL, FALSE);
switch ((guint) event->type)
switch ((guint) event->any.type)
{
case GDK_MOTION_NOTIFY:
x = event->motion.x_root;
......@@ -1021,7 +1021,7 @@ gdk_event_set_coords (GdkEvent *event,
{
g_return_if_fail (event != NULL);
switch ((guint) event->type)
switch ((guint) event->any.type)
{
case GDK_CONFIGURE:
event->configure.x = x;
......@@ -1085,7 +1085,7 @@ gdk_event_get_button (const GdkEvent *event,
g_return_val_if_fail (event != NULL, FALSE);
switch ((guint) event->type)
switch ((guint) event->any.type)
{
case GDK_BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
......@@ -1126,7 +1126,7 @@ gdk_event_get_click_count (const GdkEvent *event,
g_return_val_if_fail (event != NULL, FALSE);
switch ((guint) event->type)
switch ((guint) event->any.type)
{
case GDK_BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
......@@ -1161,7 +1161,7 @@ gdk_event_get_keyval (const GdkEvent *event,
gboolean fetched = TRUE;
guint number = 0;
switch ((guint) event->type)
switch ((guint) event->any.type)
{
case GDK_KEY_PRESS:
case GDK_KEY_RELEASE:
......@@ -1182,8 +1182,8 @@ void
gdk_event_set_keyval (GdkEvent *event,
guint keyval)
{
if (event->type == GDK_KEY_PRESS ||
event->type == GDK_KEY_RELEASE)
if (event->any.type == GDK_KEY_PRESS ||
event->any.type == GDK_KEY_RELEASE)
event->key.keyval = keyval;
}
......@@ -1207,7 +1207,7 @@ gdk_event_get_keycode (const GdkEvent *event,
gboolean fetched = TRUE;
guint16 number = 0;
switch ((guint) event->type)
switch ((guint) event->any.type)
{
case GDK_KEY_PRESS:
case GDK_KEY_RELEASE:
......@@ -1237,7 +1237,7 @@ gdk_event_get_key_group (const GdkEvent *event,
{
gboolean fetched = TRUE;
switch ((guint) event->type)
switch ((guint) event->any.type)
{
case GDK_KEY_PRESS:
case GDK_KEY_RELEASE:
......@@ -1265,7 +1265,7 @@ gdk_event_get_string (const GdkEvent *event,
{
gboolean fetched = TRUE;
switch ((guint) event->type)
switch ((guint) event->any.type)
{
case GDK_KEY_PRESS:
case GDK_KEY_RELEASE:
......@@ -1293,7 +1293,7 @@ gdk_event_get_key_is_modifier (const GdkEvent *event,
{
gboolean fetched = TRUE;
switch ((guint) event->type)
switch ((guint) event->any.type)
{
case GDK_KEY_PRESS:
case GDK_KEY_RELEASE:
......@@ -1326,7 +1326,7 @@ gdk_event_get_scroll_direction (const GdkEvent *event,
gboolean fetched = TRUE;
GdkScrollDirection dir = 0;
switch ((guint) event->type)
switch ((guint) event->any.type)
{
case GDK_SCROLL:
if (event->scroll.direction == GDK_SCROLL_SMOOTH)
......@@ -1366,7 +1366,7 @@ gdk_event_get_scroll_deltas (const GdkEvent *event,
gdouble dx = 0.0;
gdouble dy = 0.0;
switch ((guint) event->type)
switch ((guint) event->any.type)
{
case GDK_SCROLL:
if (event->scroll.direction == GDK_SCROLL_SMOOTH)
......@@ -1438,7 +1438,7 @@ gdk_event_get_axis (const GdkEvent *event,
{
gdouble x, y;
switch ((guint) event->type)
switch ((guint) event->any.type)
{
case GDK_MOTION_NOTIFY:
x = event->motion.x;
......@@ -1477,21 +1477,21 @@ gdk_event_get_axis (const GdkEvent *event,
return TRUE;
}
else if (event->type == GDK_BUTTON_PRESS ||
event->type == GDK_BUTTON_RELEASE)
else if (event->any.type == GDK_BUTTON_PRESS ||
event->any.type == GDK_BUTTON_RELEASE)
{
device = event->button.device;
axes = event->button.axes;
}
else if (event->type == GDK_TOUCH_BEGIN ||
event->type == GDK_TOUCH_UPDATE ||
event->type == GDK_TOUCH_END ||
event->type == GDK_TOUCH_CANCEL)
else if (event->any.type == GDK_TOUCH_BEGIN ||
event->any.type == GDK_TOUCH_UPDATE ||
event->any.type == GDK_TOUCH_END ||
event->any.type == GDK_TOUCH_CANCEL)
{
device = event->touch.device;
axes = event->touch.axes;
}
else if (event->type == GDK_MOTION_NOTIFY)
else if (event->any.type == GDK_MOTION_NOTIFY)
{
device = event->motion.device;
axes = event->motion.axes;
......@@ -1525,7 +1525,7 @@ gdk_event_set_device (GdkEvent *event,
g_set_object (&private->device, device);
switch ((guint) event->type)
switch ((guint) event->any.type)
{
case GDK_MOTION_NOTIFY:
event->motion.device = device;
......@@ -1576,7 +1576,7 @@ gdk_event_get_device (const GdkEvent *event)
return private->device;
}
switch ((guint) event->type)
switch ((guint) event->any.type)
{
case GDK_MOTION_NOTIFY:
return event->motion.device;
......@@ -1593,6 +1593,20 @@ gdk_event_get_device (const GdkEvent *event)
case GDK_PROXIMITY_IN:
case GDK_PROXIMITY_OUT:
return event->proximity.device;
default:
break;
}
/* Fallback if event has no device set */
switch (event->any.type)
{
case GDK_MOTION_NOTIFY:
case GDK_BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
case GDK_TOUCH_BEGIN:
case GDK_TOUCH_UPDATE:
case GDK_TOUCH_END:
case GDK_TOUCH_CANCEL:
case GDK_ENTER_NOTIFY:
case GDK_LEAVE_NOTIFY:
case GDK_FOCUS_CHANGE:
......@@ -1611,13 +1625,13 @@ gdk_event_get_device (const GdkEvent *event)
g_warning ("Event with type %d not holding a GdkDevice. "
"It is most likely synthesized outside Gdk/GTK+",
event->type);
event->any.type);
display = gdk_window_get_display (event->any.window);
seat = gdk_display_get_default_seat (display);
if (event->type == GDK_KEY_PRESS ||
event->type == GDK_KEY_RELEASE)
if (event->any.type == GDK_KEY_PRESS ||
event->any.type == GDK_KEY_RELEASE)
return gdk_seat_get_keyboard (seat);
else
return gdk_seat_get_pointer (seat);
......@@ -1714,7 +1728,7 @@ gdk_event_triggers_context_menu (const GdkEvent *event)
{
g_return_val_if_fail (event != NULL, FALSE);
if (event->type == GDK_BUTTON_PRESS)
if (event->any.type == GDK_BUTTON_PRESS)
{
const GdkEventButton *bevent = (const GdkEventButton *) event;
GdkDisplay *display;
......@@ -1920,10 +1934,10 @@ gdk_event_get_event_sequence (const GdkEvent *event)
if (!event)
return NULL;
if (event->type == GDK_TOUCH_BEGIN ||
event->type == GDK_TOUCH_UPDATE ||
event->type == GDK_TOUCH_END ||
event->type == GDK_TOUCH_CANCEL)
if (event->any.type == GDK_TOUCH_BEGIN ||
event->any.type == GDK_TOUCH_UPDATE ||
event->any.type == GDK_TOUCH_END ||
event->any.type == GDK_TOUCH_CANCEL)
return event->touch.sequence;
return NULL;
......@@ -2087,7 +2101,7 @@ gdk_event_get_event_type (const GdkEvent *event)
{
g_return_val_if_fail (event != NULL, GDK_NOTHING);
return event->type;
return event->any.type;
}
/**
......@@ -2116,7 +2130,7 @@ gdk_event_get_seat (const GdkEvent *event)
g_warning ("Event with type %d not holding a GdkSeat. "
"It is most likely synthesized outside Gdk/GTK+",
event->type);
event->any.type);
device = gdk_event_get_device (event);
......@@ -2273,12 +2287,12 @@ gdk_event_get_drag_context (const GdkEvent *event,
if (!event)
return FALSE;
if (event->type == GDK_DRAG_ENTER ||
event->type == GDK_DRAG_LEAVE ||
event->type == GDK_DRAG_MOTION ||
event->type == GDK_DRAG_STATUS ||
event->type == GDK_DROP_START ||
event->type == GDK_DROP_FINISHED)
if (event->any.type == GDK_DRAG_ENTER ||
event->any.type == GDK_DRAG_LEAVE ||
event->any.type == GDK_DRAG_MOTION ||
event->any.type == GDK_DRAG_STATUS ||
event->any.type == GDK_DROP_START ||
event->any.type == GDK_DROP_FINISHED)
{
*context = event->dnd.context;
return TRUE;
......@@ -2301,8 +2315,8 @@ gdk_event_get_crossing_mode (const GdkEvent *event,
if (!event)
return FALSE;
if (event->type == GDK_ENTER_NOTIFY ||
event->type == GDK_LEAVE_NOTIFY)
if (event->any.type == GDK_ENTER_NOTIFY ||
event->any.type == GDK_LEAVE_NOTIFY)
{
*mode = event->crossing.mode;
return TRUE;
......@@ -2325,8 +2339,8 @@ gdk_event_get_crossing_detail (const GdkEvent *event,
if (!event)
return FALSE;
if (event->type == GDK_ENTER_NOTIFY ||
event->type == GDK_LEAVE_NOTIFY)
if (event->any.type == GDK_ENTER_NOTIFY ||
event->any.type == GDK_LEAVE_NOTIFY)
{
*detail = event->crossing.detail;
return TRUE;
......@@ -2349,12 +2363,12 @@ gdk_event_get_touchpad_gesture_phase (const GdkEvent *event,
if (!event)
return FALSE;
if (event->type == GDK_TOUCHPAD_PINCH)
if (event->any.type == GDK_TOUCHPAD_PINCH)
{
*phase = event->touchpad_pinch.phase;
return TRUE;
}
else if (event->type == GDK_TOUCHPAD_SWIPE)
else if (event->any.type == GDK_TOUCHPAD_SWIPE)
{
*phase = event->touchpad_swipe.phase;
return TRUE;
......@@ -2377,12 +2391,12 @@ gdk_event_get_touchpad_gesture_n_fingers (const GdkEvent *event,
if (!event)
return FALSE;
if (event->type == GDK_TOUCHPAD_PINCH)
if (event->any.type == GDK_TOUCHPAD_PINCH)
{
*n_fingers = event->touchpad_pinch.n_fingers;
return TRUE;
}
else if (event->type == GDK_TOUCHPAD_SWIPE)
else if (event->any.type == GDK_TOUCHPAD_SWIPE)
{
*n_fingers = event->touchpad_swipe.n_fingers;
return TRUE;
......@@ -2407,13 +2421,13 @@ gdk_event_get_touchpad_deltas (const GdkEvent *event,
if (!event)
return FALSE;
if (event->type == GDK_TOUCHPAD_PINCH)
if (event->any.type == GDK_TOUCHPAD_PINCH)
{
*dx = event->touchpad_pinch.dx;
*dy = event->touchpad_pinch.dy;
return TRUE;
}
else if (event->type == GDK_TOUCHPAD_SWIPE)
else if (event->any.type == GDK_TOUCHPAD_SWIPE)
{
*dx = event->touchpad_swipe.dx;
*dy = event->touchpad_swipe.dy;
......@@ -2437,7 +2451,7 @@ gdk_event_get_touchpad_angle_delta (const GdkEvent *event,
if (!event)
return FALSE;
if (event->type == GDK_TOUCHPAD_PINCH)
if (event->any.type == GDK_TOUCHPAD_PINCH)
{
*delta = event->touchpad_pinch.angle_delta;
return TRUE;
......@@ -2460,7 +2474,7 @@ gdk_event_get_touchpad_scale (const GdkEvent *event,
if (!event)
return FALSE;
if (event->type == GDK_TOUCHPAD_PINCH)
if (event->any.type == GDK_TOUCHPAD_PINCH)
{
*scale = event->touchpad_pinch.scale;
return TRUE;
......@@ -2483,9 +2497,9 @@ gdk_event_get_touch_emulating_pointer (const GdkEvent *event,
if (!event)
return FALSE;
if (event->type == GDK_TOUCH_BEGIN ||
event->type == GDK_TOUCH_UPDATE ||
event->type == GDK_TOUCH_END)
if (event->any.type == GDK_TOUCH_BEGIN ||
event->any.type == GDK_TOUCH_UPDATE ||
event->any.type == GDK_TOUCH_END)
{
*emulating = event->touch.emulating_pointer;
return TRUE;
......@@ -2508,7 +2522,7 @@ gdk_event_get_grab_window (const GdkEvent *event,
if (!event)
return FALSE;
if (event->type == GDK_GRAB_BROKEN)
if (event->any.type == GDK_GRAB_BROKEN)
{
*window = event->grab_broken.grab_window;
return TRUE;
......@@ -2534,7 +2548,7 @@ gdk_event_get_window_state (const GdkEvent *event,
if (!event)
return FALSE;
if (event->type == GDK_WINDOW_STATE)
if (event->any.type == GDK_WINDOW_STATE)
{
*changed = event->window_state.changed_mask;
*new_state = event->window_state.new_window_state;
......@@ -2558,7 +2572,7 @@ gdk_event_get_focus_in (const GdkEvent *event,
if (!event)
return FALSE;
if (event->type == GDK_FOCUS_CHANGE)
if (event->any.type == GDK_FOCUS_CHANGE)
{
*focus_in = event->focus_change.in;
return TRUE;
......@@ -2583,21 +2597,21 @@ gdk_event_get_pad_group_mode (const GdkEvent *event,
if (!event)
return FALSE;
if (event->type == GDK_PAD_GROUP_MODE)
if (event->any.type == GDK_PAD_GROUP_MODE)
{
*group = event->pad_group_mode.group;
*mode = event->pad_group_mode.mode;
return TRUE;
}
else if (event->type == GDK_PAD_BUTTON_PRESS ||
event->type == GDK_PAD_BUTTON_RELEASE)
else if (event->any.type == GDK_PAD_BUTTON_PRESS ||
event->any.type == GDK_PAD_BUTTON_RELEASE)
{
*group = event->pad_button.group;
*mode = event->pad_button.mode;
return TRUE;
}
else if (event->type == GDK_PAD_RING ||
event->type == GDK_PAD_STRIP)
else if (event->any.type == GDK_PAD_RING ||
event->any.type == GDK_PAD_STRIP)
{
*group = event->pad_axis.group;
*mode = event->pad_axis.mode;
......@@ -2621,8 +2635,8 @@ gdk_event_get_pad_button (const GdkEvent *event,
if (!event)
return FALSE;
if (event->type == GDK_PAD_BUTTON_PRESS ||
event->type == GDK_PAD_BUTTON_RELEASE)
if (event->any.type == GDK_PAD_BUTTON_PRESS ||
event->any.type == GDK_PAD_BUTTON_RELEASE)
{
*button = event->pad_button.button;
return TRUE;
......@@ -2647,8 +2661,8 @@ gdk_event_get_pad_axis_value (const GdkEvent *event,
if (!event)
return FALSE;
if (event->type == GDK_PAD_RING ||
event->type == GDK_PAD_STRIP)
if (event->any.type == GDK_PAD_RING ||
event->any.type == GDK_PAD_STRIP)
{
*index = event->pad_axis.index;
*value = event->pad_axis.value;
......@@ -2674,7 +2688,7 @@ gdk_event_get_property (const GdkEvent *event,
if (!event)
return FALSE;
if (event->type == GDK_PROPERTY_NOTIFY)
if (event->any.type == GDK_PROPERTY_NOTIFY)
{
*property = event->property.atom;
*state = event->property.state;
......@@ -2707,14 +2721,14 @@ gdk_event_get_axes (GdkEvent *event,
if (!source_device)
return FALSE;
if (event->type == GDK_MOTION_NOTIFY)
if (event->any.type == GDK_MOTION_NOTIFY)
{
*axes = event->motion.axes;
*n_axes = gdk_device_get_n_axes (source_device);
return TRUE;
}
else if (event->type == GDK_BUTTON_PRESS ||
event->type == GDK_BUTTON_RELEASE)
else if (event->any.type == GDK_BUTTON_PRESS ||
event->any.type == GDK_BUTTON_RELEASE)
{
*axes = event->button.axes;
*n_axes = gdk_device_get_n_axes (source_device);
......
......@@ -687,7 +687,6 @@ struct _GdkEventPadGroupMode {
*/
union _GdkEvent
{
GdkEventType type;
GdkEventAny any;
GdkEventExpose expose;
GdkEventMotion motion;
......
......@@ -5670,7 +5670,7 @@ _gdk_windowing_got_event (GdkDisplay *display,
goto out;
#ifdef DEBUG_WINDOW_PRINTING
if (event->type == GDK_KEY_PRESS &&
if (event->any.type == GDK_KEY_PRESS &&
(event->key.keyval == 0xa7 ||
event->key.keyval == 0xbd))
{
......@@ -5681,17 +5681,17 @@ _gdk_windowing_got_event (GdkDisplay *display,
if (event_window->window_type == GDK_WINDOW_ROOT)
goto out;
if (event->type == GDK_ENTER_NOTIFY)
if (event->any.type == GDK_ENTER_NOTIFY)
_gdk_display_set_window_under_pointer (display, device, event_window);
else if (event->type == GDK_LEAVE_NOTIFY)
else if (event->any.type == GDK_LEAVE_NOTIFY)
_gdk_display_set_window_under_pointer (display, device, NULL);
if ((event->type == GDK_BUTTON_RELEASE ||
event->type == GDK_TOUCH_CANCEL ||
event->type == GDK_TOUCH_END) &&
if ((event->any.type == GDK_BUTTON_RELEASE ||
event->any.type == GDK_TOUCH_CANCEL ||
event->any.type == GDK_TOUCH_END) &&
!event->any.send_event)
{
if (event->type == GDK_BUTTON_RELEASE ||
if (event->any.type == GDK_BUTTON_RELEASE ||
gdk_event_get_pointer_emulated (event))
{
button_release_grab =
......
......@@ -1344,7 +1344,7 @@ gdk_wayland_seat_get_frame_event (GdkWaylandSeat *seat,
GdkEventType evtype)
{
if (seat->pointer_info.frame.event &&
seat->pointer_info.frame.event->type != evtype)
seat->pointer_info.frame.event->any.type != evtype)
gdk_wayland_seat_flush_frame_event (seat);
seat->pointer_info.frame.event = gdk_event_new (evtype);
......@@ -2461,7 +2461,7 @@ emit_gesture_swipe_event (GdkWaylandSeat *seat,
GDK_NOTE (EVENTS,
g_message ("swipe event %d, coords: %f %f, seat %p state %d",
event->type, event->touchpad_swipe.x,
event->any.type, event->touchpad_swipe.x,
event->touchpad_swipe.y, seat,
event->touchpad_swipe.state));
......@@ -2565,7 +2565,7 @@ emit_gesture_pinch_event (GdkWaylandSeat *seat,
GDK_NOTE (EVENTS,
g_message ("pinch event %d, coords: %f %f, seat %p state %d",
event->type, event->touchpad_pinch.x,
event->any.type, event->touchpad_pinch.x,
event->touchpad_pinch.y, seat,
event->touchpad_pinch.state));
......@@ -3244,7 +3244,7 @@ gdk_wayland_tablet_flush_frame_event (GdkWaylandTabletData *tablet,
if (!event)
return;
switch ((guint) event->type)
switch ((guint) event->any.type)
{
case GDK_MOTION_NOTIFY:
event->motion.time = time;
......@@ -3272,7 +3272,7 @@ gdk_wayland_tablet_flush_frame_event (GdkWaylandTabletData *tablet,
return;
}
if (event->type == GDK_PROXIMITY_OUT)
if (event->any.type == GDK_PROXIMITY_OUT)
emulate_crossing (event->any.window, NULL,
tablet->master, GDK_LEAVE_NOTIFY,
GDK_CROSSING_NORMAL, time);
......@@ -3280,7 +3280,7 @@ gdk_wayland_tablet_flush_frame_event (GdkWaylandTabletData *tablet,
_gdk_wayland_display_deliver_event (gdk_seat_get_display (tablet->seat),
event);
if (event->type == GDK_PROXIMITY_IN)
if (event->any.type == GDK_PROXIMITY_IN)
emulate_crossing (event->any.window, NULL,
tablet->master, GDK_ENTER_NOTIFY,
GDK_CROSSING_NORMAL, time);
......@@ -3291,7 +3291,7 @@ gdk_wayland_tablet_get_frame_event (GdkWaylandTabletData *tablet,
GdkEventType evtype)
{
if (tablet->pointer_info.frame.event &&
tablet->pointer_info.frame.event->type != evtype)
tablet->pointer_info.frame.event->any.type != evtype)
gdk_wayland_tablet_flush_frame_event (tablet, GDK_CURRENT_TIME);
tablet->pointer_info.frame.event = gdk_event_new (evtype);
......@@ -3726,7 +3726,7 @@ tablet_tool_handle_frame (void *data,
frame_event = tablet->pointer_info.frame.event;
if (frame_event && frame_event->type == GDK_PROXIMITY_OUT)
if (frame_event && frame_event->any.type == GDK_PROXIMITY_OUT)
{
tool->current_tablet = NULL;
tablet->current_tool = NULL;
......
......@@ -3602,7 +3602,7 @@ gdk_wayland_window_show_window_menu (GdkWindow *window,
double x, y;
uint32_t serial;
switch ((guint) event->type)
switch ((guint) event->any.type)
{
case GDK_BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
......
......@@ -226,7 +226,7 @@ translate_key_event (GdkDisplay *display,
if (GDK_DEBUG_CHECK (EVENTS))
{
g_message ("%s:\t\twindow: %ld key: %12s %d",
event->type == GDK_KEY_PRESS ? "key press " : "key release",
event->any.type == GDK_KEY_PRESS ? "key press " : "key release",
xevent->xkey.window,
event->key.keyval ? gdk_keyval_name (event->key.keyval) : "(none)",
event->key.keyval);
......
......@@ -3369,10 +3369,10 @@ gdk_x11_drag_context_handle_event (GdkDragContext *context,
if (!context->is_source)
return FALSE;
if (!x11_context->grab_seat && event->type != GDK_DROP_FINISHED)
if (!x11_context->grab_seat && event->any.type != GDK_DROP_FINISHED)
return FALSE;
switch ((guint) event->type)
switch ((guint) event->any.type)
{
case GDK_MOTION_NOTIFY:
return gdk_dnd_handle_motion_event (context, &event->motion);
......
......@@ -357,8 +357,8 @@ gdk_event_source_translate_event (GdkX11Display *x11_display,
}
if (event &&
(event->type == GDK_ENTER_NOTIFY ||
event->type == GDK_LEAVE_NOTIFY) &&
(event->any.type == GDK_ENTER_NOTIFY ||
event->any.type == GDK_LEAVE_NOTIFY) &&
event->any.window != NULL)
{
/* Handle focusing (in the case where no window manager is running */
......@@ -366,11 +366,11 @@ gdk_event_source_translate_event (GdkX11Display *x11_display,
}
if (event &&
(event->type == GDK_TOUCH_BEGIN ||
event->type == GDK_TOUCH_END ||
event->type == GDK_MOTION_NOTIFY ||
event->type == GDK_ENTER_NOTIFY ||
event->type == GDK_LEAVE_NOTIFY))
(event->any.type == GDK_TOUCH_BEGIN ||
event->any.type == GDK_TOUCH_END ||
event->any.type == GDK_MOTION_NOTIFY ||
event->any.type == GDK_ENTER_NOTIFY ||
event->any.type == GDK_LEAVE_NOTIFY))
{
handle_touch_synthetic_crossing (event);
}
......
......@@ -4863,7 +4863,7 @@ gdk_x11_window_show_window_menu (GdkWindow *window,
double x_root, y_root;
XClientMessageEvent xclient = { 0 };
switch ((guint) event->type)
switch ((guint) event->any.type)
{
case GDK_BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
......
......@@ -1207,7 +1207,7 @@ rewrite_event_for_window (GdkEvent *event,
{
event = gdk_event_copy (event);
switch ((guint) event->type)
switch ((guint) event->any.type)
{
case GDK_SCROLL:
rewrite_events_translate (event->any.window,
......@@ -1278,7 +1278,7 @@ rewrite_event_for_grabs (GdkEvent *event)
GdkDisplay *display;
GdkDevice *device;
switch ((guint) event->type)
switch ((guint) event->any.type)
{
case GDK_SCROLL:
case GDK_BUTTON_PRESS:
......@@ -1511,7 +1511,7 @@ gtk_synthesize_crossing_events (GtkWindow *toplevel,
static gboolean
is_pointing_event (GdkEvent *event)
{
switch ((guint) event->type)
switch ((guint) event->any.type)
{
case GDK_MOTION_NOTIFY:
case GDK_ENTER_NOTIFY:
......@@ -1555,7 +1555,7 @@ handle_pointing_event (GdkEvent *event)
sequence = gdk_event_get_event_sequence (event);
switch ((guint) event->type)
switch ((guint) event->any.type)
{
case GDK_LEAVE_NOTIFY: