Skip to content

Add mouse back/forward navigation on window - #2195

Merged
Niels Laute (niels9001) merged 1 commit into
microsoft:mainfrom
hoshiizumiya:feature-1
Jul 6, 2026
Merged

Niels Laute (niels9001) merged 1 commit into
microsoft:mainfrom
hoshiizumiya:feature-1

Conversation

@hoshiizumiya

Copy link
Copy Markdown
Contributor

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds mouse back/forward button navigation support to the WinUI Gallery window so users can navigate the app’s Frame history using XButton1/XButton2 (commonly found on modern mice).

Changes:

  • Adds a RootGrid_PointerPressed handler that checks PointerPointProperties.IsXButton1Pressed/IsXButton2Pressed and calls rootFrame.GoBack() / rootFrame.GoForward().
  • Wires the PointerPressed event on RootGrid in MainWindow.xaml.
  • Minor XAML comment reformatting (no functional impact).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
WinUIGallery/MainWindow.xaml.cs Implements pointer handler to invoke back/forward navigation on the root Frame.
WinUIGallery/MainWindow.xaml Wires PointerPressed on RootGrid so the window can receive mouse back/forward input.
Comment thread WinUIGallery/MainWindow.xaml Resolved
@niels9001
Niels Laute (niels9001) enabled auto-merge (squash) July 6, 2026 18:25
@niels9001

Copy link
Copy Markdown
Collaborator

LGTM!

Handle XButton1/XButton2 pointer presses on RootGrid to navigate the root
frame back/forward.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@niels9001

Copy link
Copy Markdown
Collaborator

hoshiizumiya I force pushed lineendings so the diff was easier to read.

@niels9001

Copy link
Copy Markdown
Collaborator

/azp run

@niels9001
Niels Laute (niels9001) merged commit 143a500 into microsoft:main Jul 6, 2026
1 check passed
@hoshiizumiya
hoshiizumiya deleted the feature-1 branch July 7, 2026 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants