forked from AuroraMiddleware/gtk
flowbox: don’t try to focus or draw NULL widgets
Rubberbanding over an empty area results in warnings, due to the code trying to focus and queue a null pointer for drawing. https://bugzilla.gnome.org/show_bug.cgi?id=780734
This commit is contained in:
parent
fc70267158
commit
7860e2d5cd
@ -2808,7 +2808,8 @@ gtk_flow_box_drag_gesture_update (GtkGestureDrag *gesture,
|
|||||||
g_object_unref (priv->rubberband_node);
|
g_object_unref (priv->rubberband_node);
|
||||||
|
|
||||||
/* Grab focus here, so Escape-to-stop-rubberband works */
|
/* Grab focus here, so Escape-to-stop-rubberband works */
|
||||||
gtk_flow_box_update_cursor (box, priv->rubberband_first);
|
if (priv->rubberband_first)
|
||||||
|
gtk_flow_box_update_cursor (box, priv->rubberband_first);
|
||||||
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
|
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2818,7 +2819,11 @@ gtk_flow_box_drag_gesture_update (GtkGestureDrag *gesture,
|
|||||||
start_y + offset_y);
|
start_y + offset_y);
|
||||||
|
|
||||||
if (priv->rubberband_first == NULL)
|
if (priv->rubberband_first == NULL)
|
||||||
priv->rubberband_first = child;
|
{
|
||||||
|
priv->rubberband_first = child;
|
||||||
|
if (priv->rubberband_first)
|
||||||
|
gtk_flow_box_update_cursor (box, priv->rubberband_first);
|
||||||
|
}
|
||||||
if (child != NULL)
|
if (child != NULL)
|
||||||
priv->rubberband_last = child;
|
priv->rubberband_last = child;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user