Commit 376260f
feat: Enhance Linux support for screen sharing and dependencies (#3162)
* feat: Enhance Linux support for screen sharing and dependencies
- Added `xdg-desktop-portal` and `xdg-desktop-portal-gtk` as recommended dependencies in the Electron builder configuration for improved screen sharing functionality on Linux.
- Removed the ozone platform switch for `x11` in the Electron startup process and enabled PipeWire screen capture support for Wayland environments.
- Updated the display media request handler to utilize system picker for better user experience during screen sharing.
* chore: Bump version to 4.10.2 in package.json
* feat(videoCall): Implement screen sharing request handling and cleanup logic
- Added a timeout mechanism for screen sharing requests to prevent orphaned listeners.
- Introduced cleanup functions for screen sharing listeners and request states to enhance resource management.
- Improved IPC handling for screen sharing source responses, ensuring proper request tracking and error handling.
- Enhanced user experience by preventing concurrent screen sharing requests and managing listener cleanup effectively.
* fix(videoCall): Improve screen sharing timeout handling and listener cleanup
- Added validation to ensure the screen sharing timeout is only processed for the current request, preventing double-invocation.
- Enhanced cleanup logic to clear timeout references and invoke callbacks appropriately, improving resource management and user experience during screen sharing sessions.
* fix(videoCall): Refactor screen sharing listener cleanup and request completion handling
- Introduced `removeScreenSharingListenerOnly` to streamline listener removal and timeout clearing without altering the pending request state.
- Added `markScreenSharingComplete` to reset request states, allowing new screen sharing requests after completion.
- Enhanced existing cleanup logic to improve resource management and prevent concurrent screen sharing requests.
* feat(gpuFallback): Implement GPU crash detection and fallback mode for Linux
- Added a GPU crash handler to automatically switch to X11 mode if the GPU process crashes during startup.
- Introduced a persistent fallback mode setting to remember the user's choice across sessions.
- Enhanced the settings UI to allow users to control the display server mode, including options for auto-detect, force X11, or disable GPU.
- Updated the application to handle GPU fallback mode changes dynamically, improving user experience and stability on Linux systems.
* fix(app): Adjust crash count condition and preserve command-line arguments on relaunch
- Updated the crash detection logic to trigger fallback mode after exceeding the maximum crash count.
- Enhanced the relaunch functionality to preserve command-line arguments, ensuring user inputs are retained during application restarts.
* feat: Enhance Linux display server support and crash handling
- Added Wayland support to the Electron builder configuration, allowing for improved compatibility with modern Linux environments.
- Updated documentation to reflect auto-detection of display servers for Snap packages, enhancing user clarity.
- Refactored crash detection logic to use a more descriptive variable name and improved logging for better debugging during GPU fallback scenarios.
* refactor(app): Streamline GPU crash handling and fallback logic
- Simplified the GPU crash detection process by consolidating logic for tracking crash counts and managing fallback mode.
- Improved logging for better visibility during relaunch scenarios.
- Ensured that the application preserves command-line arguments when relaunching after a GPU crash.
* docs: Update Linux display server documentation and improve GPU crash recovery details
- Clarified the automatic GPU crash detection and recovery process in the documentation.
- Removed version-specific language for GPU crash recovery to streamline information.
- Enhanced the logging section with standard Chromium flags for better debugging.
* feat(scripts): Add installation and testing scripts for Linux
- Introduced `install-volta.sh` to automate the installation of Volta, ensuring node.js and npm are available for building the project.
- Added `linux-test-deb.sh` for building, installing, and running the Rocket.Chat Desktop .deb package, with options to skip build, install, or run steps.
- Created a README.md to document the usage and functionality of the new scripts, enhancing developer experience and automation for testing on Linux.
* refactor(scripts): Improve error handling in installation and dependency management
- Updated `install-volta.sh` to handle installation errors more gracefully by checking the success of the Volta installation command.
- Enhanced `linux-test-deb.sh` to streamline dependency installation checks and provide clearer error messages if installation fails.
- Refactored the package installation logic to handle dependency issues more effectively, ensuring smoother installation processes.
* feat(linux): Enhance Wayland and X11 support for GPU handling
- Implemented auto-detection of Wayland sessions and added logic to relaunch the app with X11 fallback for stability.
- Updated GPU fallback mode to include 'wayland' as a valid option, allowing users to specify their preferred display server.
- Improved logging for GPU crash handling and display server mode selection, enhancing debugging and user experience on Linux.
- Adjusted screen sharing request handling to utilize XDG portal on Wayland sessions, improving compatibility with modern desktop environments.
* feat(videoCall): Introduce screen picker functionality for enhanced screen sharing
- Implemented a new screen picker system to handle display media requests, improving user experience during screen sharing.
- Created internal and portal picker providers to support different environments, including Linux Wayland and X11.
- Enhanced IPC handling for screen sharing requests, ensuring proper state management and preventing concurrent requests.
- Added initialization and cleanup logic for the screen picker, streamlining resource management and improving performance.
* refactor(videoCall): Improve screen sharing request handling and listener management
- Refactored the internal picker handler to enhance state management during screen sharing requests, preventing concurrent requests and ensuring proper cleanup.
- Improved error handling for screen sharing source validation, including better logging for unavailable sources and request timeouts.
- Streamlined the listener setup and removal process, enhancing resource management and overall performance during screen sharing operations.
* refactor(videoCall): Enhance webview handler setup and error management
- Refactored the setup of webview handlers to use lazy loading for the screen picker module, improving performance and preventing blocking during webview initialization.
- Improved error handling in the display media request handler, ensuring that errors are logged without disrupting the webview loading process.
- Updated the internal picker provider to streamline the handling of display media requests, particularly for Linux environments.
* refactor(gpuFallback): Extend valid fallback modes and improve type safety
- Updated the GPU fallback mode validation to include 'wayland' as a valid option, enhancing compatibility with modern Linux environments.
- Improved type safety in the reducer by refining the type checks for fallback modes, ensuring better error handling and maintainability.
* refactor(gpuFallback): Improve fallback mode handling in reducer
- Updated the GPU fallback mode reducer to return the current state if the provided fallback mode is invalid, enhancing stability and preventing unintended state changes.
- This change ensures that only valid fallback modes are accepted, improving overall type safety and error handling.
* refactor(videoCall): Update display media request handling for improved platform compatibility
- Enhanced comments in the IPC and PortalPickerProvider files to clarify the behavior of the display media request handler across different platforms, particularly focusing on macOS and Linux/Wayland.
- Adjusted the handling of the XDG portal picker to ensure it returns a valid source or an empty array, improving robustness in source selection during screen sharing.
* refactor(config): Clean up whitespace and improve logging consistency
- Removed unnecessary whitespace in rollup configuration and video call window files for better readability.
- Consolidated console log statements in the app setup to enhance clarity and maintain consistency in logging format.
- Improved import organization in screen picker files to follow a more structured format.
* fix(build): Update electron-builder command to include appimage target
- Modified the build command in the pull request workflow to include 'appimage' as a target alongside 'snap' and 'deb', enhancing the packaging options for Linux distributions.
* feat(build): Add AppImage support to pull request workflow
- Updated the pull request build workflow to include the AppImage target in the S3 upload command, expanding the packaging options for Linux distributions.
* fix(build): Correct AppImage file extension in pull request workflow
- Updated the file extension for AppImage in the S3 upload command from '.AppImage' to '.appimage' to ensure proper handling of the file format during the build process.
* fix(build): Add AppImage pattern to pull request workflow file matching
- Updated the file matching patterns in the pull request build workflow to include the AppImage file extension, ensuring proper identification and handling of AppImage artifacts during the build process.
* feat(scripts): Add Linux AppImage testing script
- Introduced a new script for testing the Rocket.Chat Linux AppImage, which includes steps for building, making the AppImage executable, and running it.
- The script provides options to skip build, installation, and execution, along with informative logging for each step.
- Enhanced the relaunch functionality in the app to support AppImage, ensuring reliable relaunch behavior.
* refactor(gpuFallback): Simplify GPU fallback handling and improve logging
- Removed unnecessary session type checks for Wayland, streamlining the logic for determining X11 fallback needs.
- Updated logging messages for clarity when relaunching the app with X11.
- Adjusted the order of GPU crash handler setup to catch early failures more effectively.
* refactor(gpuFallback): Enhance Wayland handling and logging for X11 fallback
- Introduced a check for Wayland sessions in handleLinuxDisplayServer to default to XWayland for stability, addressing potential GPU issues on virtual machines.
- Updated logging messages to clarify the use of XWayland when a Wayland session is detected, improving user guidance on display server settings.
- Removed redundant Wayland session checks from performElectronStartup, streamlining the GPU fallback logic.
* feat(wayland): Enable native Wayland support by default
Use native Wayland when available instead of forcing X11 fallback.
The GPU crash handler will automatically switch to X11 if issues occur.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: Address PR review comments
- Remove X11 forcing on Wayland in linux-test-deb.sh (use native Wayland)
- Fix console.log formatting with JSON.stringify in src/main.ts
- Fix misleading success message in test scripts when app exits early
- Remove unnecessary `as any` type assertion in InternalPickerProvider.ts
* fix(linux): Enforce X11 mode on Wayland sessions
Always use X11 (XWayland) on Wayland sessions for stability.
The app automatically relaunches with --ozone-platform=x11
when a Wayland session is detected.
* feat(wayland): Enable native Wayland support by default
Use native Wayland when available instead of forcing X11 fallback.
The GPU crash handler will automatically switch to X11 if issues occur.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(linux): Add proactive GPU detection with X11 fallback
- Remove sentinel file system (crash counting, timing windows)
- Add gpu-info-update listener to detect GPU issues early
- Check gpu_compositing and webgl status for disabled/unavailable states
- Relaunch with --disable-gpu --ozone-platform=x11 when GPU is broken
- Simplify crash handler to immediately trigger fallback on GPU crash
* fix(ci): Fix AppImage upload and PR comment updates
- Fix case sensitivity: rocketchat-*.appimage → rocketchat-*.AppImage
(AWS CLI on Linux is case-sensitive, file wasn't being uploaded)
- Fix sticky comment header to use simple identifier instead of markdown
- Remove redundant recreate/append flags (defaults work correctly)
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent 6298e8c commit 376260f
File tree
18 files changed
+1570
-61
lines changed- .github/workflows
- docs
- scripts
- src
- app/main
- videoCallWindow
- screenPicker
- providers
18 files changed
+1570
-61
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
522 | 522 | | |
523 | 523 | | |
524 | 524 | | |
525 | | - | |
| 525 | + | |
526 | 526 | | |
527 | 527 | | |
528 | 528 | | |
| |||
586 | 586 | | |
587 | 587 | | |
588 | 588 | | |
| 589 | + | |
589 | 590 | | |
590 | 591 | | |
591 | 592 | | |
| |||
601 | 602 | | |
602 | 603 | | |
603 | 604 | | |
604 | | - | |
| 605 | + | |
605 | 606 | | |
606 | 607 | | |
607 | 608 | | |
| |||
616 | 617 | | |
617 | 618 | | |
618 | 619 | | |
| 620 | + | |
619 | 621 | | |
620 | 622 | | |
621 | 623 | | |
622 | | - | |
623 | | - | |
624 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
136 | 140 | | |
137 | 141 | | |
138 | 142 | | |
139 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
140 | 148 | | |
141 | 149 | | |
142 | 150 | | |
143 | 151 | | |
144 | 152 | | |
145 | 153 | | |
146 | 154 | | |
| 155 | + | |
147 | 156 | | |
148 | 157 | | |
149 | 158 | | |
| |||
154 | 163 | | |
155 | 164 | | |
156 | 165 | | |
157 | | - | |
158 | | - | |
159 | | - | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
160 | 169 | | |
161 | 170 | | |
162 | 171 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
38 | 45 | | |
39 | 46 | | |
40 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
0 commit comments