6 Commits
Author SHA1 Message Date
John Cardullo eeea79bb9f gui/search-button: Disable popover arrow and guard markup escaping
The search suggestions popover is styled as a menu ("menu" style)
below the search entry. In recent GTK 4, when has-arrow is TRUE (the
default) and the popover has no arrow geometry or valid parent coordinates,
gtk_popover_create_arrow_path() returns NULL, leaving arrow_render_node NULL.
gtk_popover_snapshot() then appends NULL to the snapshot, causing a fatal
critical crash (GSK_IS_RENDER_NODE assertion failed) upon showing search results.

Setting "has-arrow: false" matches the menu popover design and avoids
the crash. Also guard escape_markup_cb() against NULL strings.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/808>
2026-10-27 11:10:58 -07:00
John Cardullo c1eca94482 gui/fading-label: Do not snapshot empty cached text node
When a label has empty text or an empty PangoLayout,
gtk_snapshot_free_to_node() returns NULL. Passing NULL to
gtk_snapshot_append_node() triggers a critical assertion failure
which causes an abort under G_DEBUG=fatal-criticals.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/808>
2026-10-27 11:10:58 -07:00
John Cardullo c7b1c977f7 core/calendar-monitor: Clear shared rw-lock on finalize
In gcal_calendar_monitor_init(), self->shared.lock is initialized with
g_rw_lock_init(). On Linux/glibc, GRWLock allocates memory for the
underlying pthread_rwlock_t (56 bytes).

Because g_rw_lock_clear() was never called in gcal_calendar_monitor_finalize(),
every finalized GcalCalendarMonitor leaked its lock resources, failing the
LeakSanitizer CI build when test_calendar_monitor_expand_recurrences was added.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/808>
2026-10-27 11:10:58 -07:00
John Cardullo 2aaac879d4 tests/search: Add unit tests for expand-recurrences and recurring search hits
Add unit test coverage for the new "expand-recurrences" property on
GcalTimeline and GcalCalendarMonitor, ensuring proper propagation,
default values, and notify signal emission. Also verify that
GcalSearchHitEvent correctly indicates recurrence in hit subtitles.

Reference: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/991
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/808>
2026-10-27 11:10:58 -07:00
John Cardullo cc4e537987 search: Fold recurring events into single results
When searching for events, users are typically interested in finding the
event rather than seeing a repetitive list of every occurrence instance.
By configuring the search timelines with "expand-recurrences" set to FALSE,
recurring events are loaded as their single master component instead of
expanding all individual occurrences.

Additionally:
- Update GcalSearchHitEvent subtitle to display "Recurring" (e.g. "Tomorrow • Recurring"
  or "Recurring") when the event has a recurrence rule.
- Safeguard gcal_event_format_date() when running without a default GApplication.

Fixes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/991
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/808>
2026-10-27 11:10:58 -07:00
John Cardullo 9d29a7a34e core: Add "expand-recurrences" property to GcalCalendarMonitor and GcalTimeline
Add an "expand-recurrences" boolean property (defaulting to TRUE) to both
GcalCalendarMonitor and GcalTimeline. When set to FALSE:
- Recurring master components are kept as single events without expanding
  each recurrence instance.
- Detached recurrence instances are ignored.
- Pruning outside range retains recurring master events so they are not
  prematurely removed.
- Subscriber filtering permits recurring master events within the
  subscriber model.

This allows consumers like search providers to avoid expanding all recurrence
instances when searching, improving performance and avoiding duplicate hits.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/808>
2026-10-27 11:10:58 -07:00