Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
35 changes: 34 additions & 1 deletion Dockerfile.ubuntu-helix
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,40 @@ else
rm onlyoffice-desktopeditors_amd64.deb
apt-get clean
rm -rf /var/lib/apt/lists/*
echo "=== OnlyOffice Desktop Editors installed ==="

# OnlyOffice wrapper script for XWayland support
# OnlyOffice bundles Qt5 WITHOUT Wayland plugin - it requires X11 via XWayland.
# The wrapper sets DISPLAY, XAUTHORITY, and cursor theme environment variables.
echo "=== Creating OnlyOffice XWayland wrapper script ==="
cat > /usr/local/bin/onlyoffice-wrapper << 'WRAPPER_EOF'
#!/bin/bash
# OnlyOffice requires X11 via XWayland (Qt5 without Wayland plugin)
export DISPLAY=:0

# Find the Mutter XWayland auth file (name changes on each session)
XAUTH_FILE=$(ls /run/user/1000/.mutter-Xwaylandauth.* 2>/dev/null | tail -1)
if [ -n "$XAUTH_FILE" ]; then
export XAUTHORITY="$XAUTH_FILE"
fi

# Cursor theme for X11 apps - use Helix-Invisible for client-side cursor rendering
export XCURSOR_THEME=Helix-Invisible
export XCURSOR_SIZE=48

# Required library path for bundled Qt5
APP_PATH=/opt/onlyoffice/desktopeditors
export LD_LIBRARY_PATH=$APP_PATH${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}

exec $APP_PATH/DesktopEditors "$@"
WRAPPER_EOF
chmod +x /usr/local/bin/onlyoffice-wrapper

# Replace the original launcher script to use our wrapper
mv /usr/bin/onlyoffice-desktopeditors /usr/bin/onlyoffice-desktopeditors.orig
ln -sf /usr/local/bin/onlyoffice-wrapper /usr/bin/onlyoffice-desktopeditors
ln -sf /usr/local/bin/onlyoffice-wrapper /usr/bin/desktopeditors

echo "=== OnlyOffice Desktop Editors installed with XWayland wrapper ==="
fi
_INSTALL_ONLYOFFICE

Expand Down
7 changes: 5 additions & 2 deletions desktop/ubuntu-config/startup-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,11 @@ gow_log "[start] Remapped Super→Ctrl and CapsLock→Ctrl via XKB (macOS keyboa
if [ -n "\$HELIX_SCALE_FACTOR" ] && [ "\$HELIX_SCALE_FACTOR" -gt 1 ]; then
gow_log "[start] Setting global scaling factor to \$HELIX_SCALE_FACTOR via GSettings..."
gsettings set org.gnome.desktop.interface scaling-factor \$HELIX_SCALE_FACTOR
# Also enable fractional scaling feature (needed for the UI to show scale options)
gsettings set org.gnome.mutter experimental-features "['scale-monitor-framebuffer']"
# Enable fractional scaling + xwayland-native-scaling
# xwayland-native-scaling makes XWayland report physical resolution (e.g., 3840x2160)
# instead of logical resolution (e.g., 1920x1080 at 2x scale). This fixes X11 apps
# like OnlyOffice that only render in the top-left quarter at 4K with scaling.
gsettings set org.gnome.mutter experimental-features "['scale-monitor-framebuffer', 'xwayland-native-scaling']"
fi

# Start Helix services via shared init scripts
Expand Down