From 13efefcfd373be7c433762c5447b471a6da711d3 Mon Sep 17 00:00:00 2001 From: Filip Hejmowski <34747899+neriousy@users.noreply.github.com> Date: Fri, 20 Nov 2026 11:01:56 +0100 Subject: [PATCH] fix(app): go back and forward with the mouse buttons on desktop (#65129) --- packages/app/src/shell/titlebar/titlebar.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/app/src/shell/titlebar/titlebar.tsx b/packages/app/src/shell/titlebar/titlebar.tsx index 8ac0eccdeb3..246f92d04c2 100644 --- a/packages/app/src/shell/titlebar/titlebar.tsx +++ b/packages/app/src/shell/titlebar/titlebar.tsx @@ -201,6 +201,17 @@ export function Titlebar(props: { verticalTabs?: { mount?: HTMLElement } }) { }, ]) + // The desktop router keeps its history in memory, so the mouse's Back and Forward buttons do nothing on their own. + // The web app's browser already traverses its real history for them. + if (platform.platform === "desktop") + makeEventListener(window, "mouseup", (event) => { + if (event.button !== 3 && event.button !== 4) return + event.preventDefault() + + if (event.button === 3) return history.back() + history.forward() + }) + return (