Commit 33330ad0 authored by Carlos Garnacho's avatar Carlos Garnacho

gtk/a11y: Use allocated events

Using stack allocated GdkEvent will not be ok when they become
objects.
parent 59cab360
......@@ -221,7 +221,7 @@ gtk_entry_icon_accessible_do_action (AtkAction *action,
GtkEntryIconAccessible *icon = (GtkEntryIconAccessible *)action;
GtkWidget *widget;
GtkEntry *gtk_entry;
GdkEvent event;
GdkEvent *event;
GdkRectangle icon_area;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (icon->entry));
......@@ -241,16 +241,17 @@ gtk_entry_icon_accessible_do_action (AtkAction *action,
return FALSE;
gtk_entry_get_icon_area (gtk_entry, icon->pos, &icon_area);
memset (&event, 0, sizeof (event));
event.any.type = GDK_BUTTON_PRESS;
event.any.window = gtk_widget_get_window (widget);
event.button.button = 1;
event.any.send_event = TRUE;
event.button.time = GDK_CURRENT_TIME;
event.button.x = icon_area.x;
event.button.y = icon_area.y;
g_signal_emit_by_name (widget, "icon-press", 0, icon->pos, &event);
event = gdk_event_new (GDK_BUTTON_PRESS);
event->any.window = g_object_ref (gtk_widget_get_window (widget));
event->button.button = 1;
event->any.send_event = TRUE;
event->button.time = GDK_CURRENT_TIME;
event->button.x = icon_area.x;
event->button.y = icon_area.y;
g_signal_emit_by_name (widget, "icon-press", 0, icon->pos, event);
gdk_event_free (event);
return TRUE;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment