Skip to content

Add mouse back/forward navigation on window#2195

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

Add mouse back/forward navigation on window#2195
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
@niels9001 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 niels9001 merged commit 143a500 into microsoft:main Jul 6, 2026
2 checks 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants