From 1ab79d0cc8e439329216bbf8726000b3a26ef0a1 Mon Sep 17 00:00:00 2001 From: Hari Rana Date: Tue, 20 May 2025 22:41:51 -0400 Subject: [PATCH] views/month: Set all non-visible rows as unfocusable When tabbing into the month view, the keyboard focus would go to the first week row in the widget hierarchy, rather than the visible row. Setting the `GtkWidget:can-focus` property to FALSE on every non-visible row only allows keyboard focus within the visible rows. --- src/gui/views/gcal-month-view.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gui/views/gcal-month-view.c b/src/gui/views/gcal-month-view.c index 5f43b28d..7d840b5c 100644 --- a/src/gui/views/gcal-month-view.c +++ b/src/gui/views/gcal-month-view.c @@ -498,7 +498,13 @@ update_row_visuals (GcalMonthView *self) for (gint i = 0; i < self->week_rows->len; i++) { - GcalMonthViewRow *row = g_ptr_array_index (self->week_rows, i); + GcalMonthViewRow *row; + gboolean can_focus; + + row = g_ptr_array_index (self->week_rows, i); + can_focus = i >= FIRST_VISIBLE_ROW_INDEX && i <= LAST_VISIBLE_ROW_INDEX; + + gtk_widget_set_can_focus (GTK_WIDGET (row), can_focus); gcal_month_view_row_update_style_for_date (row, middle); } }