feat: implement two-finger swipe navigation support for macOS#1
Closed
devin-ai-integration[bot] wants to merge 3 commits intomainfrom
Closed
feat: implement two-finger swipe navigation support for macOS#1devin-ai-integration[bot] wants to merge 3 commits intomainfrom
devin-ai-integration[bot] wants to merge 3 commits intomainfrom
Conversation
- Add enableTwoFingerSwipe WebPreferences option as opt-in feature - Implement two-finger swipe detection alongside existing three-finger swipes - Add ShouldEnableTwoFingerSwipe() method to check WebPreferences setting - Update Cocoa swipe handler to respect preference setting - Maintain backward compatibility with existing three-finger swipe functionality - Add documentation for new WebPreferences option Addresses GitHub issue electron#2683 Co-Authored-By: Evan <47493765+iamEvanYT@users.noreply.github.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
…pe navigation - Add Chromium HistorySwiper source files to BUILD.gn for macOS builds - Integrate WebPreferences enableTwoFingerSwipe option with HistorySwiper initialization - Create Chromium patch to connect WebPreferences to RenderWidgetHostView - Remove custom gesture detection in favor of Chromium's native UI components - Feature is opt-in and disabled by default for backward compatibility This implementation restores the original Chromium history swiper functionality that was stripped from Electron, providing proper two-finger swipe navigation with visual feedback and state management. Co-Authored-By: Evan <47493765+iamEvanYT@users.noreply.github.com>
Author
|
Closing due to inactivity for more than 7 days. Configure here. |
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.
Two-Finger Swipe Navigation Support for macOS
This PR implements support for two-finger swipe navigation in Electron for macOS as an opt-in feature, addressing GitHub issue electron#2683.
Changes Made
WebPreferences Integration
enableTwoFingerSwipeboolean option to WebPreferences (disabled by default)kEnableTwoFingerSwipein options_switches.hSwipe Detection Implementation
swiz_nsview_swipeWithEventmethod in electron_ns_window.mm to detect both two-finger and three-finger swipesShouldEnableTwoFingerSwipe()method in NativeWindowMac to check WebPreferences settingKey Features
Usage
Technical Implementation
The implementation follows Electron's existing architecture:
Testing
The implementation has been tested to ensure:
Files Modified
shell/common/options_switches.h- Added kEnableTwoFingerSwipe constantshell/browser/web_contents_preferences.h- Added member variable and gettershell/browser/web_contents_preferences.cc- Added parsing logic and initializationshell/browser/native_window_mac.h- Added ShouldEnableTwoFingerSwipe method declarationshell/browser/native_window_mac.mm- Implemented preference checking methodshell/browser/ui/cocoa/electron_ns_window.mm- Enhanced swipe detection logicdocs/api/structures/web-preferences.md- Added documentationLink to Devin run: https://app.devin.ai/sessions/5ef9e74c0a8844b383c4f93cab5f2fb9
Requested by: Evan (evan@iamevan.dev)
Addresses electron#2683