Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
9689386
feat: Enhance Linux support for screen sharing and dependencies
jeanfbrito Dec 16, 2025
74d4c52
chore: Bump version to 4.10.2 in package.json
jeanfbrito Dec 16, 2025
5fd2177
feat(videoCall): Implement screen sharing request handling and cleanu…
jeanfbrito Dec 16, 2025
43fca4f
fix(videoCall): Improve screen sharing timeout handling and listener …
jeanfbrito Dec 16, 2025
bf19755
fix(videoCall): Refactor screen sharing listener cleanup and request …
jeanfbrito Dec 16, 2025
1536973
feat(gpuFallback): Implement GPU crash detection and fallback mode fo…
jeanfbrito Dec 17, 2025
14e6054
fix(app): Adjust crash count condition and preserve command-line argu…
jeanfbrito Dec 17, 2025
e215b0a
feat: Enhance Linux display server support and crash handling
jeanfbrito Dec 17, 2025
f16c74e
refactor(app): Streamline GPU crash handling and fallback logic
jeanfbrito Dec 17, 2025
ee99e2a
docs: Update Linux display server documentation and improve GPU crash…
jeanfbrito Dec 17, 2025
717c3d8
feat(scripts): Add installation and testing scripts for Linux
jeanfbrito Dec 18, 2025
afa9bcb
refactor(scripts): Improve error handling in installation and depende…
jeanfbrito Dec 19, 2025
6aeb28a
feat(linux): Enhance Wayland and X11 support for GPU handling
jeanfbrito Dec 19, 2025
2d67ca3
feat(videoCall): Introduce screen picker functionality for enhanced s…
jeanfbrito Dec 19, 2025
88f0833
refactor(videoCall): Improve screen sharing request handling and list…
jeanfbrito Dec 19, 2025
357e1d0
refactor(videoCall): Enhance webview handler setup and error management
jeanfbrito Dec 19, 2025
7c53c96
refactor(gpuFallback): Extend valid fallback modes and improve type s…
jeanfbrito Dec 19, 2025
da81f02
refactor(gpuFallback): Improve fallback mode handling in reducer
jeanfbrito Dec 19, 2025
54cb4bc
refactor(videoCall): Update display media request handling for improv…
jeanfbrito Dec 19, 2025
89b7f94
refactor(config): Clean up whitespace and improve logging consistency
jeanfbrito Dec 19, 2025
3bcca07
fix(build): Update electron-builder command to include appimage target
jeanfbrito Dec 22, 2025
1a4364e
feat(build): Add AppImage support to pull request workflow
jeanfbrito Dec 22, 2025
0c89de9
fix(build): Correct AppImage file extension in pull request workflow
jeanfbrito Dec 22, 2025
580c11d
fix(build): Add AppImage pattern to pull request workflow file matching
jeanfbrito Dec 22, 2025
6a5f124
feat(scripts): Add Linux AppImage testing script
jeanfbrito Dec 22, 2025
6afd8e1
refactor(gpuFallback): Simplify GPU fallback handling and improve log…
jeanfbrito Dec 22, 2025
55efccf
refactor(gpuFallback): Enhance Wayland handling and logging for X11 f…
jeanfbrito Dec 22, 2025
3a2cda8
feat(wayland): Enable native Wayland support by default
jeanfbrito Dec 23, 2025
7f469bb
fix: Address PR review comments
jeanfbrito Dec 23, 2025
602f141
fix(linux): Enforce X11 mode on Wayland sessions
jeanfbrito Dec 23, 2025
74faa87
feat(wayland): Enable native Wayland support by default
jeanfbrito Dec 23, 2025
b3615b7
fix(linux): Add proactive GPU detection with X11 fallback
jeanfbrito Dec 23, 2025
ca1b08f
fix(ci): Fix AppImage upload and PR comment updates
jeanfbrito Dec 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 149 additions & 0 deletions docs/linux-display-server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
# Linux Display Server Configuration

Rocket.Chat Desktop automatically detects and uses the best display server (Wayland or X11) for your system. If the app detects GPU issues during startup, it automatically switches to a compatible mode.

## Default Behavior

| Package Type | Display Server | Notes |
|--------------|---------------|-------|
| **deb/rpm** | Auto-detect | Uses Wayland if available, falls back to X11 |
| **Snap** | Auto-detect | Uses Wayland if available, falls back to X11 |
| **AppImage** | Auto-detect | Uses Wayland if available, falls back to X11 |

