Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: native wayland support #226

Closed
wants to merge 4 commits into from
Closed
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
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ snap install signal-desktop

| option | default | description |
|--------------|---------|--------------|
| tray-icon | false | Whether or not to use the system tray (minimize to tray) support. This is disabled by default per the request of the Signal developers, because system tray support is not stable. Set to `false`, Signal will stop when you close it and will not have a system tray icon. Set to `true`, Signal will minimize to tray wen you close it, and will have a system tray icon on supported desktops. |
| `tray-icon` | `false` | Whether or not to use the system tray (minimize to tray) support. This is disabled by default per the request of the Signal developers, because system tray support is not stable. Set to `false`, Signal will stop when you close it and will not have a system tray icon. Set to `true`, Signal will minimize to tray wen you close it, and will have a system tray icon on supported desktops. |
| `wayland-native` | `false` | When `true`, this config option forces the Signal Desktop app to start using the Ozone patches to Electron, which means the application can run natively on Wayland in supported setups. |

You can change Snap configuration by running `snap set signal-desktop <key>=<value>`. For example, `snap set signal-desktop tray-icon=true`.

Expand Down
5 changes: 5 additions & 0 deletions snap/hooks/configure
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ tray_icon="$(snapctl get tray-icon)"
if [[ -z "$tray_icon" ]]; then
snapctl set tray-icon=false
fi

wayland_native="$(snapctl get wayland-native)"
if [[ -z "$wayland_native" ]]; then
snapctl set wayland-native=false
fi
8 changes: 8 additions & 0 deletions snap/local/usr/bin/signal-desktop-wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ set -euo pipefail

# Grab the config options
tray_icon="$(snapctl get tray-icon)"
wayland_native="$(snapctl get wayland-native)"

# Define an array of command line options
opts=()
Expand All @@ -15,5 +16,12 @@ if [[ "${tray_icon}" == "true" ]]; then
opts+=("--use-tray-icon")
fi

if [[ "${wayland_native}" == "true" ]]; then
opts+=(
"--enable-features=WaylandWindowDecorations"
"--ozone-platform=wayland"
)
fi

# Run signal-desktop with the gathered arguments
exec "${SNAP}/opt/Signal/signal-desktop" "--no-sandbox" "${opts[@]}" "$@"
11 changes: 6 additions & 5 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -233,18 +233,19 @@ apps:
extensions: [gnome]
command: usr/bin/signal-desktop-wrapper
plugs:
- audio-playback
- audio-record
- browser-support
- camera
- desktop
- desktop-legacy
- home
- network
- opengl
- audio-playback
- audio-record
- removable-media
- unity7
- desktop
- desktop-legacy
- screen-inhibit-control
- unity7
- wayland
environment:
GTK_USE_PORTAL: "1"
TMPDIR: $XDG_RUNTIME_DIR
Loading