Fix bookmark bar submenu tooltip display issues
Minor
Commit Hash:
3cce590930e8f037981f136cc0c797e75eac1af0
Commit Time: 2026-01-05 21:45:52+00:00
Impact Level: Minor
Generated By: webview2-upstream-sentry
Upstream Review:
View Upstream Review 🔗
📋 Summary
This commit fixes incorrect tooltip display issues in nested menu scenarios. When nested menus are open (e.g., second-level, third-level submenus), mouse events are captured by the parent menu's BridgedContentView. Previously, the tooltip update was being called on the parent view, which caused tooltips to not display correctly or fail to update when the mouse cursor is actually over a different window (the submenu window).
Changes include:
1. Added logic in the
2. Added code to retrieve the BridgedContentView corresponding to the event window (event_view)
3. If event_view exists, call that view's
4. Updated comments to more clearly explain the importance of this behavior for nested menus
Changes include:
1. Added logic in the
processCapturedMouseEvent: method to forward tooltip updates to the BridgedContentView of the window where the mouse event actually occurred2. Added code to retrieve the BridgedContentView corresponding to the event window (event_view)
3. If event_view exists, call that view's
updateTooltipIfRequiredAt:bridge: method instead of calling the current view's method4. Updated comments to more clearly explain the importance of this behavior for nested menus
🎯 Impact Analysis
The impact of this change on WebView2Mac is **Minor**.
**Impact Analysis:**
1. **Limited Scope of Changes**: The modification only affects mouse event handling and tooltip update logic in BridgedContentView, specifically targeting nested menu scenarios
2. **WebView2Mac Usage Scenarios**: WebView2Mac typically does not directly handle complex nested menu systems (which are primarily a browser bookmark bar feature), so it is unlikely to trigger this specific code path
3. **Potential Impact Points**:
- If WebView2Mac's host application uses context menus or dropdown menus with nested submenus, tooltip display will be more accurate
- HostingNSWindowBridge inherits from NativeWidgetNSWindowBridge and may indirectly benefit from this fix
- Since BridgedContentView is a core view class in Remote Cocoa, any WebView2Mac components using this class will include this fix
4. **Risk Assessment**:
- The change logic is clear and limited, mainly involving conditional checks and target view selection for method calls
- Maintains backward compatibility (falls back to original logic when event_view doesn't exist)
- Does not involve interface signature changes or new required methods
**Conclusion**: This is a targeted bug fix that primarily improves user experience in nested menu scenarios. It has no direct impact on WebView2Mac's core embedded web content functionality, but may improve tooltip display accuracy in specific UI scenarios.
**Impact Analysis:**
1. **Limited Scope of Changes**: The modification only affects mouse event handling and tooltip update logic in BridgedContentView, specifically targeting nested menu scenarios
2. **WebView2Mac Usage Scenarios**: WebView2Mac typically does not directly handle complex nested menu systems (which are primarily a browser bookmark bar feature), so it is unlikely to trigger this specific code path
3. **Potential Impact Points**:
- If WebView2Mac's host application uses context menus or dropdown menus with nested submenus, tooltip display will be more accurate
- HostingNSWindowBridge inherits from NativeWidgetNSWindowBridge and may indirectly benefit from this fix
- Since BridgedContentView is a core view class in Remote Cocoa, any WebView2Mac components using this class will include this fix
4. **Risk Assessment**:
- The change logic is clear and limited, mainly involving conditional checks and target view selection for method calls
- Maintains backward compatibility (falls back to original logic when event_view doesn't exist)
- Does not involve interface signature changes or new required methods
**Conclusion**: This is a targeted bug fix that primarily improves user experience in nested menu scenarios. It has no direct impact on WebView2Mac's core embedded web content functionality, but may improve tooltip display accuracy in specific UI scenarios.
Impacted Classes:
remote_cocoa::BridgedContentView
remote_cocoa::NativeWidgetNSWindowBridge