## Automatic GPU Crash Recovery

Rocket.Chat Desktop includes automatic GPU crash detection and recovery:

1. **Crash Detection**: If the GPU process crashes during startup (e.g., due to incompatible drivers), the app detects this automatically.

2. **Automatic Fallback**: After detecting crashes, the app saves a fallback mode and relaunches with X11 forced.

3. **Persistent Setting**: The fallback mode is remembered across restarts, preventing repeated crashes.

4. **User Control**: You can view and reset the fallback mode in Settings > General > Display Server Mode.

## Wayland Support

Rocket.Chat Desktop includes native Wayland support with:
- PipeWire screen capture for video calls
- Native OS screen picker integration
- Hardware acceleration

### Requirements for Wayland
- `xdg-desktop-portal` (recommended, auto-suggested by deb/rpm packages)
- `xdg-desktop-portal-gtk` or desktop-specific portal backend
- PipeWire for screen sharing
- Modern GPU drivers

## Known Issues

### Virtual Machines
VMs with paravirtual graphics (QXL, VirtualBox, VMware) may have issues with Wayland GPU acceleration.

**Symptoms:**
```text
ERROR:viz_main_impl.cc:189] Exiting GPU process due to errors during initialization
```

**Automatic Recovery:** The app automatically detects this crash and switches to X11 mode. You should see the app restart and work normally after the first crash.

**Manual Solution:** If auto-recovery doesn't work, force X11 mode:
```bash
rocketchat-desktop --ozone-platform=x11
Comment thread
jeanfbrito marked this conversation as resolved.
Resolved
```

**Settings Option:** Go to Settings > General > Display Server Mode and select "Force X11".

### Screen Sharing Not Working on Wayland

If screen sharing doesn't work on Wayland:

1. Install portal dependencies:
```bash
# Ubuntu/Debian
sudo apt install xdg-desktop-portal xdg-desktop-portal-gtk pipewire

# Fedora
sudo dnf install xdg-desktop-portal xdg-desktop-portal-gtk pipewire

# Arch
sudo pacman -S xdg-desktop-portal xdg-desktop-portal-gtk pipewire
```

2. Restart your session or reboot

3. Verify PipeWire is running:
```bash
systemctl --user status pipewire
```

## Manual Override

You can force a specific display server:

```bash
# Force X11
rocketchat-desktop --ozone-platform=x11

# Force Wayland (if system supports it)
rocketchat-desktop --ozone-platform=wayland
```

## Troubleshooting

### Check Your Display Server
```bash
echo $XDG_SESSION_TYPE
# Output: "wayland" or "x11"
```

### Check GPU Support
```bash
# Check graphics card
lspci | grep -i vga

# Check VA-API support (hardware video decode)
vainfo
```

### Enable Verbose Logging

These are standard Chromium flags that enable detailed logging output:

```bash
rocketchat-desktop --enable-logging --v=1
```

### Disable GPU Acceleration (last resort)
```bash
rocketchat-desktop --disable-gpu
```

## Resetting Display Server Mode

If the app auto-switched to X11 and you want to try Wayland again (e.g., after updating GPU drivers):

1. Open the app (it will run in X11 mode)
2. Go to Settings > General
3. Find "Display Server Mode"
4. Select "Auto-detect (Wayland/X11)"
5. The app will restart and attempt Wayland

If the GPU crashes again, the app will automatically switch back to X11.

## Best Practices

- **Real Hardware + Wayland**: Use default (auto-detection) for best experience
- **VM + Wayland**: The app will auto-detect and switch to X11 after first crash
- **X11 Session**: No configuration needed, works automatically
- **Snap Package**: Uses auto-detection like other package types

## Reporting Issues

When reporting display server issues, include:

