Commit b9db0b55 authored by Carlos Garnacho's avatar Carlos Garnacho

gdk: Refurbish GdkEvent struct hierarchy

Make all specific event structs contain a GdkEventAny, so the base
struct can be extended without modifying structs all over the place.
parent 9aba77e3
......@@ -543,8 +543,8 @@ generate_grab_broken_event (GdkDisplay *display,
GdkEvent *event;
event = gdk_event_new (GDK_GRAB_BROKEN);
event->grab_broken.window = g_object_ref (window);
event->grab_broken.send_event = FALSE;
event->any.window = g_object_ref (window);
event->any.send_event = FALSE;
event->grab_broken.implicit = implicit;
event->grab_broken.grab_window = grab_window;
gdk_event_set_device (event, device);
......
......@@ -277,18 +277,18 @@ _gdk_event_queue_handle_motion_compression (GdkDisplay *display)
break;
if (pending_motion_window != NULL &&
pending_motion_window != event->event.motion.window)
pending_motion_window != event->event.any.window)
break;
if (pending_motion_device != NULL &&
pending_motion_device != event->event.motion.device)
break;
if (!event->event.motion.window->event_compression)
if (!event->event.any.window->event_compression)
break;
pending_motion_window = event->event.motion.window;
pending_motion_device = event->event.motion.device;
pending_motion_window = event->event.any.window;
pending_motion_device = event->motion.device;
pending_motions = tmp_list;
tmp_list = tmp_list->prev;
......@@ -1720,13 +1720,13 @@ gdk_event_triggers_context_menu (const GdkEvent *event)
GdkDisplay *display;
GdkModifierType modifier;
g_return_val_if_fail (GDK_IS_WINDOW (bevent->window), FALSE);
g_return_val_if_fail (GDK_IS_WINDOW (bevent->any.window), FALSE);
if (bevent->button == GDK_BUTTON_SECONDARY &&
! (bevent->state & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK)))
return TRUE;
display = gdk_window_get_display (bevent->window);
display = gdk_window_get_display (bevent->any.window);
modifier = gdk_keymap_get_modifier_mask (gdk_keymap_get_for_display (display),
GDK_MODIFIER_INTENT_CONTEXT_MENU);
......@@ -1970,8 +1970,8 @@ gdk_get_pending_window_state_event_link (GdkWindow *window)
{
GdkEventPrivate *event = tmp_list->data;
if (event->event.type == GDK_WINDOW_STATE &&
event->event.window_state.window == window)
if (event->event.any.type == GDK_WINDOW_STATE &&
event->event.any.window == window)
return tmp_list;
}
......@@ -1989,9 +1989,9 @@ _gdk_set_window_state (GdkWindow *window,
g_return_if_fail (window != NULL);
temp_event.window_state.window = window;
temp_event.window_state.type = GDK_WINDOW_STATE;
temp_event.window_state.send_event = FALSE;
temp_event.any.window = window;
temp_event.any.type = GDK_WINDOW_STATE;
temp_event.any.send_event = FALSE;
temp_event.window_state.new_window_state = new_state;
if (temp_event.window_state.new_window_state == window->state)
......
......@@ -64,9 +64,7 @@ struct _GdkEventAny
*/
struct _GdkEventExpose
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkEventAny any;
GdkRectangle area;
cairo_region_t *region;
gint count; /* If non-zero, how many more events follow. */
......@@ -98,9 +96,7 @@ struct _GdkEventExpose
*/
struct _GdkEventMotion
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkEventAny any;
guint32 time;
gdouble x;
gdouble y;
......@@ -140,9 +136,7 @@ struct _GdkEventMotion
*/
struct _GdkEventButton
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkEventAny any;
guint32 time;
gdouble x;
gdouble y;
......@@ -190,9 +184,7 @@ struct _GdkEventButton
*/
struct _GdkEventTouch
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkEventAny any;
guint32 time;
gdouble x;
gdouble y;
......@@ -238,9 +230,7 @@ struct _GdkEventTouch
*/
struct _GdkEventScroll
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkEventAny any;
guint32 time;
gdouble x;
gdouble y;
......@@ -286,9 +276,7 @@ struct _GdkEventScroll
*/
struct _GdkEventKey
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkEventAny any;
guint32 time;
guint state;
guint keyval;
......@@ -327,9 +315,7 @@ struct _GdkEventKey
*/
struct _GdkEventCrossing
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkEventAny any;
GdkWindow *subwindow;
guint32 time;
gdouble x;
......@@ -354,9 +340,7 @@ struct _GdkEventCrossing
*/
struct _GdkEventFocus
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkEventAny any;
gint16 in;
};
......@@ -374,9 +358,7 @@ struct _GdkEventFocus
*/
struct _GdkEventConfigure
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkEventAny any;
gint x, y;
gint width;
gint height;
......@@ -396,9 +378,7 @@ struct _GdkEventConfigure
*/
struct _GdkEventProperty
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkEventAny any;
GdkAtom atom;
guint32 time;
guint state;
......@@ -425,9 +405,7 @@ struct _GdkEventProperty
*/
struct _GdkEventProximity
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkEventAny any;
guint32 time;
GdkDevice *device;
};
......@@ -445,9 +423,7 @@ struct _GdkEventProximity
*/
struct _GdkEventWindowState
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkEventAny any;
GdkWindowState changed_mask;
GdkWindowState new_window_state;
};
......@@ -474,9 +450,7 @@ struct _GdkEventWindowState
* Since: 2.8
*/
struct _GdkEventGrabBroken {
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkEventAny any;
gboolean keyboard;
gboolean implicit;
GdkWindow *grab_window;
......@@ -499,9 +473,7 @@ struct _GdkEventGrabBroken {
* Generated during DND operations.
*/
struct _GdkEventDND {
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkEventAny any;
GdkDragContext *context;
guint32 time;
......@@ -531,9 +503,7 @@ struct _GdkEventDND {
* Generated during touchpad swipe gestures.
*/
struct _GdkEventTouchpadSwipe {
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkEventAny any;
gint8 phase;
gint8 n_fingers;
guint32 time;
......@@ -572,9 +542,7 @@ struct _GdkEventTouchpadSwipe {
* Generated during touchpad swipe gestures.
*/
struct _GdkEventTouchpadPinch {
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkEventAny any;
gint8 phase;
gint8 n_fingers;
guint32 time;
......@@ -605,9 +573,7 @@ struct _GdkEventTouchpadPinch {
* Since: 3.22
*/
struct _GdkEventPadButton {
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkEventAny any;
guint32 time;
guint group;
guint button;
......@@ -633,9 +599,7 @@ struct _GdkEventPadButton {
* Since: 3.22
*/
struct _GdkEventPadAxis {
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkEventAny any;
guint32 time;
guint group;
guint index;
......@@ -660,9 +624,7 @@ struct _GdkEventPadAxis {
* Since: 3.22
*/
struct _GdkEventPadGroupMode {
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkEventAny any;
guint32 time;
guint group;
guint mode;
......
......@@ -2539,9 +2539,9 @@ _gdk_window_process_updates_recurse (GdkWindow *window,
/* Paint the window before the children, clipped to the window region */
event.expose.type = GDK_EXPOSE;
event.expose.window = window; /* we already hold a ref */
event.expose.send_event = FALSE;
event.any.type = GDK_EXPOSE;
event.any.window = window; /* we already hold a ref */
event.any.send_event = FALSE;
event.expose.count = 0;
event.expose.region = clipped_expose_region;
cairo_region_get_extents (clipped_expose_region, &event.expose.area);
......
......@@ -596,7 +596,7 @@ emulate_crossing (GdkWindow *window,
GdkEvent *event;
event = gdk_event_new (type);
event->crossing.window = window ? g_object_ref (window) : NULL;
event->any.window = window ? g_object_ref (window) : NULL;
event->crossing.subwindow = subwindow ? g_object_ref (subwindow) : NULL;
event->crossing.time = time_;
event->crossing.mode = mode;
......@@ -627,7 +627,7 @@ emulate_touch_crossing (GdkWindow *window,
GdkEvent *event;
event = gdk_event_new (type);
event->crossing.window = window ? g_object_ref (window) : NULL;
event->any.window = window ? g_object_ref (window) : NULL;
event->crossing.subwindow = subwindow ? g_object_ref (subwindow) : NULL;
event->crossing.time = time_;
event->crossing.mode = mode;
......@@ -653,7 +653,7 @@ emulate_focus (GdkWindow *window,
GdkEvent *event;
event = gdk_event_new (GDK_FOCUS_CHANGE);
event->focus_change.window = g_object_ref (window);
event->any.window = g_object_ref (window);
event->focus_change.in = focus_in;
gdk_event_set_device (event, device);
gdk_event_set_source_device (event, device);
......@@ -1222,7 +1222,7 @@ create_scroll_event (GdkWaylandSeat *seat,
GdkEvent *event;
event = gdk_event_new (GDK_SCROLL);
event->scroll.window = g_object_ref (pointer_info->focus);
event->any.window = g_object_ref (pointer_info->focus);
gdk_event_set_device (event, device);
gdk_event_set_source_device (event, source_device);
event->scroll.time = pointer_info->time;
......@@ -1382,7 +1382,7 @@ pointer_handle_enter (void *data,
seat->pointer_info.enter_serial = serial;
event = gdk_wayland_seat_get_frame_event (seat, GDK_ENTER_NOTIFY);
event->crossing.window = g_object_ref (seat->pointer_info.focus);
event->any.window = g_object_ref (seat->pointer_info.focus);
gdk_event_set_device (event, seat->master_pointer);
gdk_event_set_source_device (event, seat->pointer);
gdk_event_set_seat (event, gdk_device_get_seat (seat->master_pointer));
......@@ -1431,7 +1431,7 @@ pointer_handle_leave (void *data,
_gdk_wayland_display_update_serial (display_wayland, serial);
event = gdk_wayland_seat_get_frame_event (seat, GDK_LEAVE_NOTIFY);
event->crossing.window = g_object_ref (seat->pointer_info.focus);
event->any.window = g_object_ref (seat->pointer_info.focus);
gdk_event_set_device (event, seat->master_pointer);
gdk_event_set_source_device (event, seat->pointer);
gdk_event_set_seat (event, GDK_SEAT (seat));
......@@ -1482,7 +1482,7 @@ pointer_handle_motion (void *data,
seat->pointer_info.surface_y = wl_fixed_to_double (sy);
event = gdk_wayland_seat_get_frame_event (seat, GDK_MOTION_NOTIFY);
event->motion.window = g_object_ref (seat->pointer_info.focus);
event->any.window = g_object_ref (seat->pointer_info.focus);
gdk_event_set_device (event, seat->master_pointer);
gdk_event_set_source_device (event, seat->pointer);
gdk_event_set_seat (event, gdk_device_get_seat (seat->master_pointer));
......@@ -1550,7 +1550,7 @@ pointer_handle_button (void *data,
event = gdk_wayland_seat_get_frame_event (seat,
state ? GDK_BUTTON_PRESS :
GDK_BUTTON_RELEASE);
event->button.window = g_object_ref (seat->pointer_info.focus);
event->any.window = g_object_ref (seat->pointer_info.focus);
gdk_event_set_device (event, seat->master_pointer);
gdk_event_set_source_device (event, seat->pointer);
gdk_event_set_seat (event, gdk_device_get_seat (seat->master_pointer));
......@@ -1796,8 +1796,8 @@ keyboard_handle_enter (void *data,
seat->repeat_key = 0;
event = gdk_event_new (GDK_FOCUS_CHANGE);
event->focus_change.window = g_object_ref (seat->keyboard_focus);
event->focus_change.send_event = FALSE;
event->any.window = g_object_ref (seat->keyboard_focus);
event->any.send_event = FALSE;
event->focus_change.in = TRUE;
gdk_event_set_device (event, seat->master_keyboard);
gdk_event_set_source_device (event, seat->keyboard);
......@@ -1834,8 +1834,8 @@ keyboard_handle_leave (void *data,
_gdk_wayland_display_update_serial (display, serial);
event = gdk_event_new (GDK_FOCUS_CHANGE);
event->focus_change.window = g_object_ref (seat->keyboard_focus);
event->focus_change.send_event = FALSE;
event->any.window = g_object_ref (seat->keyboard_focus);
event->any.send_event = FALSE;
event->focus_change.in = FALSE;
gdk_event_set_device (event, seat->master_keyboard);
gdk_event_set_source_device (event, seat->keyboard);
......@@ -2025,7 +2025,7 @@ deliver_key_event (GdkWaylandSeat *seat,
seat->key_modifiers = gdk_keymap_get_modifier_state (keymap);
event = gdk_event_new (state ? GDK_KEY_PRESS : GDK_KEY_RELEASE);
event->key.window = seat->keyboard_focus ? g_object_ref (seat->keyboard_focus) : NULL;
event->any.window = seat->keyboard_focus ? g_object_ref (seat->keyboard_focus) : NULL;
gdk_event_set_device (event, seat->master_keyboard);
gdk_event_set_source_device (event, seat->keyboard);
gdk_event_set_seat (event, GDK_SEAT (seat));
......@@ -2232,7 +2232,7 @@ _create_touch_event (GdkWaylandSeat *seat,
GdkEvent *event;
event = gdk_event_new (evtype);
event->touch.window = g_object_ref (touch->window);
event->any.window = g_object_ref (touch->window);
gdk_event_set_device (event, seat->touch_master);
gdk_event_set_source_device (event, seat->touch);
gdk_event_set_seat (event, GDK_SEAT (seat));
......@@ -2442,7 +2442,7 @@ emit_gesture_swipe_event (GdkWaylandSeat *seat,
event = gdk_event_new (GDK_TOUCHPAD_SWIPE);
event->touchpad_swipe.phase = phase;
event->touchpad_swipe.window = g_object_ref (seat->pointer_info.focus);
event->any.window = g_object_ref (seat->pointer_info.focus);
gdk_event_set_device (event, seat->master_pointer);
gdk_event_set_source_device (event, seat->pointer);
gdk_event_set_seat (event, GDK_SEAT (seat));
......@@ -2544,7 +2544,7 @@ emit_gesture_pinch_event (GdkWaylandSeat *seat,
event = gdk_event_new (GDK_TOUCHPAD_PINCH);
event->touchpad_pinch.phase = phase;
event->touchpad_pinch.window = g_object_ref (seat->pointer_info.focus);
event->any.window = g_object_ref (seat->pointer_info.focus);
gdk_event_set_device (event, seat->master_pointer);
gdk_event_set_source_device (event, seat->pointer);
gdk_event_set_seat (event, GDK_SEAT (seat));
......@@ -3273,7 +3273,7 @@ gdk_wayland_tablet_flush_frame_event (GdkWaylandTabletData *tablet,
}
if (event->type == GDK_PROXIMITY_OUT)
emulate_crossing (event->proximity.window, NULL,
emulate_crossing (event->any.window, NULL,
tablet->master, GDK_LEAVE_NOTIFY,
GDK_CROSSING_NORMAL, time);
......@@ -3281,7 +3281,7 @@ gdk_wayland_tablet_flush_frame_event (GdkWaylandTabletData *tablet,
event);
if (event->type == GDK_PROXIMITY_IN)
emulate_crossing (event->proximity.window, NULL,
emulate_crossing (event->any.window, NULL,
tablet->master, GDK_ENTER_NOTIFY,
GDK_CROSSING_NORMAL, time);
}
......@@ -3415,7 +3415,7 @@ tablet_tool_handle_proximity_in (void *data,
gdk_wayland_mimic_device_axes (tablet->master, tablet->current_device);
event = gdk_wayland_tablet_get_frame_event (tablet, GDK_PROXIMITY_IN);
event->proximity.window = g_object_ref (tablet->pointer_info.focus);
event->any.window = g_object_ref (tablet->pointer_info.focus);
gdk_event_set_device (event, tablet->master);
gdk_event_set_source_device (event, tablet->current_device);
gdk_event_set_device_tool (event, tool->tool);
......@@ -3440,7 +3440,7 @@ tablet_tool_handle_proximity_out (void *data,
gdk_device_tool_get_tool_type (tool->tool)));
event = gdk_wayland_tablet_get_frame_event (tablet, GDK_PROXIMITY_OUT);
event->proximity.window = g_object_ref (tablet->pointer_info.focus);
event->any.window = g_object_ref (tablet->pointer_info.focus);
gdk_event_set_device (event, tablet->master);
gdk_event_set_source_device (event, tablet->current_device);
gdk_event_set_device_tool (event, tool->tool);
......@@ -3464,7 +3464,7 @@ tablet_create_button_event_frame (GdkWaylandTabletData *tablet,
GdkEvent *event;
event = gdk_wayland_tablet_get_frame_event (tablet, evtype);
event->button.window = g_object_ref (tablet->pointer_info.focus);
event->any.window = g_object_ref (tablet->pointer_info.focus);
gdk_event_set_device (event, tablet->master);
gdk_event_set_source_device (event, tablet->current_device);
gdk_event_set_device_tool (event, tablet->current_tool->tool);
......@@ -3534,7 +3534,7 @@ tablet_tool_handle_motion (void *data,
tablet->pointer_info.surface_y));
event = gdk_wayland_tablet_get_frame_event (tablet, GDK_MOTION_NOTIFY);
event->motion.window = g_object_ref (tablet->pointer_info.focus);
event->any.window = g_object_ref (tablet->pointer_info.focus);
gdk_event_set_device (event, tablet->master);
gdk_event_set_source_device (event, tablet->current_device);
gdk_event_set_device_tool (event, tool->tool);
......@@ -3812,7 +3812,7 @@ tablet_pad_ring_handle_frame (void *data,
g_message ("tablet pad ring handle frame, ring = %p", wp_tablet_pad_ring));
event = gdk_event_new (GDK_PAD_RING);
g_set_object (&event->pad_axis.window, seat->keyboard_focus);
g_set_object (&event->any.window, seat->keyboard_focus);
event->pad_axis.time = time;
event->pad_axis.group = g_list_index (pad->mode_groups, group);
event->pad_axis.index = g_list_index (pad->rings, wp_tablet_pad_ring);
......@@ -3888,7 +3888,7 @@ tablet_pad_strip_handle_frame (void *data,
wp_tablet_pad_strip));
event = gdk_event_new (GDK_PAD_STRIP);
g_set_object (&event->pad_axis.window, seat->keyboard_focus);
g_set_object (&event->any.window, seat->keyboard_focus);
event->pad_axis.time = time;
event->pad_axis.group = g_list_index (pad->mode_groups, group);
event->pad_axis.index = g_list_index (pad->strips, wp_tablet_pad_strip);
......@@ -4012,7 +4012,7 @@ tablet_pad_group_handle_mode (void *data,
n_group = g_list_index (pad->mode_groups, group);
event = gdk_event_new (GDK_PAD_GROUP_MODE);
g_set_object (&event->pad_button.window, seat->keyboard_focus);
g_set_object (&event->any.window, seat->keyboard_focus);
event->pad_group_mode.group = n_group;
event->pad_group_mode.mode = mode;
event->pad_group_mode.time = time;
......@@ -4129,7 +4129,7 @@ tablet_pad_handle_button (void *data,
event = gdk_event_new (state == ZWP_TABLET_PAD_V2_BUTTON_STATE_PRESSED ?
GDK_PAD_BUTTON_PRESS :
GDK_PAD_BUTTON_RELEASE);
g_set_object (&event->pad_button.window, seat->keyboard_focus);
g_set_object (&event->any.window, seat->keyboard_focus);
event->pad_button.button = button;
event->pad_button.group = n_group;
event->pad_button.mode = group->current_mode;
......
......@@ -121,7 +121,7 @@ _gdk_wayland_drag_context_emit_event (GdkDragContext *context,
window = gdk_drag_context_get_dest_window (context);
event = gdk_event_new (type);
event->dnd.window = g_object_ref (window);
event->any.window = g_object_ref (window);
event->dnd.context = g_object_ref (context);
event->dnd.time = time_;
event->dnd.x_root = GDK_WAYLAND_DRAG_CONTEXT (context)->x;
......
......@@ -933,8 +933,8 @@ gdk_wayland_window_configure (GdkWindow *window,
GdkEvent *event;
event = gdk_event_new (GDK_CONFIGURE);
event->configure.window = g_object_ref (window);
event->configure.send_event = FALSE;
event->any.window = g_object_ref (window);
event->any.send_event = FALSE;
event->configure.width = width;
event->configure.height = height;
......
......@@ -196,7 +196,7 @@ translate_key_event (GdkDisplay *display,
GdkKeymap *keymap = gdk_keymap_get_for_display (display);
GdkModifierType consumed, state;
event->key.type = xevent->xany.type == KeyPress ? GDK_KEY_PRESS : GDK_KEY_RELEASE;
event->any.type = xevent->xany.type == KeyPress ? GDK_KEY_PRESS : GDK_KEY_RELEASE;
event->key.time = xevent->xkey.time;
gdk_event_set_device (event, device_manager->core_keyboard);
......@@ -487,7 +487,7 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator,
case 5: /* down */
case 6: /* left */
case 7: /* right */
event->scroll.type = GDK_SCROLL;
event->any.type = GDK_SCROLL;
if (xevent->xbutton.button == 4)
event->scroll.direction = GDK_SCROLL_UP;
......@@ -498,7 +498,7 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator,
else
event->scroll.direction = GDK_SCROLL_RIGHT;
event->scroll.window = window;
event->any.window = window;
event->scroll.time = xevent->xbutton.time;
event->scroll.x = (gdouble) xevent->xbutton.x / scale;
event->scroll.y = (gdouble) xevent->xbutton.y / scale;
......@@ -515,8 +515,8 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator,
break;
default:
event->button.type = GDK_BUTTON_PRESS;
event->button.window = window;
event->any.type = GDK_BUTTON_PRESS;
event->any.window = window;
event->button.time = xevent->xbutton.time;
event->button.x = (gdouble) xevent->xbutton.x / scale;
event->button.y = (gdouble) xevent->xbutton.y / scale;
......@@ -557,8 +557,8 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator,
break;
}
event->button.type = GDK_BUTTON_RELEASE;
event->button.window = window;
event->any.type = GDK_BUTTON_RELEASE;
event->any.window = window;
event->button.time = xevent->xbutton.time;
event->button.x = (gdouble) xevent->xbutton.x / scale;
event->button.y = (gdouble) xevent->xbutton.y / scale;
......@@ -586,8 +586,8 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator,
break;
}
event->motion.type = GDK_MOTION_NOTIFY;
event->motion.window = window;
event->any.type = GDK_MOTION_NOTIFY;
event->any.window = window;
event->motion.time = xevent->xmotion.time;
event->motion.x = (gdouble) xevent->xmotion.x / scale;
event->motion.y = (gdouble) xevent->xmotion.y / scale;
......@@ -617,8 +617,8 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator,
gdk_event_set_display (event, display);
event->crossing.type = GDK_ENTER_NOTIFY;
event->crossing.window = window;
event->any.type = GDK_ENTER_NOTIFY;
event->any.window = window;
gdk_event_set_device (event, device_manager->core_pointer);
/* If the subwindow field of the XEvent is non-NULL, then
......@@ -657,8 +657,8 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator,
gdk_event_set_display (event, display);
event->crossing.type = GDK_LEAVE_NOTIFY;
event->crossing.window = window;
event->any.type = GDK_LEAVE_NOTIFY;
event->any.window = window;
gdk_event_set_device (event, device_manager->core_pointer);
/* If the subwindow field of the XEvent is non-NULL, then
......@@ -889,8 +889,8 @@ _gdk_device_manager_core_handle_focus (GdkWindow *window,
GdkEvent *event;
event = gdk_event_new (GDK_FOCUS_CHANGE);
event->focus_change.window = g_object_ref (window);
event->focus_change.send_event = FALSE;
event->any.window = g_object_ref (window);
event->any.send_event = FALSE;
event->focus_change.in = focus_in;
gdk_event_set_device (event, device);
if (source_device)
......
......@@ -1420,9 +1420,9 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
xev->sourceid,
xev->detail));
event->key.type = xev->evtype == XI_KeyPress ? GDK_KEY_PRESS : GDK_KEY_RELEASE;
event->any.type = xev->evtype == XI_KeyPress ? GDK_KEY_PRESS : GDK_KEY_RELEASE;
event->key.window = window;
event->any.window = window;
event->key.time = xev->time;
event->key.state = _gdk_x11_device_xi2_translate_state (&xev->mods, &xev->buttons, &xev->group);
......@@ -1495,7 +1495,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
(xev->detail >= 4 && xev->detail <= 7))
{
/* Button presses of button 4-7 are scroll events */
event->scroll.type = GDK_SCROLL;
event->any.type = GDK_SCROLL;
if (xev->detail == 4)
event->scroll.direction = GDK_SCROLL_UP;
......@@ -1506,7 +1506,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
else
event->scroll.direction = GDK_SCROLL_RIGHT;
event->scroll.window = window;
event->any.window = window;
event->scroll.time = xev->time;
event->scroll.x = (gdouble) xev->event_x / scale;
event->scroll.y = (gdouble) xev->event_y / scale;
......@@ -1528,9 +1528,9 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
}
else
{
event->button.type = (ev->evtype == XI_ButtonPress) ? GDK_BUTTON_PRESS : GDK_BUTTON_RELEASE;
event->any.type = (ev->evtype == XI_ButtonPress) ? GDK_BUTTON_PRESS : GDK_BUTTON_RELEASE;
event->button.window = window;
event->any.window = window;
event->button.time = xev->time;
event->button.x = (gdouble) xev->event_x / scale;
event->button.y = (gdouble) xev->event_y / scale;
......@@ -1550,7 +1550,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
event->button.axes = translate_axes (event->button.device,
event->button.x,
event->button.y,
event->button.window,
event->any.window,
&xev->valuators);
if (gdk_device_get_mode (event->button.device) == GDK_MODE_WINDOW)
......@@ -1605,7 +1605,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
scroll_valuators_changed (GDK_X11_DEVICE_XI2 (source_device),
&xev->valuators, &delta_x, &delta_y))
{
event->scroll.type = GDK_SCROLL;
event->any.type = GDK_SCROLL;
event->scroll.direction = GDK_SCROLL_SMOOTH;
if (delta_x == 0.0 && delta_y == 0.0)
......@@ -1617,7 +1617,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
xev->event, delta_x, delta_y));
event->scroll.window = window;
event->any.window = window;
event->scroll.time = xev->time;
event->scroll.x = (gdouble) xev->event_x / scale;
event->scroll.y = (gdouble) xev->event_y / scale;
......@@ -1634,8 +1634,8 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
break;