From 9c150de822dd98edbd3113ace9ae4e3930aad58e Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Fri, 20 May 2016 22:14:05 -0300 Subject: [PATCH] year-view: don't cancel selection while dragging This breaks the users' expectations that the navigator will keep the selected dates. The old behavior was hazardous for users with disabilities. https://bugzilla.gnome.org/show_bug.cgi?id=762462 --- src/gcal-year-view.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/gcal-year-view.c b/src/gcal-year-view.c index abb9533e..86772ecf 100644 --- a/src/gcal-year-view.c +++ b/src/gcal-year-view.c @@ -1076,14 +1076,14 @@ navigator_motion_notify_cb (GcalYearView *year_view, gint day, month; gboolean is_title = FALSE; + /* Cancel the hover when selecting a date range */ + year_view->selected_data->hovered_day = -1; + year_view->selected_data->hovered_month = -1; + if (calculate_day_month_for_coord (year_view, event->x, event->y, &day, &month, &is_title)) { if (year_view->button_pressed) { - /* Cancel the hover when selecting a date range */ - year_view->selected_data->hovered_day = -1; - year_view->selected_data->hovered_month = -1; - if (is_title) day = g_date_get_days_in_month (month + 1, year_view->date->year); @@ -1103,16 +1103,10 @@ navigator_motion_notify_cb (GcalYearView *year_view, return GDK_EVENT_PROPAGATE; } } - else - { - /* Reset the end day */ - year_view->selected_data->end_day = year_view->selected_data->start_day; - year_view->selected_data->end_month = year_view->selected_data->start_month; - gtk_widget_queue_draw (widget); + gtk_widget_queue_draw (widget); - return GDK_EVENT_STOP; - } + return GDK_EVENT_STOP; } static void