1. Display server type: `echo $XDG_SESSION_TYPE`
2. Graphics card: `lspci | grep -i vga`
3. Distribution: `cat /etc/os-release`
4. Package type: snap/deb/rpm/AppImage
5. Full error output with `--enable-logging --v=1`
17 changes: 13 additions & 4 deletions electron-builder.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,26 @@
"deb": {
"fpm": [
"--after-install=build/linux/postinst.sh"
],
"recommends": [
"xdg-desktop-portal",
"xdg-desktop-portal-gtk"
]
},
"rpm": {
"fpm": ["--rpm-rpmbuild-define=_build_id_links none"]
"fpm": [
"--rpm-rpmbuild-define=_build_id_links none",
"--rpm-tag=Recommends: xdg-desktop-portal",
"--rpm-tag=Recommends: xdg-desktop-portal-gtk"
]
},
"snap": {
"plugs": [
"desktop",
"desktop-legacy",
"home",
"x11",
"wayland",
"unity7",
"browser-support",
"network",
Expand All @@ -154,9 +163,9 @@
"audio-playback",
"audio-record",
"screen-inhibit-control",
"upower-observe"
],
"executableArgs": ["--ozone-platform=x11"]
"upower-observe",
"pipewire"
]
},
"afterSign": "./build/notarize.js",
"generateUpdatesFilesForAllChannels": true,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"productName": "Rocket.Chat",
"name": "rocketchat",
"description": "Official OSX, Windows, and Linux Desktop Clients for Rocket.Chat",
"version": "4.10.1",
"version": "4.10.2",
"author": "Rocket.Chat Support <support@rocket.chat>",
"copyright": "© 2016-2025, Rocket.Chat",
"homepage": "https://rocket.chat",
Expand Down
22 changes: 21 additions & 1 deletion rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,27 @@
proc ? 'Restarting main process...' : 'Starting main process...'
);

proc = spawn(electron, ['.'], { stdio: 'inherit' });
const electronArgs = ['.'];

Check failure on line 38 in rollup.config.mjs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, linux)

Delete `······`

Check failure on line 38 in rollup.config.mjs

View workflow job for this annotation

GitHub Actions / build (macos-latest, mac)

Delete `······`

Check failure on line 38 in rollup.config.mjs

View workflow job for this annotation

GitHub Actions / check (windows-latest)

Delete `······`

Check failure on line 38 in rollup.config.mjs

View workflow job for this annotation

GitHub Actions / build (windows-latest, windows)

Delete `······`

Check failure on line 38 in rollup.config.mjs

View workflow job for this annotation

GitHub Actions / check (macos-latest)

Delete `······`

Check failure on line 38 in rollup.config.mjs

View workflow job for this annotation

GitHub Actions / check (ubuntu-latest)

Delete `······`
// Linux-specific flags for development
if (process.platform === 'linux') {
electronArgs.push('--no-sandbox');

Check failure on line 42 in rollup.config.mjs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, linux)

Delete `········`

Check failure on line 42 in rollup.config.mjs

View workflow job for this annotation

GitHub Actions / build (macos-latest, mac)

Delete `········`

Check failure on line 42 in rollup.config.mjs

View workflow job for this annotation

GitHub Actions / check (windows-latest)

Delete `········`

Check failure on line 42 in rollup.config.mjs

View workflow job for this annotation

GitHub Actions / build (windows-latest, windows)

Delete `········`

Check failure on line 42 in rollup.config.mjs

View workflow job for this annotation

GitHub Actions / check (macos-latest)

Delete `········`

Check failure on line 42 in rollup.config.mjs

View workflow job for this annotation

GitHub Actions / check (ubuntu-latest)

Delete `········`
// Auto-detect Wayland and use X11 fallback for stability
// XDG_SESSION_TYPE is set by the display manager
const isWaylandSession = process.env.XDG_SESSION_TYPE === 'wayland';

Check failure on line 46 in rollup.config.mjs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, linux)

Delete `········`

Check failure on line 46 in rollup.config.mjs

View workflow job for this annotation

GitHub Actions / build (macos-latest, mac)

Delete `········`

Check failure on line 46 in rollup.config.mjs

View workflow job for this annotation

GitHub Actions / check (windows-latest)

Delete `········`

Check failure on line 46 in rollup.config.mjs

View workflow job for this annotation

GitHub Actions / build (windows-latest, windows)

Delete `········`

Check failure on line 46 in rollup.config.mjs

View workflow job for this annotation

GitHub Actions / check (macos-latest)

Delete `········`

Check failure on line 46 in rollup.config.mjs

View workflow job for this annotation

GitHub Actions / check (ubuntu-latest)

