year-view: don't render DnD when it leaves

This commit is contained in:
Georges Basile Stavracas Neto
2016-05-21 18:54:47 -03:00
parent 82c7918b15
commit 88730dbafb
2 changed files with 15 additions and 0 deletions
+14
View File
@@ -1375,6 +1375,19 @@ navigator_drag_drop_cb (GcalYearView *self,
return TRUE;
}
static void
navigator_drag_leave_cb (GcalYearView *self,
GdkDragContext *context,
guint time,
GtkWidget *navigator)
{
/* Cancel the DnD after the event is dropped */
self->selected_data->dnd_day = -1;
self->selected_data->dnd_month = -1;
gtk_widget_queue_draw (navigator);
}
static void
gcal_year_view_finalize (GObject *object)
{
@@ -1770,6 +1783,7 @@ gcal_year_view_class_init (GcalYearViewClass *klass)
gtk_widget_class_bind_template_callback (widget_class, navigator_button_press_cb);
gtk_widget_class_bind_template_callback (widget_class, navigator_button_release_cb);
gtk_widget_class_bind_template_callback (widget_class, navigator_drag_drop_cb);
gtk_widget_class_bind_template_callback (widget_class, navigator_drag_leave_cb);
gtk_widget_class_bind_template_callback (widget_class, navigator_drag_motion_cb);
gtk_widget_class_bind_template_callback (widget_class, navigator_motion_notify_cb);
gtk_widget_class_bind_template_callback (widget_class, add_event_clicked_cb);