Automatically scroll the view to the selected event from search results (to prevent details popover from showing in the wrong place)
In 46 / nightly, if you use the search feature, and click a search result that is an event outside the current view of the month/week view, two situations can happen:
- If the event was "the week before" (i.e. just a row above the currently displayed month view), you get a details popover that shows up at unpredictable locations (ex: onto the headerbar, or on the screen's top-left corner), because it has no correct coordinates available.
- If the event is too far away (ex: 5 months into the future) you might get no popover at all, the searchbar closes by itself, and the app enters an infinite loop in the background where it prints this kind of stuff every 2 seconds:
11:28:45.26040 GcalMonthView: TRACE: ENTRY: gcal_month_view_get_children_by_uuid():1276
11:28:45.26385 GcalMonthView: TRACE: EXIT: gcal_month_view_get_children_by_uuid():1291
11:28:47.26914 GcalMonthView: TRACE: ENTRY: gcal_month_view_get_children_by_uuid():1276
11:28:47.27285 GcalMonthView: TRACE: EXIT: gcal_month_view_get_children_by_uuid():1291
11:28:49.24485 GcalMonthView: TRACE: ENTRY: gcal_month_view_get_children_by_uuid():1276
11:28:49.24709 GcalMonthView: TRACE: EXIT: gcal_month_view_get_children_by_uuid():1291
11:28:51.24775 GcalMonthView: TRACE: ENTRY: gcal_month_view_get_children_by_uuid():1276
11:28:51.24999 GcalMonthView: TRACE: EXIT: gcal_month_view_get_children_by_uuid():1291
Here is a demonstration of these issues:
gnome-calendar_searchbar_results_not_autoscrolling
I think the probably most logical solution to this would not be to try to invent/reassign coordinates for the popover widget, but rather to tell the view to scroll to the appropriate day/week to display the event in the view, and then show the popover related to that event.
Users can always go back to the present by clicking the "Today" button anyway, or doing another search query.