[WIP] Fix un-fullscreen functionality for PDF in Peek#45429
Draft
[WIP] Fix un-fullscreen functionality for PDF in Peek#45429
Conversation
- Handle ContainsFullScreenElementChanged event in BrowserControl - Propagate fullscreen state changes through FilePreview to MainWindow - Toggle window presenter between FullScreen and Default modes - Fixes issue where PDF fullscreen button didn't allow toggling back Co-authored-by: yeelam-gordon <73506701+yeelam-gordon@users.noreply.github.com>
Co-authored-by: yeelam-gordon <73506701+yeelam-gordon@users.noreply.github.com>
Co-authored-by: yeelam-gordon <73506701+yeelam-gordon@users.noreply.github.com>
Copilot stopped work on behalf of
yeelam-gordon due to an error
February 5, 2026 15:33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix PDF Fullscreen Toggle in Peek
Problem
When viewing a PDF in Peek and clicking the fullscreen button:
Root Cause
WebView2's CoreWebView2 has
ContainsFullScreenElementproperty andContainsFullScreenElementChangedevent that fires when PDFs go fullscreen, but Peek doesn't handle this event.Solution
Implemented proper fullscreen handling by:
CoreWebView2.ContainsFullScreenElementChangedevent in BrowserControlAppWindow.SetPresenter()to toggle between FullScreen and Default modesImplementation
ContainsFullScreenElementChangedevent handler in BrowserControlFiles Changed
BrowserControl.xaml.cs
FullScreenChangedHandlerdelegate andFullScreenChangedeventCoreWebView2.ContainsFullScreenElementChangedeventFilePreview.xaml / FilePreview.xaml.cs
FullScreenChangedevent to FilePreviewBrowserPreview_FullScreenChangedevent handler in XAMLMainWindow.xaml / MainWindow.xaml.cs
FilePreviewer_FullScreenChangedevent handlerAppWindowPresenterKind.FullScreenandAppWindowPresenterKind.DefaultTESTING_NOTES.md (New)
ARCHITECTURE_NOTES.md (New)
Technical Details
Event Chain:
Key APIs:
CoreWebView2.ContainsFullScreenElementChanged- Detects PDF fullscreen stateAppWindow.SetPresenter(AppWindowPresenterKind)- Native WinUI 3 fullscreen APITesting
See TESTING_NOTES.md for detailed manual testing instructions. Key scenarios:
Documentation
See ARCHITECTURE_NOTES.md for:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.