flowbox: Update to using GdkEvent API

This commit is contained in:
Carlos Garnacho 2017-08-25 16:46:15 +02:00
parent c48a196d77
commit e67090df91

View File

@ -2617,11 +2617,14 @@ gtk_flow_box_enter_notify_event (GtkWidget *widget,
{
GtkFlowBox *box = GTK_FLOW_BOX (widget);
GtkFlowBoxChild *child;
gdouble x, y;
if (event->window != gtk_widget_get_window (GTK_WIDGET (box)))
return FALSE;
if ((gdk_event_get_window ((GdkEvent *) event) !=
gtk_widget_get_window (GTK_WIDGET (box))) ||
gdk_event_get_coords ((GdkEvent *) event, &x, &y))
return GDK_EVENT_PROPAGATE;
child = gtk_flow_box_get_child_at_pos (box, event->x, event->y);
child = gtk_flow_box_get_child_at_pos (box, x, y);
gtk_flow_box_update_active (box, child);
return FALSE;
@ -2633,14 +2636,16 @@ gtk_flow_box_leave_notify_event (GtkWidget *widget,
{
GtkFlowBox *box = GTK_FLOW_BOX (widget);
GtkFlowBoxChild *child = NULL;
gdouble x, y;
if (event->window != gtk_widget_get_window (GTK_WIDGET (box)))
if (gdk_event_get_window ((GdkEvent *) event) !=
gtk_widget_get_window (GTK_WIDGET (box)))
return FALSE;
if (event->detail != GDK_NOTIFY_INFERIOR)
child = NULL;
else
child = gtk_flow_box_get_child_at_pos (box, event->x, event->y);
else if (gdk_event_get_coords ((GdkEvent *) event, &x, &y))
child = gtk_flow_box_get_child_at_pos (box, x, y);
gtk_flow_box_update_active (box, child);
@ -2704,8 +2709,12 @@ gtk_flow_box_motion_notify_event (GtkWidget *widget,
{
GtkFlowBox *box = GTK_FLOW_BOX (widget);
GtkFlowBoxChild *child;
gdouble x, y;
child = gtk_flow_box_get_child_at_pos (box, event->x, event->y);
if (!gdk_event_get_coords ((GdkEvent *) event, &x, &y))
return GDK_EVENT_PROPAGATE;
child = gtk_flow_box_get_child_at_pos (box, x, y);
gtk_flow_box_update_active (box, child);
return GTK_WIDGET_CLASS (gtk_flow_box_parent_class)->motion_notify_event (widget, event);
@ -2865,10 +2874,12 @@ gtk_flow_box_key_press_event (GtkWidget *widget,
{
GtkFlowBox *box = GTK_FLOW_BOX (widget);
GtkFlowBoxPrivate *priv = BOX_PRIV (box);
guint keyval;
if (priv->rubberband_select)
{
if (event->keyval == GDK_KEY_Escape)
if (gdk_event_get_keyval ((GdkEvent *) event, &keyval) &&
keyval == GDK_KEY_Escape)
{
gtk_flow_box_stop_rubberband (box);
return TRUE;