From fbc181743bb45f8802fcc70c64f93b6f0596821d Mon Sep 17 00:00:00 2001 From: Emma Blink Date: Sun, 27 Jul 2025 15:27:11 +0100 Subject: [PATCH] week-view: explicitly handle PgUp/PgDown via ShortcutController ScrolledWindow handles PgUp/PgDown in bubble phase to trigger scrolling. Which leads to inconsistent behaviour: scrolling when an event is focused, and moving to the previous/next week when not. Explicitly handling the shortcuts with a ShortcutController in capture phase makes it consistently navigate to previous/next week. Fixes #1409 Part-of: --- src/gui/views/gcal-week-view.blp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/gui/views/gcal-week-view.blp b/src/gui/views/gcal-week-view.blp index 613cbcf0..054bf143 100644 --- a/src/gui/views/gcal-week-view.blp +++ b/src/gui/views/gcal-week-view.blp @@ -61,6 +61,22 @@ template $GcalWeekView: Box { leave => $on_motion_controller_leave_cb(template) not-swapped; } + // Make the behaviour of Page-Up/Page-Down consistent regardless of + // whether an event is selected in the week view. + ShortcutController { + propagation-phase: capture; + + Shortcut { + trigger: "Page_Up"; + action: "action(win.previous-date)"; + } + + Shortcut { + trigger: "Page_Down"; + action: "action(win.next-date)"; + } + } + Viewport { Box content { orientation: horizontal;