From e3a350126b722611ebdb2e11e9cde51fa57e8586 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Fri, 25 Aug 2023 18:07:04 -0300 Subject: [PATCH] gui/month-cell: Accept drops from other months We support that now fairly easily, let's enable it. Closes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1077 --- src/gui/views/gcal-month-cell.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/gui/views/gcal-month-cell.c b/src/gui/views/gcal-month-cell.c index 51ba6e54..4c1adcb6 100644 --- a/src/gui/views/gcal-month-cell.c +++ b/src/gui/views/gcal-month-cell.c @@ -132,9 +132,9 @@ move_event (GcalMonthCell *self, current_month - start_month, 0, 0, 0, 0); - diff = g_date_time_get_day_of_month (self->date) - g_date_time_get_day_of_month (start_dt); + diff = gcal_date_time_compare_date (self->date, start_dt); - if (diff != 0 || current_month != start_month || current_year != start_year) + if (diff != 0) { g_autoptr (GDateTime) new_start = g_date_time_add_days (start_dt, diff); @@ -227,7 +227,7 @@ on_drop_target_accept_cb (GtkDropTarget *drop_target, if (!gdk_content_formats_contain_gtype (gdk_drop_get_formats (drop), GCAL_TYPE_EVENT_WIDGET)) GCAL_RETURN (FALSE); - GCAL_RETURN (!self->different_month); + GCAL_RETURN (TRUE); } static void @@ -253,9 +253,6 @@ on_drop_target_drop_cb (GtkDropTarget *drop_target, GCAL_ENTRY; - if (self->different_month) - GCAL_RETURN (FALSE); - if (!G_VALUE_HOLDS (value, GCAL_TYPE_EVENT_WIDGET)) GCAL_RETURN (FALSE);