From 82b5953b764cf550544185343309e781da124be4 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Sat, 21 May 2016 19:15:14 -0300 Subject: [PATCH] month-view: fix invalid cell calculation --- src/gcal-month-view.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gcal-month-view.c b/src/gcal-month-view.c index f666d44f..9194db9f 100644 --- a/src/gcal-month-view.c +++ b/src/gcal-month-view.c @@ -810,8 +810,11 @@ get_dnd_cell (GtkWidget *widget, cell = gather_button_event_data (GCAL_MONTH_VIEW (widget), x, y, NULL, NULL, NULL); cell = real_cell (cell, priv->k); - if (cell - priv->days_delay < g_date_get_days_in_month (priv->date->month, priv->date->year)) - return cell; + if (cell >= priv->days_delay && + cell < g_date_get_days_in_month (priv->date->month, priv->date->year) + priv->days_delay) + { + return cell; + } return -1; }