Problem:
The Zen browser was experiencing random crashes when switching tabs, particularly
when creating a new tab with Ctrl+T and typing a URL. The crash logs showed
"CompositorBridgeChild receives IPC close with reason=AbnormalShutdown" errors,
indicating issues with the graphics compositor during tab switching operations.
This was caused by race conditions in the tab switching code and lack of proper
error handling when dealing with browser elements that might be in an invalid state.
Solution:
Instead of just catching errors, we've implemented a more robust solution that addresses
the root causes of the race conditions in the tab switching code:
1. State Management System:
- Added a queue-based system for tab operations to ensure they execute in sequence
- Implemented debouncing to prevent rapid tab switching that could cause race conditions
- Added state validation before operations to ensure browser elements are in a valid state
2. Asynchronous Operation Handling:
- Used Promises and async/await for proper sequencing of operations
- Added proper timing controls with small delays to ensure DOM is ready
- Implemented a mutex-like approach to prevent concurrent workspace changes
3. Robust Tab State Validation:
- Added comprehensive checks for tab validity before operations
- Implemented proper cleanup of resources to prevent memory leaks
- Added validation for browser window state to prevent operations on closed windows
4. Improved Error Recovery:
- Added fallback mechanisms when operations fail
- Implemented proper cleanup of state even when errors occur
- Added more informative error messages for better debugging
These changes make the browser much more robust when handling tab switching operations,
preventing the crashes reported in issue #7716.
This commit fixes an issue where dragging workspaces to change their position doesn't work on Linux platforms.
The main changes include:
1. Added Linux-specific drag and drop handling with a transparent drag image
2. Enhanced dragover event handling for better visual feedback on Linux
3. Improved CSS styles for drag and drop elements on Linux
4. Added clearer comments to explain the reorder mode behavior
The issue was that the drag and drop functionality wasn't working properly on Linux due to platform-specific behavior differences. This fix ensures that workspace reordering works consistently across all platforms.