aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-day-view.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui/e-day-view.c')
-rw-r--r--calendar/gui/e-day-view.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index f79f1d9ddd..bc256e288b 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -507,7 +507,9 @@ time_range_changed_cb (ECalModel *model, time_t start_time, time_t end_time, gpo
if (lower != day_view->lower)
e_day_view_recalc_day_starts (day_view, lower);
- e_day_view_set_selected_time_range (E_CALENDAR_VIEW (day_view), start_time, end_time);
+ /* If we don't show the new selection, don't preserve it */
+ if (day_view->selection_start_day == -1 || day_view->days_shown <= day_view->selection_start_day)
+ e_day_view_set_selected_time_range (E_CALENDAR_VIEW (day_view), start_time, end_time);
}