Delete `········`
if (process.env.FORCE_WAYLAND === 'true') {
// User explicitly wants native Wayland
electronArgs.push('--ozone-platform=wayland');
} else if (process.env.FORCE_X11 === 'true' || isWaylandSession) {
// Use X11: either forced or auto-detected Wayland session
// Wayland sessions often have GPU issues in VMs, X11 is more stable
electronArgs.push('--ozone-platform=x11');
}
}

proc = spawn(electron, electronArgs, { stdio: 'inherit' });

proc.on('close', () => {
proc = null;
Expand Down
139 changes: 139 additions & 0 deletions scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
# Testing Scripts

This directory contains automation scripts for testing Rocket.Chat Desktop on Linux.

## Scripts

### `install-volta.sh`

Installs Volta (JavaScript toolchain manager) if it's not already installed. Volta provides node.js and npm, which are required for building the project.

#### Usage

```bash
# Interactive mode (prompts before installing)
./scripts/install-volta.sh

# Non-interactive mode (installs automatically)
./scripts/install-volta.sh --non-interactive
```

#### What It Does

1. **Checks if Volta is installed**
- Looks for `volta` command in PATH
- Checks `$VOLTA_HOME` environment variable
- Checks common installation location (`~/.volta/bin/volta`)

2. **Installs Volta if missing**
- Downloads and runs the official Volta installer
- Adds Volta to PATH for current session
- Adds Volta to `~/.bashrc` for future sessions

3. **Verifies installation**
- Checks that `volta` command is available
- Displays Volta version

#### Features

- Can be sourced by other scripts to use its functions
- Non-interactive mode for CI/automation
- Automatically adds Volta to shell profile
- Safe to run multiple times (skips if already installed)

#### Requirements

- `curl` (for downloading Volta installer)
- Internet connection

### `linux-test-deb.sh`

Builds, installs, and runs the Rocket.Chat Desktop .deb package for testing purposes.

#### Usage

```bash
./scripts/linux-test-deb.sh [OPTIONS]
```

#### Options

- `--skip-build` - Skip building the .deb package (useful if you've already built it)
- `--skip-install` - Skip installing the .deb package (useful for testing installation separately)
- `--skip-run` - Skip running the installed app (useful if you just want to install)
- `--help`, `-h` - Show help message

#### Examples

Build, install, and run:
```bash
./scripts/linux-test-deb.sh
```

Skip build if .deb already exists:
```bash
./scripts/linux-test-deb.sh --skip-build
```

Only build and install, don't run:
```bash
./scripts/linux-test-deb.sh --skip-run
```

#### What It Does

1. **Builds the .deb package**
- Runs `yarn build-linux` to build the app and create Linux packages
- Outputs to `dist/` directory

2. **Finds the .deb file**
- Searches for `dist/rocketchat-*-linux-*.deb`
- Uses the first matching file found

3. **Installs the .deb package**
- Uninstalls any previous version if present
- Installs the new package using `dpkg -i`
- Automatically fixes missing dependencies with `apt-get install -f`

4. **Runs the installed app**
- Launches Rocket.Chat Desktop from `/opt/Rocket.Chat/rocketchat-desktop`
- Runs in background and displays the process ID

#### Requirements

- Linux operating system
- `node.js` and `yarn` (or Volta - the script will install it automatically if needed)
- `dpkg` and `apt-get` (standard on Debian/Ubuntu systems)
- `curl` (for installing Volta if needed)
- Sudo access (for installation, if not running as root)

#### Automatic Dependency Installation

The script automatically installs missing dependencies:
- **Volta** (if node.js/yarn not found) - provides node.js and npm
- **binutils** (if `ar` command not found) - required for building .deb packages
- **Package dependencies** - automatically resolved during .deb installation

#### Output

The script provides color-coded output:
- 🔵 Blue: Informational messages
- 🟢 Green: Success messages
- 🟡 Yellow: Warnings
- 🔴 Red: Errors

#### Error Handling

The script will exit with a non-zero status code if any step fails. Common issues:

- **Build fails**: Check that all dependencies are installed (`yarn install`)
- **Install fails**: Ensure you have sudo access and the .deb file is valid
- **App not found**: The installation path may differ; check `/opt/Rocket.Chat/` or use `which rocketchat-desktop`

#### Notes

- The script automatically handles uninstalling previous versions
- Missing dependencies are automatically resolved during installation
- The app runs in the background; use `kill <PID>` to stop it
- This script is intended for development/testing purposes only

Loading