diff --git a/.github/README.md b/.github/README.md
index bc92e23d5f94..e77a92d1b941 100644
--- a/.github/README.md
+++ b/.github/README.md
@@ -4,7 +4,7 @@
# LinuxFiles
-LinuxFiles is an independent Linux-only file manager built with C#/.NET 10 and Uno Platform's Skia desktop host. It runs on X11, including XWayland on Wayland desktops, without Windows or Wine.
+LinuxFiles is an independent Linux-only file manager built with C#/.NET 10 and Uno Platform's Skia desktop host. Current source builds prefer native Wayland through the Uno 6.7 fork and fall back to X11/XWayland, without Windows or Wine. Published alpha4 assets remain X11/XWayland; native Wayland ships with the next validated release.
Based on [Files](https://github.com/files-community/Files) by the [Files Community](https://github.com/files-community) and its [contributors](https://github.com/files-community/Files/graphs/contributors), this fork is not affiliated with or endorsed by the Files Community. LinuxFiles has no Windows support or upstream sync. Individual upstream fixes may be brought over selectively with attribution; see the [upstream policy](../docs/linux-port/upstream-policy.md).
@@ -23,7 +23,7 @@ See the [showcase](../docs/linux-port/SHOWCASE.md) for screenshots and [packagin
## Known limits
-- X11/XWayland only; native Wayland and AT-SPI accessibility are not implemented. Text and icons can look soft under XWayland, particularly with fractional scaling. See [Troubleshooting](#troubleshooting).
+- AT-SPI accessibility is not implemented. The native Wayland host still needs compositor and package validation before release; see [the Wayland handoff](../docs/linux-port/wayland-packages.md#maintainer-and-build-handoff). Alpha4 and X11 fallback can show soft text under fractional compositor scaling; see [Troubleshooting](#troubleshooting).
- Select-all in folders with around 10,000 items remains slow because of Uno selection handling.
- Tags use Linux extended attributes and a local database. Extended-attribute writes can fail on read-only files or unsupported filesystems; alpha4 preserves edits in the database across reloads and restarts, but those edits cannot be written back to the file when xattrs fail.
- Release packages target x86_64. arm64 publishing is wired but untested. Network/MTP browsing requires a working GVfs session.
@@ -137,18 +137,24 @@ curl -LO https://github.com/MemerGamer/LinuxFiles/releases/download/nightly/Linu
## Troubleshooting
+**Choose a host (current source / future Wayland release):** `UNO_SKIA_HOST=x11 files` forces X11/XWayland; `UNO_SKIA_HOST=wayland files` requires native Wayland. The default chooses Wayland when available and falls back to X11 when `WAYLAND_DISPLAY` is unset. Restart Files when switching. See [host and package details](../docs/linux-port/wayland-packages.md).
+
**Soft text or icons on niri / xwayland-satellite:** Enable **Detect display scale from the compositor (experimental)** in Settings > Appearance and restart Files to use niri's focused output scale when no Uno, Xft, GDK or Qt scale hint is present and both `NIRI_SOCKET` and `WAYLAND_DISPLAY` are set. Check stderr for `[display-scale]` to see whether IPC or CLI detection succeeded. Detection defaults off and may double-scale on some setups. `FILES_NIRI_SCALE=1` forces it on and `FILES_NIRI_SCALE=0` forces it off, overriding the saved preference. Launch with `UNO_DISPLAY_SCALE_OVERRIDE=1.25 files` to select a scale manually (replace `1.25` with your output scale). The scale is chosen at startup. See [display scale details](../docs/linux-port/appearance-transparency.md#display-scale-on-niri).
## Building from source
-Install the .NET 10 SDK and the native Linux dependencies: fontconfig, FreeType, X11 libraries (Xcursor, Xrandr, Xi and Xext), Mesa/OpenGL and GLib. An X11 server or XWayland is required to run the app. See the [AUR recipe](../packaging/linux/aur/linuxfiles-bin/PKGBUILD) for the Arch package names.
+Install the .NET 10 SDK and the native Linux dependencies: fontconfig, FreeType, Wayland client/cursor/EGL libraries, xkbcommon, X11 libraries (Xcursor, Xrandr, Xi and Xext), Mesa/OpenGL/EGL and GLib. Run with a Wayland compositor or X11/XWayland. Fetch the pinned Uno fork packages from its public GitHub Release before restoring (Bash, Python 3, curl, coreutils and util-linux required). See the [AUR recipe](../packaging/linux/aur/linuxfiles-bin/PKGBUILD) for Arch package names and [package setup](../docs/linux-port/wayland-packages.md) for the initial publisher step.
```sh
git clone https://github.com/MemerGamer/LinuxFiles.git
cd LinuxFiles
+build/fetch-uno-wayland.sh
+build/clear-uno-wayland-cache.sh
dotnet build src/Files.App -f net10.0-desktop
```
+To build with upstream X11 packages, use `dotnet build src/Files.App -f net10.0-desktop -p:UseUnoWayland=false`; no fork fetch is needed. `scripts/linux/publish.sh --x11` provides the same opt-out for publishing.
+
For self-contained publishing and a user-local install:
```sh
@@ -170,7 +176,7 @@ Submit focused pull requests to `main` in [MemerGamer/LinuxFiles](https://github
## Credits
- **[Files Community](https://github.com/files-community)** and all [upstream contributors](https://github.com/files-community/Files/graphs/contributors): the Files app, its design, code and translations (via [Crowdin](https://crowdin.com/project/files-app)) that this port is built on. Files is licensed under the MIT License, with some files under the Mozilla Public License 2.0 (MPL-2.0), Copyright (c) 2018 - present Files Community.
-- **[Uno Platform](https://platform.uno/)**: WinUI on Skia/X11 for Linux, which makes this port possible.
+- **[Uno Platform](https://platform.uno/)**: WinUI on Skia for Linux, including the [native Wayland fork](https://github.com/MemerGamer/uno/tree/wayland/host), which makes this port possible.
- **[SkiaSharp](https://github.com/mono/SkiaSharp)**, **[Selawik](https://github.com/microsoft/Selawik)** (UI font) and **Uno.Fonts.Fluent** (icons).
- **[Tmds.DBus](https://github.com/tmds/Tmds.DBus)**, **[TagLibSharp](https://github.com/mono/taglib-sharp)**, **[Markdig](https://github.com/xoofx/markdig)**, **[ColorCode](https://github.com/CommunityToolkit/ColorCode-Universal)**, **[LibGit2Sharp](https://github.com/libgit2/libgit2sharp)**, **[FluentFTP](https://github.com/robinrodricks/FluentFTP)**, **[SharpCompress](https://github.com/adamhathcock/sharpcompress)**, **[7-Zip](https://www.7-zip.org/)** and the .NET Community Toolkit.
diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml
index f71dada249fd..67dac0af6fab 100644
--- a/.github/workflows/ci-linux.yml
+++ b/.github/workflows/ci-linux.yml
@@ -44,7 +44,7 @@ jobs:
- name: Install platform test dependencies
run: |
sudo apt-get update
- sudo apt-get install -y --no-install-recommends xvfb xauth x11-utils x11-xkb-utils xkb-data libx11-6 libfontconfig1 fonts-dejavu-core bubblewrap ffmpeg poppler-utils dbus
+ sudo apt-get install -y --no-install-recommends xvfb xauth x11-utils x11-xkb-utils xkb-data libx11-6 libwayland-client0 libwayland-cursor0 libwayland-egl1 libxkbcommon0 libegl1 libfontconfig1 fonts-dejavu-core bubblewrap ffmpeg poppler-utils dbus
# Ubuntu 24.04 runners block unprivileged user namespaces, which bubblewrap needs.
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 || true
@@ -62,14 +62,23 @@ jobs:
with:
global-json-file: global.json
+ - name: Check Uno package downloader (offline)
+ run: python3 build/tests/test-fetch-uno-wayland.py
+
+ - name: Fetch verified Uno Wayland packages
+ run: build/fetch-uno-wayland.sh
+
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
- key: ${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Packages.props') }}
+ key: ${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Packages.props', 'Directory.Build.props', 'nuget.wayland.config', 'build/uno-wayland-packages.sha256') }}
restore-keys: |
${{ runner.os }}-nuget-
+ - name: Remove cached Uno fork packages before restore
+ run: build/clear-uno-wayland-cache.sh
+
- name: Build Files.Shared
run: dotnet build src/Files.Shared/Files.Shared.csproj -c Release -warnaserror
diff --git a/.github/workflows/nightly-linux.yml b/.github/workflows/nightly-linux.yml
index 82b45261d8a0..e81e6b562a25 100644
--- a/.github/workflows/nightly-linux.yml
+++ b/.github/workflows/nightly-linux.yml
@@ -40,14 +40,20 @@ jobs:
with:
global-json-file: global.json
+ - name: Fetch verified Uno Wayland packages
+ run: build/fetch-uno-wayland.sh
+
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
- key: ${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Packages.props') }}
+ key: ${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Packages.props', 'Directory.Build.props', 'nuget.wayland.config', 'build/uno-wayland-packages.sha256') }}
restore-keys: |
${{ runner.os }}-nuget-
+ - name: Remove cached Uno fork packages before restore
+ run: build/clear-uno-wayland-cache.sh
+
- name: Publish self-contained linux-x64
run: scripts/linux/publish.sh --rid linux-x64 --tarball
diff --git a/.github/workflows/package-linux.yml b/.github/workflows/package-linux.yml
index 43498a61a255..fd0cd7a81ecb 100644
--- a/.github/workflows/package-linux.yml
+++ b/.github/workflows/package-linux.yml
@@ -37,14 +37,20 @@ jobs:
with:
global-json-file: global.json
+ - name: Fetch verified Uno Wayland packages
+ run: build/fetch-uno-wayland.sh
+
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
- key: ${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Packages.props') }}
+ key: ${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Packages.props', 'Directory.Build.props', 'nuget.wayland.config', 'build/uno-wayland-packages.sha256') }}
restore-keys: |
${{ runner.os }}-nuget-
+ - name: Remove cached Uno fork packages before restore
+ run: build/clear-uno-wayland-cache.sh
+
- name: Publish self-contained linux-x64
run: scripts/linux/publish.sh --rid linux-x64 --tarball
diff --git a/.gitignore b/.gitignore
index 65f3f1fec003..b0e30df4cec2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -405,6 +405,7 @@ FodyWeavers.xsd
# JetBrains Rider
*.sln.iml
.idea/
+# Local tools and verified Uno fork package feed (.cache/uno-wayland-feed).
.cache/
# Shared opt-in Linux publish analysis profile
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b4a8851a8724..3e86978818e5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,9 @@ LinuxFiles is an independent Linux-only fork of [Files](https://github.com/files
## Unreleased
+- Linux builds prefer the native Uno Wayland host, retain automatic X11 fallback and support `UNO_SKIA_HOST=x11|wayland|auto`. Build with `-p:UseUnoWayland=false` or publish with `--x11` to use upstream X11 packages.
+- Distribute the eight pinned Uno fork packages through public, versioned GitHub Release assets with SHA-256 verification into a repo-local feed. CI and source publishing fetch them; AppImage, Flatpak, AUR binary and Nix consume the application release. Add Wayland runtime dependencies and the Flatpak Wayland socket. The fork's revision 4 release must be published and validated before shipping; alpha4 assets are unchanged. See [the package contract and handoff](docs/linux-port/wayland-packages.md).
+
Pull requests merged after `linux-v0.1.0-alpha4`, from the stored `origin/main` history:
- [#157](https://github.com/MemerGamer/LinuxFiles/pull/157): Update the Nix flake to alpha4 and its release hashes, including compatible NixOS root-actions support.
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 309fc1a8fd7e..7ccf8f42d0ac 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,6 +1,6 @@
# Contributing to LinuxFiles
-LinuxFiles is an independent Linux-only fork of [Files](https://github.com/files-community/Files), built with C#/.NET 10 and Uno Platform (Skia, X11/XWayland). It has no Windows support or upstream sync. Read [AGENTS.md](AGENTS.md), [CLAUDE.md](CLAUDE.md), [Linux agent rules](docs/linux-port/AGENT-RULES.md) and the [upstream policy](docs/linux-port/upstream-policy.md) before changing code. Historical porting plans are archived context.
+LinuxFiles is an independent Linux-only fork of [Files](https://github.com/files-community/Files), built with C#/.NET 10 and Uno Platform (Skia, Wayland/X11). It has no Windows support or upstream sync. Read [AGENTS.md](AGENTS.md), [CLAUDE.md](CLAUDE.md), [Linux agent rules](docs/linux-port/AGENT-RULES.md) and the [upstream policy](docs/linux-port/upstream-policy.md) before changing code. Historical porting plans are archived context.
## Issues and pull requests
@@ -16,15 +16,19 @@ Treat file operations, clipboard, drag/drop, previews, archives, settings persis
## Build and validation
-Install the .NET 10 SDK and [Linux desktop dependencies](.github/README.md#building-from-source). Run affected builds first, sequentially:
+Install the .NET 10 SDK and [Linux desktop dependencies](.github/README.md#building-from-source). Linux builds default to the pinned Uno Wayland fork; obtain the public release packages before restoring. See [Wayland package setup](docs/linux-port/wayland-packages.md) and its publisher/build handoff. Run affected builds first, sequentially:
```sh
+build/fetch-uno-wayland.sh
+build/clear-uno-wayland-cache.sh
dotnet build src/Files.App -f net10.0-desktop
dotnet build tests/Files.Platform.Tests
dotnet test --project tests/Files.Platform.Tests/Files.Platform.Tests.csproj --no-build
```
-Use `scripts/linux/headless-run.sh` for UI checks on a private Xvfb display with a throwaway home. Never launch checks against the user's display or alter desktop settings. Clean up started processes, inspect screenshots before sharing, and never commit private home data or screenshots. If the desktop toolchain is unavailable, use focused reference searches and state which checks were not run.
+The build opt-out is `-p:UseUnoWayland=false` (also pass it to a separate restore); `scripts/linux/publish.sh --x11` publishes without the fork. Runtime `UNO_SKIA_HOST=x11|wayland|auto` selects a host in fork-enabled builds. Use a fresh package version for fork changes; never replace published NuGet packages.
+
+Use `scripts/linux/headless-run.sh` for UI checks on a private Xvfb display with a throwaway home. It covers X11 fallback; native Wayland additionally needs a private nested/headless compositor and the checks in the Wayland handoff. Never launch checks against the user's display or alter desktop settings. Clean up started processes, inspect screenshots before sharing, and never commit private home data or screenshots. If the desktop toolchain is unavailable, use focused reference searches and state which checks were not run.
## AI assistance and attribution
diff --git a/Directory.Build.props b/Directory.Build.props
index d8e3a44c7449..5ce44b5859c3 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -5,6 +5,13 @@
net10.0
$(BaseTargetFramework)-desktop
+
+ $(DesktopTargetFramework)
+ $(DesktopTargetFramework)
+ true
+
+ false
+ true
preview
nullable
diff --git a/Directory.Packages.props b/Directory.Packages.props
index fc15613bd025..399aa722f76c 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -49,4 +49,23 @@
-
\ No newline at end of file
+
+
+ 6.7.135-wayland.4
+
+
+ $(MSBuildThisFileDirectory)nuget.wayland.config
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/build/clear-uno-wayland-cache.sh b/build/clear-uno-wayland-cache.sh
new file mode 100755
index 000000000000..2564ee54c1bd
--- /dev/null
+++ b/build/clear-uno-wayland-cache.sh
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+# Remove the pinned fork cohort from NuGet's global cache before restoring.
+set -euo pipefail
+root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
+version="$(sed -n 's/.*]*>\([^<]*\)<.*/\1/p' "$root/Directory.Packages.props")"
+pins="$(python3 "$root/build/uno-wayland-pins.py" "$version")"
+cache="${NUGET_PACKAGES:-$HOME/.nuget/packages}"
+while read -r _ name; do
+ id="${name%."$version".nupkg}"
+ rm -rf -- "${cache:?}/${id,,}/${version:?}"
+done <<< "$pins"
diff --git a/build/fetch-uno-wayland.sh b/build/fetch-uno-wayland.sh
new file mode 100755
index 000000000000..b81335cf6645
--- /dev/null
+++ b/build/fetch-uno-wayland.sh
@@ -0,0 +1,92 @@
+#!/usr/bin/env bash
+# Fetch the repository-pinned Uno fork release into the repo-local NuGet feed.
+# Usage: build/fetch-uno-wayland.sh [--version X.Y.Z-wayland.N] [--feed DIR] [--import DIR|--from DIR]
+# --import/--from verify local nupkgs offline; SHA256SUMS is an optional cross-check.
+set -euo pipefail
+
+root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
+version="$(sed -n 's/.*]*>\([^<]*\)<.*/\1/p' "$root/Directory.Packages.props")"
+feed="$root/.cache/uno-wayland-feed"
+source_dir=""
+while (($#)); do
+ case "$1" in
+ --version|--feed|--import|--from)
+ (($# >= 2)) || { echo "Missing value for $1" >&2; exit 2; }
+ case "$1" in
+ --version) version="$2" ;;
+ --feed) feed="$2" ;;
+ --import|--from) source_dir="$2" ;;
+ esac
+ shift 2 ;;
+ -h|--help) sed -n '2,4p' "$0"; exit 0 ;;
+ *) echo "Unknown argument: $1" >&2; exit 2 ;;
+ esac
+done
+[[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+-wayland\.[0-9]+$ ]] || { echo 'Expected X.Y.Z-wayland.N version' >&2; exit 2; }
+# Fail before network access or feed writes when the version has no reviewed pins.
+pins="$(python3 "$root/build/uno-wayland-pins.py" "$version")"
+declare -A hashes
+names=()
+while read -r hash name; do
+ hashes["$name"]="$hash"
+ names+=("$name")
+done <<< "$pins"
+base="https://github.com/MemerGamer/uno/releases/download/uno-wayland-$version"
+mkdir -p "$feed"
+exec 9>"$feed/.fetch.lock"
+flock 9
+stage="$(mktemp -d "$feed/.fetch.XXXXXX")"
+trap 'rm -rf -- "$stage"' EXIT
+manifest="$feed/.sha256-$version"
+
+fetch() { # asset destination
+ if [[ -n "$source_dir" ]]; then
+ cp -- "$source_dir/$1" "$2"
+ else
+ curl --fail --location --silent --show-error --retry 3 \
+ --connect-timeout 20 --max-time 600 --proto '=https' --proto-redir '=https' \
+ --output "$2" "$base/$1"
+ fi
+}
+cross_check() {
+ local hash name extra count=0
+ local -A seen=()
+ while read -r hash name extra || [[ -n "$hash$name$extra" ]]; do
+ if [[ ! "$hash" =~ ^[a-f0-9]{64}$ || -z "$name" || -n "$extra" || -z "${hashes["$name"]:-}" || -n "${seen["$name"]:-}" ]]; then
+ echo 'Invalid SHA256SUMS: expected exactly the eight pinned package filenames.' >&2
+ return 1
+ fi
+ [[ "$hash" == "${hashes["$name"]}" ]] || { echo "SHA256SUMS disagrees with committed pin: $name" >&2; return 1; }
+ seen["$name"]=1
+ ((++count))
+ done < "$1"
+ [[ $count -eq ${#names[@]} ]] || { echo 'Incomplete SHA256SUMS' >&2; return 1; }
+}
+matches() { [[ -f "$1" && "$(sha256sum < "$1")" == "$2 -" ]]; }
+if [[ -n "$source_dir" ]]; then
+ if [[ -f "$source_dir/SHA256SUMS" ]]; then
+ fetch SHA256SUMS "$stage/SHA256SUMS"
+ cross_check "$stage/SHA256SUMS"
+ fi
+elif [[ -f "$manifest" ]]; then
+ cross_check "$manifest"
+fi
+for name in "${names[@]}"; do
+ hash="${hashes["$name"]}"
+ # Explicit imports always verify the supplied bytes, even with a valid feed cache.
+ if [[ -z "$source_dir" ]] && matches "$feed/$name" "$hash"; then
+ continue
+ fi
+ if [[ -z "$source_dir" && ! -f "$stage/SHA256SUMS" ]]; then
+ fetch SHA256SUMS "$stage/SHA256SUMS"
+ cross_check "$stage/SHA256SUMS"
+ fi
+ fetch "$name" "$stage/$name"
+ matches "$stage/$name" "$hash" || { echo "Checksum mismatch against committed pin: $name" >&2; exit 1; }
+done
+# Expose imports/downloads only after the complete set passes pin verification.
+for name in "${names[@]}"; do
+ [[ ! -f "$stage/$name" ]] || mv -f -- "$stage/$name" "$feed/$name"
+done
+[[ ! -f "$stage/SHA256SUMS" ]] || mv -f -- "$stage/SHA256SUMS" "$manifest"
+echo "Verified Uno $version packages against repository pins in $feed"
diff --git a/build/tests/test-fetch-uno-wayland.py b/build/tests/test-fetch-uno-wayland.py
new file mode 100644
index 000000000000..35a919c26570
--- /dev/null
+++ b/build/tests/test-fetch-uno-wayland.py
@@ -0,0 +1,221 @@
+"""Offline behavioral checks for the public release downloader (no restore/build)."""
+import hashlib
+import os
+import shutil
+from pathlib import Path
+import subprocess
+import tempfile
+import unittest
+import xml.etree.ElementTree as ET
+
+ROOT = Path(__file__).resolve().parents[2]
+SCRIPT = ROOT / 'build/fetch-uno-wayland.sh'
+IDS = ('Uno.WinUI', 'Uno.WinRT', 'Uno.Foundation', 'Uno.Foundation.Logging',
+ 'Uno.UI.Adapter.Microsoft.Extensions.Logging', 'Uno.WinUI.Runtime.Skia',
+ 'Uno.WinUI.Runtime.Skia.X11', 'Uno.WinUI.Runtime.Skia.Wayland')
+
+
+class FetchTests(unittest.TestCase):
+ def setUp(self):
+ self.temp = tempfile.TemporaryDirectory(prefix='uno-fetch-')
+ self.addCleanup(self.temp.cleanup)
+ self.root = Path(self.temp.name)
+ # Fixture pins live in a separate checkout; production trust cannot be overridden.
+ self.repo = self.root / 'repo'
+ (self.repo / 'build').mkdir(parents=True)
+ (self.repo / 'scripts/linux').mkdir(parents=True)
+ (self.repo / 'packaging/linux/aur/linuxfiles').mkdir(parents=True)
+ for path in ('build/fetch-uno-wayland.sh', 'build/uno-wayland-pins.py',
+ 'build/clear-uno-wayland-cache.sh', 'scripts/linux/gen-aur.sh',
+ 'packaging/linux/aur/linuxfiles/PKGBUILD', 'Directory.Packages.props'):
+ shutil.copy2(ROOT / path, self.repo / path)
+ self.script = self.repo / 'build/fetch-uno-wayland.sh'
+ self.source = self.root / 'release assets'
+ self.feed = self.root / 'local feed'
+ self.source.mkdir()
+ version_node = ET.parse(ROOT / 'Directory.Packages.props').find('.//UnoWaylandVersion')
+ self.version = version_node.text
+ self.names = [f'{name}.{self.version}.nupkg' for name in IDS]
+ # The downloader verifies opaque package bytes; publisher metadata is checked separately.
+ self.manifest = ''
+ for name in self.names:
+ data = f'Fixture payload for {name}\n'.encode()
+ (self.source / name).write_bytes(data)
+ self.manifest += f'{hashlib.sha256(data).hexdigest()} {name}\n'
+ (self.source / 'SHA256SUMS').write_text(self.manifest)
+ self.pinfile = self.repo / 'build/uno-wayland-packages.sha256'
+ self.pins = ''.join(f'{self.version} {line}\n' for line in self.manifest.splitlines())
+ self.pinfile.write_text(self.pins)
+ bindir = self.root / 'bin'
+ bindir.mkdir()
+ # Replay HTTPS downloads locally, preserving curl's output/URL argument contract.
+ curl = bindir / 'curl'
+ curl.write_text('''#!/usr/bin/env python3
+import os, pathlib, shutil, sys
+args = sys.argv[1:]
+url = args[-1]
+expected = 'https://github.com/MemerGamer/uno/releases/download/uno-wayland-' + os.environ['REPLAY_VERSION'] + '/'
+if not url.startswith(expected):
+ sys.exit(2)
+asset = url[len(expected):]
+with open(os.environ['REPLAY_LOG'], 'a') as log:
+ log.write(asset + '\\n')
+if os.environ.get('REPLAY_DENY'):
+ sys.exit(22)
+shutil.copyfile(pathlib.Path(os.environ['REPLAY_SOURCE']) / asset, args[args.index('--output') + 1])
+''')
+ curl.chmod(0o755)
+ self.log = self.root / 'requests'
+ self.env = dict(os.environ, PATH=f'{bindir}:{os.environ["PATH"]}',
+ REPLAY_VERSION=self.version, REPLAY_SOURCE=str(self.source), REPLAY_LOG=str(self.log))
+
+ def fetch(self, *args, offline=True, success=True):
+ command = [str(self.script), '--feed', str(self.feed)]
+ if offline:
+ command += ['--from', str(self.source)]
+ result = subprocess.run(command + list(args), env=self.env, capture_output=True, text=True, timeout=15)
+ if success:
+ self.assertEqual(result.returncode, 0, result.stderr)
+ else:
+ self.assertNotEqual(result.returncode, 0, result.stdout)
+ self.assertEqual([path for path in self.feed.glob('.fetch.*') if path.is_dir()], [], 'Download staging was not cleaned')
+ return result
+
+ def test_import_and_offline_cache_recheck(self):
+ self.fetch()
+ for name in self.names:
+ self.assertEqual((self.feed / name).read_bytes(), (self.source / name).read_bytes())
+ self.env['REPLAY_DENY'] = '1'
+ self.fetch(offline=False)
+ self.assertFalse(self.log.exists(), 'Verified cache should not need network')
+
+ def test_download_uses_pinned_public_asset_contract(self):
+ self.fetch(offline=False)
+ self.assertEqual(set(self.log.read_text().splitlines()), {'SHA256SUMS', *self.names})
+
+ def test_corrupt_cache_is_redownloaded(self):
+ self.fetch()
+ damaged = self.feed / self.names[-1]
+ damaged.write_bytes(b'corrupt cache')
+ self.fetch(offline=False)
+ self.assertEqual(damaged.read_bytes(), (self.source / damaged.name).read_bytes())
+ self.assertEqual(self.log.read_text().splitlines(), ['SHA256SUMS', damaged.name])
+
+ def test_bad_checksum_exposes_no_new_packages(self):
+ (self.source / self.names[-1]).write_bytes(b'corrupt download')
+ result = self.fetch(success=False)
+ self.assertIn('Checksum mismatch', result.stderr)
+ self.assertEqual(list(self.feed.glob('*.nupkg')), [])
+ self.assertEqual(list(self.feed.glob('.sha256-*')), [])
+
+ def test_incomplete_and_untrusted_manifests_are_rejected(self):
+ lines = self.manifest.splitlines(keepends=True)
+ cases = ('', ''.join(lines[:-1]), self.manifest + lines[0],
+ self.manifest.replace(self.names[0], '../outside.nupkg'),
+ self.manifest + '0' * 64 + ' extra.nupkg\n',
+ self.manifest.replace(lines[0][:64], 'not-a-hash'),
+ self.manifest + '\n', '0' * 64 + '\n')
+ for manifest in cases:
+ with self.subTest(manifest=manifest[:90]):
+ (self.source / 'SHA256SUMS').write_text(manifest)
+ self.fetch(success=False)
+ self.assertEqual(list(self.feed.glob('*.nupkg')), [])
+
+ def test_missing_asset_and_failed_download_leave_no_packages(self):
+ (self.source / self.names[-1]).unlink()
+ self.fetch(success=False)
+ self.assertEqual(list(self.feed.glob('*.nupkg')), [])
+ self.env['REPLAY_DENY'] = '1'
+ self.fetch(offline=False, success=False)
+ self.assertEqual(list(self.feed.glob('*.nupkg')), [])
+
+ def test_local_developer_import_needs_no_release_manifest(self):
+ (self.source / 'SHA256SUMS').unlink()
+ self.fetch('--import', str(self.source), offline=False)
+ self.assertEqual(len(list(self.feed.glob('*.nupkg'))), 8)
+ self.assertFalse(self.log.exists())
+
+ def test_import_checks_source_even_when_cache_is_valid(self):
+ self.fetch()
+ (self.source / self.names[0]).write_bytes(b'replaced local build')
+ self.fetch('--import', str(self.source), success=False)
+ self.assertEqual((self.feed / self.names[0]).read_bytes(), f'Fixture payload for {self.names[0]}\n'.encode())
+
+ def test_replacing_packages_and_release_or_cache_manifest_cannot_change_pins(self):
+ self.fetch()
+ name = self.names[0]
+ payload = b'replacement bytes'
+ replacement = self.manifest.replace(self.manifest[:64], hashlib.sha256(payload).hexdigest())
+ (self.source / name).write_bytes(payload)
+ (self.source / 'SHA256SUMS').write_text(replacement)
+ self.fetch(success=False)
+ (self.feed / name).write_bytes(payload)
+ (self.feed / f'.sha256-{self.version}').write_text(replacement)
+ self.fetch(offline=False, success=False)
+ self.assertFalse(self.log.exists())
+ # Remote manifest tampering is equally insufficient in an empty feed.
+ shutil.rmtree(self.feed)
+ self.fetch(offline=False, success=False)
+ self.assertEqual(self.log.read_text().splitlines(), ['SHA256SUMS'])
+ self.assertEqual(list(self.feed.glob('*.nupkg')), [])
+
+ def test_unpinned_versions_and_incomplete_or_invalid_pins_fail_before_fetch(self):
+ for pins in ('# TODO: packages not yet built\n', self.pins.rsplit('\n', 2)[0] + '\n',
+ self.pins + self.pins.splitlines()[0] + '\n',
+ self.pins.replace(self.names[0], '../outside.nupkg')):
+ with self.subTest(pins=pins[:90]):
+ self.pinfile.write_text(pins)
+ result = self.fetch(offline=False, success=False)
+ self.assertFalse(self.feed.exists())
+ self.assertFalse(self.log.exists())
+ self.pinfile.write_text(self.pins)
+ result = self.fetch('--version', '6.7.135-wayland.999', offline=False, success=False)
+ self.assertIn('No complete committed pins', result.stderr)
+ self.assertFalse(self.feed.exists())
+
+ def test_global_cache_cleanup_removes_only_the_eight_fork_versions(self):
+ cache = self.root / 'nuget cache'
+ for id in (*IDS, 'Other.Package'):
+ for version in (self.version, '6.7.135'):
+ path = cache / id.lower() / version
+ path.mkdir(parents=True)
+ (path / 'sentinel').write_bytes(b'cached')
+ result = subprocess.run([str(self.repo / 'build/clear-uno-wayland-cache.sh')],
+ env=dict(self.env, NUGET_PACKAGES=str(cache)), capture_output=True, text=True)
+ self.assertEqual(result.returncode, 0, result.stderr)
+ for id in IDS:
+ self.assertFalse((cache / id.lower() / self.version).exists())
+ self.assertTrue((cache / id.lower() / '6.7.135/sentinel').exists())
+ self.assertTrue((cache / 'other.package' / self.version / 'sentinel').exists())
+
+ def test_source_aur_declares_pinned_inputs_and_imports_offline(self):
+ version = '0.1.0-alpha9'
+ archive = self.root / f'linuxfiles-{version}.tar.gz'
+ archive.write_bytes(b'application source fixture')
+ output = self.root / 'aur'
+ command = [str(self.repo / 'scripts/linux/gen-aur.sh'), version, str(self.root), str(output), 'source']
+ result = subprocess.run(command, env=dict(self.env, AUR_SRCINFO_FALLBACK='1'), capture_output=True, text=True)
+ self.assertEqual(result.returncode, 0, result.stderr)
+ info = (output / '.SRCINFO').read_text()
+ sources = [line.split(' = ', 1)[1] for line in info.splitlines() if line.startswith('\tsource = ')]
+ noextract = [line.split(' = ', 1)[1] for line in info.splitlines() if line.startswith('\tnoextract = ')]
+ sums = [line.split(' = ', 1)[1] for line in info.splitlines() if line.startswith('\tsha256sums = ')]
+ self.assertEqual(len(sources), 9)
+ self.assertEqual(set(noextract), set(self.names))
+ for url, digest in zip(sources[1:], sums[1:]):
+ self.assertEqual(digest, hashlib.sha256((self.source / url.rsplit('/', 1)[1]).read_bytes()).hexdigest())
+ recipe = (output / 'PKGBUILD').read_text()
+ self.assertIn('build/fetch-uno-wayland.sh --from "$srcdir"', recipe)
+ self.assertNotIn('UNGENERATED', ' '.join(sums))
+ self.pinfile.write_text('# TODO\n')
+ self.assertNotEqual(subprocess.run(command, env=self.env, capture_output=True).returncode, 0)
+
+ def test_version_and_argument_validation(self):
+ for args in (('--version', '../bad'), ('--version',), ('--unknown',)):
+ with self.subTest(args=args):
+ result = subprocess.run([str(self.script), *args], env=self.env, capture_output=True, timeout=15)
+ self.assertEqual(result.returncode, 2, result.stderr)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/build/uno-wayland-packages.sha256 b/build/uno-wayland-packages.sha256
new file mode 100644
index 000000000000..f3e664e92c1e
--- /dev/null
+++ b/build/uno-wayland-packages.sha256
@@ -0,0 +1,12 @@
+# Reviewed SHA-256 pins for the published Uno Wayland packages.
+# Format: VERSION SHA256 BARE_PACKAGE_FILENAME (exactly eight rows per version).
+# Add a new version's rows only after building, reviewing and publishing those exact bytes (never rebuild).
+# See docs/linux-port/wayland-packages.md for the update procedure.
+6.7.135-wayland.4 c3927d2afb8ea381fbda5c014668a0841dc8d86d88f959456663f671b913deb7 Uno.WinUI.6.7.135-wayland.4.nupkg
+6.7.135-wayland.4 9e2967eb08dafbe3c477ba826e4c234526015556b1ca4d53150f4a36d19aac9e Uno.WinRT.6.7.135-wayland.4.nupkg
+6.7.135-wayland.4 0df9f906f7efb820722e5cb88b5b704c1aa1171b5a06a1389186fe2660286ff1 Uno.Foundation.6.7.135-wayland.4.nupkg
+6.7.135-wayland.4 99cf03c46f31d2300eac9e1e5c3d4ba4e787cb4189e65b4838aa52509c4b3f52 Uno.Foundation.Logging.6.7.135-wayland.4.nupkg
+6.7.135-wayland.4 a0f7bb012a80bf66e828997dbc162cb893ecdc1519df7bc009b2919e8c97f667 Uno.UI.Adapter.Microsoft.Extensions.Logging.6.7.135-wayland.4.nupkg
+6.7.135-wayland.4 a74e7982cea5d31a6ee85a1562424218f9a0d33fd3c06e255d25f284756fddcf Uno.WinUI.Runtime.Skia.6.7.135-wayland.4.nupkg
+6.7.135-wayland.4 a593d0ef3ffe84ee74b911a3ed2e318c91d138c753ccaa62140ee829d6125906 Uno.WinUI.Runtime.Skia.X11.6.7.135-wayland.4.nupkg
+6.7.135-wayland.4 dcff2c96c437cb7952d4d714568741a810c67d528e2da8bcfba2a6575f93d51c Uno.WinUI.Runtime.Skia.Wayland.6.7.135-wayland.4.nupkg
diff --git a/build/uno-wayland-pins.py b/build/uno-wayland-pins.py
new file mode 100644
index 000000000000..8263028154a2
--- /dev/null
+++ b/build/uno-wayland-pins.py
@@ -0,0 +1,43 @@
+"""Read the repository's trusted Uno package pins; never trust release digests."""
+from pathlib import Path
+import re
+import sys
+
+ROOT = Path(__file__).resolve().parents[1]
+IDS = ('Uno.WinUI', 'Uno.WinRT', 'Uno.Foundation', 'Uno.Foundation.Logging',
+ 'Uno.UI.Adapter.Microsoft.Extensions.Logging', 'Uno.WinUI.Runtime.Skia',
+ 'Uno.WinUI.Runtime.Skia.X11', 'Uno.WinUI.Runtime.Skia.Wayland')
+
+
+def read_pins(version):
+ if not re.fullmatch(r'[0-9]+\.[0-9]+\.[0-9]+-wayland\.[0-9]+', version):
+ raise ValueError('Expected X.Y.Z-wayland.N version')
+ expected = {f'{name}.{version}.nupkg' for name in IDS}
+ pins = {}
+ for number, line in enumerate((ROOT / 'build/uno-wayland-packages.sha256').read_text().splitlines(), 1):
+ if not line.strip() or line.lstrip().startswith('#'):
+ continue
+ fields = line.split()
+ if len(fields) != 3:
+ raise ValueError(f'Invalid pin row {number}: expected VERSION SHA256 FILENAME')
+ pinned_version, digest, name = fields
+ if not re.fullmatch(r'[0-9]+\.[0-9]+\.[0-9]+-wayland\.[0-9]+', pinned_version) or not re.fullmatch(r'[0-9a-f]{64}', digest) or name not in {f'{id}.{pinned_version}.nupkg' for id in IDS}:
+ raise ValueError(f'Invalid pin row {number}')
+ if pinned_version != version:
+ continue
+ if name in pins:
+ raise ValueError(f'Duplicate pin: {name}')
+ pins[name] = digest
+ if set(pins) != expected:
+ raise ValueError(f'No complete committed pins for Uno {version}. Build the eight fork packages, compute SHA-256, commit build/uno-wayland-packages.sha256, then publish those exact bytes. See docs/linux-port/wayland-packages.md. Fetch/import is disabled until all eight pins exist.')
+ return pins
+
+
+if __name__ == '__main__':
+ try:
+ if len(sys.argv) != 2:
+ raise ValueError('Usage: python3 build/uno-wayland-pins.py VERSION')
+ for name, digest in read_pins(sys.argv[1]).items():
+ print(f'{digest} {name}')
+ except (ValueError, OSError) as error:
+ sys.exit(str(error))
diff --git a/docs/linux-port/packaging.md b/docs/linux-port/packaging.md
index d9afd70ec88e..ebd9d6230dff 100644
--- a/docs/linux-port/packaging.md
+++ b/docs/linux-port/packaging.md
@@ -29,6 +29,12 @@ The repo has no SVG logo, so there is no `scalable/` icon. Sizes 16/24/32/48/256
`Square150x150Logo.scale-400.png` (so 512 is a downscale).
A proper SVG should replace these when design provides one.
+## Wayland host and package feed
+
+Current source builds prefer native Wayland and retain X11 fallback. CI and `scripts/linux/publish.sh` fetch the pinned Uno fork release with `build/fetch-uno-wayland.sh`; contributors using `dotnet build` run that script first. The initial fork packages must be built, their hashes committed in LinuxFiles, and those exact bytes published before restore. Fetch/import fails until all eight reviewed pins exist. See [the release asset contract, runtime overrides and build handoff](wayland-packages.md). `-p:UseUnoWayland=false` or `scripts/linux/publish.sh --x11` uses upstream X11 packages without fetching the fork. Alpha4 release assets and the current Nix application pin remain X11-only.
+
+AUR binary and Nix packages use LinuxFiles release tarballs and require no Uno credentials/feed. Source AUR recipes declare the eight pinned Uno nupkgs, mark them `noextract`, and import them from `$srcdir` without downloads before publishing. AppImage uses host Wayland client/cursor/EGL and xkbcommon libraries; Flatpak uses its Freedesktop runtime and exposes both Wayland and X11 sockets. Validate both packaged hosts before publishing the next release and bumping Nix's application version/hashes. Previous package measurements and smoke checks below describe the older X11 builds.
+
## Publishing
```
@@ -66,7 +72,7 @@ release). Verified locally on Arch: all three build.
## AppImage
`packaging/linux/appimage/build-appimage.sh [--arch x86_64|aarch64] [publish-dir]` assembles an AppDir (AppRun sets
-`FILES_LIBDIR`; the runtime is self-contained, host libs such as fontconfig/X11/GL come from the system) and runs
+`FILES_LIBDIR`; the runtime is self-contained, host libs such as fontconfig, Wayland, xkbcommon and X11/GL/EGL come from the system) and runs
`appimagetool`. The tool (1.9.1) and the type2 runtime (20251108) are downloaded into the git-ignored `.cache/tools`
and verified against SHA-256 sums pinned in the script (they match the digests GitHub publishes for those release
assets). Nothing is installed system-wide; without FUSE the tool runs via `APPIMAGE_EXTRACT_AND_RUN`. Output:
@@ -103,7 +109,7 @@ found, so a launch that could not see the folders retries instead of freezing an
`finish-args` rationale (each line is the minimum for a feature that exists in the code):
-- `--share=ipc`, `--socket=x11`, `--device=dri`: Uno Skia desktop is X11 only (XWayland on Wayland) and uses GL.
+- `--share=ipc`, `--socket=wayland`, `--socket=x11`, `--device=dri`: native Wayland with X11 fallback and graphics access. Keep unconditional X11 access so `UNO_SKIA_HOST=x11` works even when Wayland is available.
- `--filesystem=host`: a file manager needs the whole filesystem. `--filesystem=xdg-run/gvfs`, `xdg-run/gvfs-fuse`
and `--talk-name=org.gtk.vfs.*`: mounted network/MTP locations through GVfs.
- `--own-name=org.freedesktop.FileManager1`: the `ShowFolders`/`ShowItems`/`ShowItemProperties` service
diff --git a/docs/linux-port/uno-fork-packages/README.md b/docs/linux-port/uno-fork-packages/README.md
new file mode 100644
index 000000000000..70e489e3ecaf
--- /dev/null
+++ b/docs/linux-port/uno-fork-packages/README.md
@@ -0,0 +1,22 @@
+# Building and publishing the Uno fork packages
+
+This directory contains an **artifact-only build workflow for MemerGamer/uno**, not a LinuxFiles workflow. Copy `wayland-packages.yml` into the fork's `.github/workflows/wayland-packages.yml` on `wayland/host`, replacing the existing GitHub Packages workflow. The fork must contain `build/wayland/build-local-packages.sh` and `prepare-desktop-nuspecs.py`; the workflow delegates to the existing builders with `--strict --tfm net10.0` and verifies all eight package identities, dependency versions and desktop assemblies. Preserve Uno's licenses and notices.
+
+Revision 4 has not been built or pinned. Follow [the LinuxFiles pin update procedure](../wayland-packages.md#updating-the-committed-pins): **build packages -> compute sha256 -> commit pins -> publish release**. The workflow deliberately stops after uploading the Actions artifact, allowing the exact package bytes to be reviewed and pinned before publication.
+
+1. Enable Actions and dispatch **Build Uno Wayland packages** against the reviewed `wayland/host` commit with version `6.7.135-wayland.4`. The workflow file must also be on the default branch to appear in the dispatch UI. No custom secrets, PAT or write permissions are needed for the build.
+2. Download the `uno-wayland-VERSION` artifact. Verify its source commit and metadata, compute SHA-256 locally and commit the eight reviewed pins to LinuxFiles. Verify local import using `build/fetch-uno-wayland.sh --import /path/to/artifact`. Do not rebuild these packages after pinning.
+3. From the artifact directory, publish those exact bytes using the maintainer's usual GitHub authentication. For revision 4 (replace the placeholder with the reviewed full Uno commit):
+
+ ```sh
+ sha256sum --check --strict SHA256SUMS
+ gh release create uno-wayland-6.7.135-wayland.4 *.nupkg SHA256SUMS \
+ --repo MemerGamer/uno --target REVIEWED_UNO_COMMIT \
+ --title uno-wayland-6.7.135-wayland.4 --prerelease --latest=false
+ ```
+
+4. Verify all nine public assets with a clean anonymous LinuxFiles fetch and a fresh NuGet cache. Revision 3 packages must not be relabeled or repacked as revision 4.
+
+Never overwrite a published package version. For host changes, build a new cohort from a reviewed commit, commit new pins and only then publish. If publication partially fails, inspect it; do not blindly rerun or clobber assets. Once packages have been publicly consumed, use a new version. Keep source tags/releases and license attribution available for redistributors.
+
+The candidate workflow has only been statically checked in LinuxFiles. Maintainers must execute it in the fork and validate strict packing on a clean runner. This change does not modify the external repository, commit pins or publish packages automatically.
diff --git a/docs/linux-port/uno-fork-packages/wayland-packages.yml b/docs/linux-port/uno-fork-packages/wayland-packages.yml
new file mode 100644
index 000000000000..9cbf74efb559
--- /dev/null
+++ b/docs/linux-port/uno-fork-packages/wayland-packages.yml
@@ -0,0 +1,111 @@
+# Copy to MemerGamer/uno/.github/workflows/wayland-packages.yml.
+# Uses the fork's existing desktop-only builder; preserve Uno's licenses and attribution.
+name: Build Uno Wayland packages
+
+on:
+ workflow_dispatch:
+ inputs:
+ version:
+ description: 'Fresh package version (X.Y.Z-wayland.N; never reuse a version)'
+ required: true
+ default: '6.7.135-wayland.4'
+ type: string
+
+permissions:
+ contents: read
+
+concurrency:
+ group: uno-wayland-${{ github.event_name == 'workflow_dispatch' && inputs.version || github.ref_name }}
+ cancel-in-progress: false
+
+jobs:
+ packages:
+ if: github.repository == 'MemerGamer/uno'
+ runs-on: ubuntu-24.04
+ timeout-minutes: 90
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+ - uses: actions/setup-dotnet@v5
+ with:
+ dotnet-version: |
+ 9.0.x
+ 10.0.x
+ - name: Select release version
+ id: release
+ env:
+ INPUT_VERSION: ${{ inputs.version }}
+ shell: bash
+ run: |
+ version=$INPUT_VERSION
+ [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+-wayland\.[0-9]+$ ]] || exit 2
+ echo "version=$version" >> "$GITHUB_OUTPUT"
+ echo "tag=uno-wayland-$version" >> "$GITHUB_OUTPUT"
+ - name: Verify source tag if present
+ env:
+ TAG: ${{ steps.release.outputs.tag }}
+ run: |
+ if git rev-parse --verify "refs/tags/$TAG" >/dev/null 2>&1; then
+ if [[ "$(git rev-parse "$TAG^{commit}")" != "$(git rev-parse HEAD)" ]]; then
+ echo 'Existing tag points to a different source commit. Use a fresh version.' >&2
+ exit 1
+ fi
+ fi
+ - name: Build and pack net10.0 desktop packages
+ env:
+ PACKAGE_VERSION: ${{ steps.release.outputs.version }}
+ run: |
+ build/wayland/build-local-packages.sh --strict \
+ --version "$PACKAGE_VERSION" --tfm net10.0 \
+ --feed "$RUNNER_TEMP/wayland-feed"
+ - name: Verify package set, metadata and consumer framework
+ env:
+ PACKAGE_VERSION: ${{ steps.release.outputs.version }}
+ run: |
+ python3 - <<'PY'
+ import os
+ from pathlib import Path
+ import xml.etree.ElementTree as ET
+ import zipfile
+
+ version = os.environ['PACKAGE_VERSION']
+ feed = Path(os.environ['RUNNER_TEMP']) / 'wayland-feed'
+ ids = ('Uno.WinUI', 'Uno.WinRT', 'Uno.Foundation', 'Uno.Foundation.Logging',
+ 'Uno.UI.Adapter.Microsoft.Extensions.Logging', 'Uno.WinUI.Runtime.Skia',
+ 'Uno.WinUI.Runtime.Skia.X11', 'Uno.WinUI.Runtime.Skia.Wayland')
+ expected = {f'{name}.{version}.nupkg' for name in ids}
+ actual = {path.name for path in feed.glob('*.nupkg')}
+ if actual != expected:
+ raise SystemExit(f'Unexpected package set: missing={expected - actual}, extra={actual - expected}')
+ for name in ids:
+ with zipfile.ZipFile(feed / f'{name}.{version}.nupkg') as package:
+ nuspecs = [entry for entry in package.namelist() if entry.endswith('.nuspec')]
+ if len(nuspecs) != 1:
+ raise SystemExit(f'{name}: expected one nuspec')
+ root = ET.fromstring(package.read(nuspecs[0]))
+ metadata = next(child for child in root if child.tag.rsplit('}', 1)[-1] == 'metadata')
+ fields = {child.tag.rsplit('}', 1)[-1]: child.text for child in metadata}
+ if fields['id'] != name or fields['version'] != version:
+ raise SystemExit(f'{name}: incorrect package identity or version')
+ for dependency in root.iter():
+ if dependency.tag.rsplit('}', 1)[-1] == 'dependency' and dependency.get('id') in ids:
+ if dependency.get('version') not in (version, f'[{version}]'):
+ raise SystemExit(f'{name}: dependency not pinned to this fork release')
+ if name in ('Uno.WinUI', 'Uno.WinUI.Runtime.Skia', 'Uno.WinUI.Runtime.Skia.X11', 'Uno.WinUI.Runtime.Skia.Wayland'):
+ if not any(entry.startswith(('lib/net10.0/', 'uno-runtime/net10.0/')) and entry.endswith('.dll') for entry in package.namelist()):
+ raise SystemExit(f'{name}: missing net10.0 desktop assemblies')
+ PY
+ cd "$RUNNER_TEMP/wayland-feed"
+ sha256sum *.nupkg > SHA256SUMS
+ sha256sum --check --strict SHA256SUMS
+ - uses: actions/upload-artifact@v4
+ with:
+ name: uno-wayland-${{ steps.release.outputs.version }}
+ path: |
+ ${{ runner.temp }}/wayland-feed/*.nupkg
+ ${{ runner.temp }}/wayland-feed/SHA256SUMS
+ if-no-files-found: error
+ retention-days: 30
+ # Download this exact artifact, compute/review hashes and commit LinuxFiles pins
+ # before publishing. Do not rebuild between pinning and release upload.
diff --git a/docs/linux-port/wayland-packages.md b/docs/linux-port/wayland-packages.md
new file mode 100644
index 000000000000..8c63619dd510
--- /dev/null
+++ b/docs/linux-port/wayland-packages.md
@@ -0,0 +1,104 @@
+# Uno Wayland package distribution
+
+The Linux desktop target defaults to `UseUnoWayland=true` (effective switch: `FilesUseUnoWayland`) and pins **6.7.135-wayland.4** in `Directory.Packages.props`. The fork is [MemerGamer/uno, branch wayland/host](https://github.com/MemerGamer/uno/tree/wayland/host); LinuxFiles does not build Uno during restore. Revision 4 is the first public-distribution candidate, replacing the local-only revision 3 with a fresh NuGet version. **Revision 4 has been built locally and its eight SHA-256 pins are committed in the repository pin file; the release assets must be published byte-for-byte from that build before a default restore can download them.**
+
+## Release contract
+
+Repository: **MemerGamer/uno** (public). Tag and GitHub Release: **uno-wayland-6.7.135-wayland.4**. For subsequent revisions, replace the version consistently with `X.Y.Z-wayland.N`; never use `latest`, a rolling tag, or replace assets for an existing version.
+
+The release must be published (a public prerelease is fine), with these nine assets, preserving filename case:
+
+```text
+Uno.WinUI.6.7.135-wayland.4.nupkg
+Uno.WinRT.6.7.135-wayland.4.nupkg
+Uno.Foundation.6.7.135-wayland.4.nupkg
+Uno.Foundation.Logging.6.7.135-wayland.4.nupkg
+Uno.UI.Adapter.Microsoft.Extensions.Logging.6.7.135-wayland.4.nupkg
+Uno.WinUI.Runtime.Skia.6.7.135-wayland.4.nupkg
+Uno.WinUI.Runtime.Skia.X11.6.7.135-wayland.4.nupkg
+Uno.WinUI.Runtime.Skia.Wayland.6.7.135-wayland.4.nupkg
+SHA256SUMS
+```
+
+Each nupkg must identify the matching package ID/version in its nuspec, with fork dependencies pointing to the same version. Build desktop assets for **net10.0**, matching LinuxFiles; net9.0-only aggregates are insufficient. The fork's `build/wayland/build-local-packages.sh --strict --version VERSION --tfm net10.0 --feed DIR` builds the required projects, packs the five ordinary packages and prepares the three aggregate packages. Preserve the packages' upstream licenses, notices and contributor attribution.
+
+`SHA256SUMS` contains exactly eight LF-terminated lines in `sha256sum` format: 64 lowercase hexadecimal characters, two spaces, and the corresponding bare nupkg filename. No directories, extra entries or duplicate names. Downloads use `https://github.com/MemerGamer/uno/releases/download/uno-wayland-VERSION/ASSET`.
+
+## Obtaining packages
+
+Install Bash, Python 3, curl, GNU coreutils and util-linux (`flock`), then run:
+
+```sh
+build/fetch-uno-wayland.sh
+build/clear-uno-wayland-cache.sh
+dotnet build src/Files.App -f net10.0-desktop
+```
+
+The script reads the version from `Directory.Packages.props`, loads the committed eight-package pin set, cross-checks the release manifest, downloads and verifies packages before exposing them, and rechecks cached hashes on every run. It serializes concurrent fetches. `nuget.wayland.config` maps the eight exact package IDs to `.cache/uno-wayland-feed`, relative to the repository; other dependencies keep their existing sources. `.cache/` is gitignored. A complete verified cache needs no package-download network access on subsequent runs; ordinary NuGet dependencies still need to be restored or cached.
+
+The trust anchor is [build/uno-wayland-packages.sha256](../../build/uno-wayland-packages.sha256), with exactly eight entries per version in `VERSION SHA256 BARE_PACKAGE_FILENAME` format. Fetches, local imports and cached feed packages are checked against those repository pins. Unknown versions and incomplete, duplicate or malformed pin sets fail before network access or feed writes. Downloaded/cached `SHA256SUMS` must agree with all eight pins; it is a release cross-check and cannot authorize different bytes. Replacing both packages and the release manifest still fails.
+
+For an offline mirror or locally built fork, use `build/fetch-uno-wayland.sh --import /path/to/nupkgs` (`--from` is an alias used by AUR). Only the eight nupkgs are required; if `SHA256SUMS` exists it is cross-checked. Explicit imports verify every supplied package even if the feed already holds a valid copy. The local build must match committed pins: an unreviewed build requires a fresh version and new reviewed pins. Do not repack an existing version or bypass verification with a custom feed.
+
+`--version VERSION` requires a complete committed pin set for that version; use `-p:UnoWaylandVersion=VERSION` consistently for restore/build. `--feed DIR` changes the output location; supply a matching `-p:RestoreConfigFile=/path/to/custom.config` if it differs from the default feed. The SDK version-check exception is restricted to the reviewed `6.7.135-wayland.4` cohort and SDK base `6.7.135`; review that exception when updating versions.
+
+NuGet's global cache can bypass the verified feed. Run `build/clear-uno-wayland-cache.sh` before a separate restore/build (or use a fresh `NUGET_PACKAGES` directory). The CI workflows do this after restoring their caches; publishing and source AUR do it before publishing. The helper removes only the eight package ID/version directories for the configured cohort, preserving unrelated packages and upstream versions.
+
+## Updating the committed pins
+
+Always follow **build packages -> compute sha256 -> commit pins -> publish release**:
+
+1. Review the Uno host source commit and build the eight net10.0 desktop packages with a fresh version using the fork builder or the artifact-only workflow in [uno-fork-packages](uno-fork-packages/README.md). Verify package identities, dependency versions, desktop assemblies and licenses. Download the resulting artifact once; keep these exact bytes for publishing.
+2. In that artifact directory, run `sha256sum *.nupkg > SHA256SUMS`. Confirm there are exactly the eight filenames in the release contract. Independently review the source commit and package metadata; do not copy hashes from a mutable release as the trust anchor.
+3. Add eight real `VERSION SHA256 FILENAME` rows to `build/uno-wayland-packages.sha256`, for the new version. Update `UnoWaylandVersion` and the narrowly scoped SDK exception together for future cohorts. Run `--import` against the build directory and offline checks, then **commit the reviewed pins in LinuxFiles before publishing**. Source AUR generation reads the same pin file and fails until the set is complete. Generate its recipe with `scripts/linux/gen-aur.sh VERSION ARCHIVE_DIR OUT_DIR source`.
+4. Publish the exact already-hashed artifact, plus `SHA256SUMS`, at `uno-wayland-VERSION` pointing to the reviewed source commit. Do not rebuild between pinning and upload: differing build bytes need new pins before publication. Never replace published assets or reuse a NuGet version. Verify an anonymous fetch against the committed pins and a clean restore with fresh `NUGET_PACKAGES`.
+
+No real revision 4 digests are supplied by this change; maintainers must complete these steps. Placeholder hashes and `SKIP` are forbidden in generated recipes.
+
+## Build and runtime opt-outs
+
+Build with the upstream 6.7.135 X11 packages without fetching the fork:
+
+```sh
+dotnet build src/Files.App -f net10.0-desktop -p:UseUnoWayland=false
+scripts/linux/publish.sh --x11 --tarball
+```
+
+Pass `UseUnoWayland=false` to restore as well if restoring separately; switching the property requires another restore/build. The effective switch selects only Uno Linux desktop targets, including outer builds and the virtualization/Publicizer, controls and storage projects. Other TFMs, non-Linux RIDs and platform-neutral projects receive upstream packages and no fork restore config, independent of the build OS. Linux-only Uno target defaults are declared early in `Directory.Build.props`, before central packages are evaluated. The Uno SDK stays at 6.7.30. Published builds remain untrimmed and non-AOT; the elevation helper's existing Native AOT configuration is separate.
+
+In a fork-enabled build, `Program.cs` registers `UseWayland()` before `UseX11()`. The fork implements:
+
+| `UNO_SKIA_HOST` | Behavior |
+| --- | --- |
+| unset or `auto` | Prefer native Wayland when `WAYLAND_DISPLAY` is nonempty and the compositor probe succeeds; otherwise try X11 using `DISPLAY`. |
+| `x11` | Skip Wayland and use X11/XWayland (requires `DISPLAY`). |
+| `wayland` | Require native Wayland; missing display, required compositor globals or connection libraries cause failure instead of fallback. |
+
+Values are lowercase; invalid values (including an empty override) fail. Auto fallback applies to host probing, not recovery after a running Wayland connection fails. With both display variables absent there is no graphical host. Override examples: `UNO_SKIA_HOST=x11 files`, `UNO_SKIA_HOST=wayland ./Files-x86_64.AppImage`, or `flatpak run --env=UNO_SKIA_HOST=x11 io.github.memergamer.LinuxFiles`. An upstream-only build has no Wayland host to force. Restart the app when changing the override; a normal second launch forwards to the existing instance.
+
+## CI and packaging
+
+- Linux CI, package and nightly workflows call the fetch script before any build. Public release downloads require no contributor token, PAT, NuGet credential or cross-repository secret. Cache keys include the committed checksum pin file and restore configuration; the eight fork package ID/version directories are removed after cache restoration so NuGet reads the verified feed.
+- `scripts/linux/publish.sh` fetches by default, so direct contributor/package publishing uses the same contract. Source AUR declares all eight Uno nupkgs in `source` with repository-pinned `sha256sums` and `noextract`, then imports them with `--from "$srcdir"`. The import performs no downloads; other NuGet dependencies still need a populated cache or network for restore.
+- AppImage, Flatpak, `linuxfiles-bin` and Nix repackage the LinuxFiles publish/release tarball, which contains both Uno hosts. End users never fetch Uno packages. AUR recipes add `wayland`, `libxkbcommon` and EGL (`libglvnd`). Nix adds Wayland and xkbcommon to ELF runpaths alongside the existing GL/EGL provider; it keeps the current alpha4 release pin until the next application release is published and `scripts/linux/update-nix-flake.sh` updates its version/hashes.
+- AppImage uses host `libwayland-client.so.0`, `libwayland-cursor.so.0`, `libwayland-egl.so.1`, `libxkbcommon.so.0`, and `libEGL.so.1` alongside existing X11/font/GL dependencies. The launcher preserves compositor and host-selection variables. Verify those libraries on the minimum supported distro; AppImage does not bundle a compositor or these libraries.
+- Flatpak uses the Freedesktop 25.08 runtime libraries and grants `--socket=wayland` plus the existing `--socket=x11`. Keep the unconditional X11 socket so `UNO_SKIA_HOST=x11` works in Wayland sessions; `fallback-x11` would hide it there. Verify both paths inside the sandbox. Root-action gates and portal behavior are unchanged.
+
+## Why GitHub Releases
+
+GitHub Releases provide public, version-addressed assets with anonymous downloads and an ordinary local NuGet folder feed. The artifact build uses a read-only workflow token; publication uses the maintainer's usual GitHub credentials after the pins are committed. The eight desktop-only packages remain outside LinuxFiles history.
+
+[GitHub's NuGet registry documentation](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry) requires authentication even to install public packages. GitHub Packages would add token setup for contributors and cross-repository access configuration for CI and distro source builds. Vendoring nupkgs removes the fetch step but adds large binary files, repeated version churn and redistribution/license maintenance to LinuxFiles. Release assets keep ownership and source attribution with the Uno fork while retaining reproducible version selection and hash verification.
+
+## Maintainer and build handoff
+
+Copy [the fork workflow](uno-fork-packages/wayland-packages.yml) to **MemerGamer/uno/.github/workflows/wayland-packages.yml**, replacing its old GitHub Packages workflow. See [publisher instructions](uno-fork-packages/README.md). Build revision 4 first, commit reviewed pins, then publish the exact artifact. The build workflow requires no custom secrets; release publication uses a maintainer's normal GitHub credentials. No changes to the Uno repository or releases have been made by this LinuxFiles change.
+
+Local distribution checks: `python3 build/tests/test-fetch-uno-wayland.py` exercises offline import, pinned download URLs, cache verification/repair, malformed manifests and failed/checksum-mismatched downloads without network. Shell syntax, XML and YAML checks do not replace a real restore/build.
+
+Before shipping, the build agent must:
+
+1. Complete the pin update procedure from the intended `wayland/host` commit, check package artifact/metadata validation and verify the nine public release assets. Test a clean anonymous fetch, corrupt cache repair, and a checksum mismatch failure.
+2. With an empty feed and fresh `NUGET_PACKAGES`, run the default desktop build, then build `tests/Files.Platform.Tests` and run `dotnet test --project tests/Files.Platform.Tests/Files.Platform.Tests.csproj --no-build`, sequentially. Repeat the app build with `-p:UseUnoWayland=false` and no fork feed. Check the restore graph uses revision 4 throughout the default Uno graph and upstream 6.7.135 in the opt-out.
+3. Publish/package the app, AppImage and Flatpak. Regenerate/check the AUR source and binary recipes and its native runtime dependencies. After the next application release, bump Nix with real tarball hashes and verify `nix flake check`/`nix build` and Wayland library resolution in the patched binaries. Existing alpha4 packages remain X11-only.
+4. Run UI checks on private displays with throwaway homes: Xvfb with `WAYLAND_DISPLAY` unset, a private nested/headless compositor with `DISPLAY` unset, and both displays with each `UNO_SKIA_HOST` value. The current `scripts/linux/headless-run.sh` covers X11 and unsets Wayland; extend its isolated-display approach for Wayland tests. Never launch against the user's display or change desktop settings. Check fractional/mixed-DPI scaling, chrome/move/resize, multiple windows, keyboard/IME, file clipboard, inbound/outbound DnD, software/GPU rendering, AppImage and Flatpak. Clean up processes and private data. Distribution changes alone do not prove host readiness.
diff --git a/docs/linux-port/wayland-spike.md b/docs/linux-port/wayland-spike.md
index 6bd3f72f7695..455d3ea6519f 100644
--- a/docs/linux-port/wayland-spike.md
+++ b/docs/linux-port/wayland-spike.md
@@ -1,6 +1,6 @@
# Native Wayland host spike — issue #113
-Investigated 2026-10-12. Documentation only; no package, host or runtime changes.
+Investigated 2026-10-12. Historical investigation; the original findings below predate the Uno fork host. Current Linux builds default to the forked native Wayland host with X11 fallback; see [package distribution and validation](wayland-packages.md).
## Decision
diff --git a/flake.nix b/flake.nix
index 071fceec00f1..a12bf19e0b39 100644
--- a/flake.nix
+++ b/flake.nix
@@ -14,6 +14,7 @@
linuxfiles = final.callPackage
({ lib, stdenv, fetchurl, autoPatchelfHook, makeWrapper
, fontconfig, freetype, libGL, libx11, libxcursor, libxrandr, libxi, libxext
+ , wayland, libxkbcommon
, icu, openssl, zlib, krb5, glib, enableRootActions ? false }:
let
# version and both hashes are rewritten by scripts/linux/update-nix-flake.sh
@@ -30,6 +31,7 @@
# Opened with dlopen at runtime, so autoPatchelf cannot discover them; added to every ELF file's runpath.
runtimeLibs = [
fontconfig freetype libGL libx11 libxcursor libxrandr libxi libxext
+ wayland libxkbcommon
icu openssl zlib krb5 glib
];
id = "io.github.memergamer.LinuxFiles";
diff --git a/nuget.wayland.config b/nuget.wayland.config
new file mode 100644
index 000000000000..cb8d8d193683
--- /dev/null
+++ b/nuget.wayland.config
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packaging/linux/aur/linuxfiles-bin/PKGBUILD b/packaging/linux/aur/linuxfiles-bin/PKGBUILD
index 28590f2319b7..d9bb514da159 100644
--- a/packaging/linux/aur/linuxfiles-bin/PKGBUILD
+++ b/packaging/linux/aur/linuxfiles-bin/PKGBUILD
@@ -13,7 +13,7 @@ arch=('x86_64')
url='https://github.com/MemerGamer/LinuxFiles'
license=('MIT')
# The runtime is bundled; these are the native libraries Skia/Uno load at runtime.
-depends=('fontconfig' 'freetype2' 'libx11' 'libxcursor' 'libxrandr' 'libxi' 'libxext' 'mesa' 'glib2' 'hicolor-icon-theme')
+depends=('fontconfig' 'freetype2' 'libx11' 'libxcursor' 'libxrandr' 'libxi' 'libxext' 'wayland' 'libxkbcommon' 'libglvnd' 'mesa' 'glib2' 'hicolor-icon-theme')
optdepends=('polkit: authenticated root actions'
'gvfs: network and MTP locations'
'udisks2: mount and eject drives'
diff --git a/packaging/linux/aur/linuxfiles/PKGBUILD b/packaging/linux/aur/linuxfiles/PKGBUILD
index 943e3c00c83a..86e86e70f757 100644
--- a/packaging/linux/aur/linuxfiles/PKGBUILD
+++ b/packaging/linux/aur/linuxfiles/PKGBUILD
@@ -9,12 +9,34 @@ arch=('x86_64' 'aarch64')
url='https://github.com/MemerGamer/LinuxFiles'
license=('MIT')
# Self-contained publish bundles the runtime; native libs below are loaded by Skia/Uno at runtime.
-depends=('fontconfig' 'freetype2' 'libx11' 'libxcursor' 'libxrandr' 'libxi' 'libxext' 'mesa' 'glib2' 'hicolor-icon-theme')
-makedepends=('dotnet-sdk>=10.0' 'git' 'clang' 'zlib')
+depends=('fontconfig' 'freetype2' 'libx11' 'libxcursor' 'libxrandr' 'libxi' 'libxext' 'wayland' 'libxkbcommon' 'libglvnd' 'mesa' 'glib2' 'hicolor-icon-theme')
+makedepends=('dotnet-sdk>=10.0' 'git' 'clang' 'zlib' 'python')
optdepends=('polkit: authenticated root actions' 'gvfs: network and MTP locations' 'gnome-disk-utility: format and manage drives')
options=('!strip') # .NET single-file/self-contained binaries break when stripped
-source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/linux-v$pkgver.tar.gz")
-sha256sums=('UNGENERATED')
+# Generated from build/uno-wayland-packages.sha256; templates require complete pins.
+_uno_version=6.7.135-wayland.4
+_uno_base="https://github.com/MemerGamer/uno/releases/download/uno-wayland-$_uno_version"
+source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/linux-v$pkgver.tar.gz"
+ "$_uno_base/Uno.WinUI.$_uno_version.nupkg"
+ "$_uno_base/Uno.WinRT.$_uno_version.nupkg"
+ "$_uno_base/Uno.Foundation.$_uno_version.nupkg"
+ "$_uno_base/Uno.Foundation.Logging.$_uno_version.nupkg"
+ "$_uno_base/Uno.UI.Adapter.Microsoft.Extensions.Logging.$_uno_version.nupkg"
+ "$_uno_base/Uno.WinUI.Runtime.Skia.$_uno_version.nupkg"
+ "$_uno_base/Uno.WinUI.Runtime.Skia.X11.$_uno_version.nupkg"
+ "$_uno_base/Uno.WinUI.Runtime.Skia.Wayland.$_uno_version.nupkg"
+)
+noextract=(
+ "Uno.WinUI.$_uno_version.nupkg"
+ "Uno.WinRT.$_uno_version.nupkg"
+ "Uno.Foundation.$_uno_version.nupkg"
+ "Uno.Foundation.Logging.$_uno_version.nupkg"
+ "Uno.UI.Adapter.Microsoft.Extensions.Logging.$_uno_version.nupkg"
+ "Uno.WinUI.Runtime.Skia.$_uno_version.nupkg"
+ "Uno.WinUI.Runtime.Skia.X11.$_uno_version.nupkg"
+ "Uno.WinUI.Runtime.Skia.Wayland.$_uno_version.nupkg"
+)
+sha256sums=('UNGENERATED' 'UNGENERATED' 'UNGENERATED' 'UNGENERATED' 'UNGENERATED' 'UNGENERATED' 'UNGENERATED' 'UNGENERATED' 'UNGENERATED')
build() {
cd "LinuxFiles-linux-v$pkgver"
@@ -23,6 +45,8 @@ build() {
aarch64) _rid=linux-arm64 ;;
esac
export DOTNET_CLI_TELEMETRY_OPTOUT=1 DOTNET_NOLOGO=1
+ build/fetch-uno-wayland.sh --from "$srcdir"
+ build/clear-uno-wayland-cache.sh
MSBUILDDISABLENODEREUSE=1 nice -n 19 dotnet publish src/Files.App/Files.App.csproj \
-f net10.0-desktop -c Release -r "$_rid" --self-contained \
-p:PublishTrimmed=false -p:PublishAot=false \
diff --git a/packaging/linux/flatpak/io.github.memergamer.LinuxFiles.yml b/packaging/linux/flatpak/io.github.memergamer.LinuxFiles.yml
index 2fefba5d2b5c..2fac4f5d2ac5 100644
--- a/packaging/linux/flatpak/io.github.memergamer.LinuxFiles.yml
+++ b/packaging/linux/flatpak/io.github.memergamer.LinuxFiles.yml
@@ -15,7 +15,8 @@ command: files
finish-args:
- --env=FILES_DISABLE_ROOT_ACTIONS=1
- --share=ipc
- # Uno Skia desktop is X11-only; Wayland sessions use XWayland.
+ # Prefer native Wayland; retain X11 for automatic fallback and UNO_SKIA_HOST=x11.
+ - --socket=wayland
- --socket=x11
- --device=dri
# A file manager must see the whole filesystem (including other users' mount points under /run/media).
diff --git a/scripts/linux/gen-aur.sh b/scripts/linux/gen-aur.sh
index b55952239744..a732b97b8237 100755
--- a/scripts/linux/gen-aur.sh
+++ b/scripts/linux/gen-aur.sh
@@ -3,7 +3,8 @@
# Usage: scripts/linux/gen-aur.sh [out-dir] [binary|source]
# holds files-linux-x64.tar.gz and files-packaging.tar.gz (artifacts/ after publish.sh --tarball
# plus the packaging bundle). Output: /PKGBUILD and .SRCINFO (default artifacts/aur).
-# Source mode requires linuxfiles-.tar.gz, the exact GitHub tag archive.
+# Source mode requires linuxfiles-.tar.gz and committed Uno pins.
+# The generated recipe declares all eight nupkgs for makepkg to retrieve before build().
# AUR_BASE_URL overrides the download base (e.g. file:///path) to test the build with makepkg offline.
set -euo pipefail
@@ -32,38 +33,52 @@ else
fi
mkdir -p "$out"
-python3 - "$tpl" "$out/PKGBUILD" "$tag" "$bin_sum" "$pkg_sum" "${AUR_BASE_URL:-}" "$kind" <<'PY'
-import re, sys
-tpl, dst, ver, a, b, base, kind = sys.argv[1:8]
+python3 - "$tpl" "$out/PKGBUILD" "$tag" "$bin_sum" "$pkg_sum" "${AUR_BASE_URL:-}" "$kind" "$root" <<'PY'
+import re, subprocess, sys
+from pathlib import Path
+import xml.etree.ElementTree as ET
+
+tpl, dst, ver, a, b, base, kind, root = sys.argv[1:9]
if not all(re.fullmatch(r'[0-9a-f]{64}', digest) for digest in (a, b)):
raise SystemExit('Invalid release checksum')
-t = open(tpl).read()
+t = Path(tpl).read_text()
t = re.sub(r"^_tag=.*$", lambda m: "_tag=" + ver, t, flags=re.M)
t = re.sub(r"^pkgver=.*$", lambda m: "pkgver=" + ver.replace("-", ""), t, flags=re.M)
if kind == 'source':
- t = re.sub(r'^pkgver=.*$', lambda m: 'pkgver=' + ver.replace('-', ''), t, flags=re.M)
- t = re.sub(r'^source=.*$', lambda m: 'source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/linux-v' + ver + '.tar.gz")', t, flags=re.M)
+ version = ET.parse(Path(root) / 'Directory.Packages.props').find('.//UnoWaylandVersion').text
+ # Shared validator refuses missing, duplicate or incomplete repository pins.
+ result = subprocess.run([sys.executable, str(Path(root) / 'build/uno-wayland-pins.py'), version], capture_output=True, text=True)
+ if result.returncode:
+ raise SystemExit(result.stderr.strip())
+ entries = [line.split() for line in result.stdout.splitlines()]
+ archive = ('$url/archive/refs/tags/linux-v' + ver + '.tar.gz') if not base else (base + '/linuxfiles-' + ver + '.tar.gz')
+ sources = ['"$pkgname-$pkgver.tar.gz::' + archive + '"']
+ sources += ['"$_uno_base/' + name + '"' for digest, name in entries]
+ t = re.sub(r'^_uno_version=.*$', lambda m: '_uno_version=' + version, t, flags=re.M)
+ t = re.sub(r'^source=\([^)]*\)', lambda m: 'source=(' + '\n '.join(sources) + ')', t, flags=re.M)
+ t = re.sub(r'^noextract=\([^)]*\)', lambda m: 'noextract=(' + '\n '.join('"' + name + '"' for digest, name in entries) + ')', t, flags=re.M)
t = t.replace('LinuxFiles-linux-v$pkgver', 'LinuxFiles-linux-v' + ver)
- checksums = [a]
+ checksums = [a] + [digest for digest, name in entries]
else:
checksums = [a, b]
t = re.sub(r"sha256sums=\([^)]*\)", lambda m: "sha256sums=(" + ' '.join("'" + x + "'" for x in checksums) + ")", t)
if 'UNGENERATED' in re.search(r'^sha256sums=.*$', t, re.M).group() or re.search(r"['\"]SKIP['\"]", t):
raise SystemExit('Recipe checksums are not pinned')
-if base and kind == 'source':
- t = re.sub(r'^source=.*$', lambda m: 'source=("$pkgname-$pkgver.tar.gz::' + base + '/linuxfiles-' + ver + '.tar.gz")', t, flags=re.M)
if base and kind == 'binary':
t = re.sub(r'^_base=.*$', lambda m: '_base="%s"' % base, t, flags=re.M)
-open(dst, "w").write(t)
+Path(dst).write_text(t)
+
PY
# makepkg only exists on Arch; elsewhere (CI runs on Ubuntu) emit the same fields by sourcing the PKGBUILD.
+# shellcheck disable=SC2154
srcinfo() {
if command -v makepkg >/dev/null 2>&1 && [[ "${AUR_SRCINFO_FALLBACK:-}" != 1 ]]; then
(cd "$out" && makepkg --printsrcinfo)
return
fi
(
- # shellcheck disable=SC1091
+ # PKGBUILD supplies these variables and arrays.
+ # shellcheck disable=SC1091,SC2154
source "$out/PKGBUILD"
list() { local k="$1"; shift; local v; for v in "$@"; do [[ -n "$v" ]] || continue; printf '\t%s = %s\n' "$k" "$v"; done; }
printf 'pkgbase = %s\n' "$pkgname"
diff --git a/scripts/linux/publish.sh b/scripts/linux/publish.sh
index e1a870742d65..144411d73574 100755
--- a/scripts/linux/publish.sh
+++ b/scripts/linux/publish.sh
@@ -1,18 +1,20 @@
#!/usr/bin/env bash
# Publish Files for Linux (Uno Skia desktop) into artifacts/linux-/.
-# Usage: scripts/linux/publish.sh [--rid linux-x64|linux-arm64] [--framework-dependent] [--tarball]
+# Usage: scripts/linux/publish.sh [--rid linux-x64|linux-arm64] [--framework-dependent] [--tarball] [--x11]
set -euo pipefail
root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
rid="linux-x64"
self_contained="true"
tarball="false"
+use_uno_wayland="true"
while [[ $# -gt 0 ]]; do
case "$1" in
--rid) rid="$2"; shift 2 ;;
--framework-dependent) self_contained="false"; shift ;;
--tarball) tarball="true"; shift ;;
+ --x11) use_uno_wayland="false"; shift ;;
-h|--help) sed -n '2,3p' "$0"; exit 0 ;;
*) echo "Unknown argument: $1" >&2; exit 2 ;;
esac
@@ -23,6 +25,11 @@ case "$rid" in
*) echo "Unsupported RID: $rid" >&2; exit 2 ;;
esac
+if [[ "$use_uno_wayland" == "true" ]]; then
+ "$root/build/fetch-uno-wayland.sh"
+ "$root/build/clear-uno-wayland-cache.sh"
+fi
+
out="$root/artifacts/$rid"
rm -rf "$out"
@@ -30,6 +37,7 @@ rm -rf "$out"
MSBUILDDISABLENODEREUSE=1 nice -n 19 dotnet publish "$root/src/Files.App/Files.App.csproj" \
-f net10.0-desktop -c Release -r "$rid" \
--self-contained "$self_contained" \
+ -p:UseUnoWayland="$use_uno_wayland" \
-p:PublishTrimmed=false -p:PublishAot=false -p:PublishReadyToRun=true \
-nodeReuse:false -m:2 -o "$out"
diff --git a/src/Files.App.Controls/Files.App.Controls.csproj b/src/Files.App.Controls/Files.App.Controls.csproj
index 4dddc0c13691..f840b0e9ae5b 100644
--- a/src/Files.App.Controls/Files.App.Controls.csproj
+++ b/src/Files.App.Controls/Files.App.Controls.csproj
@@ -2,7 +2,6 @@
- $(DesktopTargetFramework)
enable
Debug;Release
x86;x64;arm64
diff --git a/src/Files.App.Storage/Files.App.Storage.csproj b/src/Files.App.Storage/Files.App.Storage.csproj
index 8f19e2a4f590..42dd9f68dd16 100644
--- a/src/Files.App.Storage/Files.App.Storage.csproj
+++ b/src/Files.App.Storage/Files.App.Storage.csproj
@@ -2,7 +2,6 @@
- $(DesktopTargetFramework)
true
false
enable
@@ -26,4 +25,4 @@
-
\ No newline at end of file
+
diff --git a/src/Files.App.UnoVirtualization/Files.App.UnoVirtualization.csproj b/src/Files.App.UnoVirtualization/Files.App.UnoVirtualization.csproj
index 5363ca9fb23f..957c7a7c41ea 100644
--- a/src/Files.App.UnoVirtualization/Files.App.UnoVirtualization.csproj
+++ b/src/Files.App.UnoVirtualization/Files.App.UnoVirtualization.csproj
@@ -3,7 +3,6 @@
- $(DesktopTargetFramework)
enable
enable
Debug;Release
diff --git a/src/Files.App/Files.App.csproj b/src/Files.App/Files.App.csproj
index 2df01be3b764..5b73aebf513c 100644
--- a/src/Files.App/Files.App.csproj
+++ b/src/Files.App/Files.App.csproj
@@ -2,7 +2,6 @@
- $(DesktopTargetFramework)
Exe
Files
en-US
@@ -94,6 +93,14 @@
+
+
+ $(DefineConstants);UNO_WAYLAND
+
+
+
+
+
diff --git a/src/Files.App/MainWindow.Linux.cs b/src/Files.App/MainWindow.Linux.cs
index 42cfd40d453c..e208814e6966 100644
--- a/src/Files.App/MainWindow.Linux.cs
+++ b/src/Files.App/MainWindow.Linux.cs
@@ -4,6 +4,7 @@
using Files.Platform.Abstractions;
using Files.Platform.Abstractions.Appearance;
using Microsoft.UI;
+using Microsoft.UI.Input;
using Microsoft.UI.Xaml.Media;
using Files.Platform.Linux.Windowing;
using Files.Platform.Linux.Elevation;
@@ -22,10 +23,18 @@ public sealed partial class MainWindow
private int _dragStart;
private int _titleHeight;
private string? _linuxWindowTitle;
+#if UNO_WAYLAND
+ private bool _waylandWindow;
+ // The Wayland host implements caption regions, move and maximize itself (InputNonClientPointerSource, presenter).
+ private bool IsWaylandWindow => _waylandWindow;
+#else
+ private static bool IsWaylandWindow => false;
+#endif
public bool UseClientSideDecorations => OperatingSystem.IsLinux() &&
Ioc.Default.GetRequiredService().Get("UseClientSideDecorations", true);
- public bool HasClientSideDecorations => _linuxChrome?.SupportsClientSideDecorations == true && UseClientSideDecorations;
- public bool IsLinuxWindowMaximized => _linuxChrome?.IsMaximized ?? false;
+ public bool HasClientSideDecorations => (_linuxChrome?.SupportsClientSideDecorations == true || IsWaylandWindow) && UseClientSideDecorations;
+ public bool IsLinuxWindowMaximized => _linuxChrome?.IsMaximized ??
+ (IsWaylandWindow && AppWindow.Presenter is OverlappedPresenter { State: OverlappedPresenterState.Maximized });
public event EventHandler? LinuxChromeChanged;
internal static string FormatRootModeTitle(string title) => title + (RootActionsAvailability.Mode.Indicator switch
@@ -40,8 +49,13 @@ public void InitializeLinuxChrome()
if (!OperatingSystem.IsLinux())
return;
- if (_linuxChrome is null && Uno.UI.Xaml.WindowHelper.GetNativeWindow(this) is X11NativeWindow native)
+ var nativeWindow = Uno.UI.Xaml.WindowHelper.GetNativeWindow(this);
+ if (_linuxChrome is null && nativeWindow is X11NativeWindow native)
_linuxChrome = X11WindowChrome.TryCreate((nuint)native.WindowId);
+#if UNO_WAYLAND
+ // Only the X11 and Wayland hosts are registered, so any other native window is the Wayland surface.
+ _waylandWindow = nativeWindow is not null and not X11NativeWindow;
+#endif
if (!HasClientSideDecorations)
_linuxChrome?.HideRegions();
@@ -109,16 +123,38 @@ public void UpdateLinuxWindowTitle(string title)
_linuxChrome?.SetTitle(title);
}
- public void ToggleLinuxWindowMaximize() => _linuxChrome?.ToggleMaximize();
+ public void ToggleLinuxWindowMaximize()
+ {
+ if (_linuxChrome is not null)
+ _linuxChrome.ToggleMaximize();
+ else if (IsWaylandWindow && AppWindow.Presenter is OverlappedPresenter presenter)
+ {
+ if (presenter.State == OverlappedPresenterState.Maximized)
+ presenter.Restore();
+ else
+ presenter.Maximize();
+ }
+ }
public void UpdateLinuxChromeRegions(int dragStart, int titleHeight)
{
_dragStart = dragStart;
_titleHeight = titleHeight;
+ if (IsWaylandWindow && !HasClientSideDecorations)
+ InputNonClientPointerSource.GetForWindowId(AppWindow.Id).ClearRegionRects(NonClientRegionKind.Caption);
if (!HasClientSideDecorations || Content is not FrameworkElement root || root.XamlRoot is null)
return;
var scale = root.XamlRoot.RasterizationScale;
+ if (IsWaylandWindow)
+ {
+ // Unhandled presses in the caption start an interactive move; double-click toggles maximize.
+ InputNonClientPointerSource.GetForWindowId(AppWindow.Id).SetRegionRects(NonClientRegionKind.Caption,
+ [
+ new() { X = (int)(dragStart * scale), Width = (int)(Math.Max(0, root.ActualWidth - dragStart - 138) * scale), Height = (int)(titleHeight * scale) },
+ ]);
+ return;
+ }
_linuxChrome?.SetRegions((int)(root.ActualWidth * scale), (int)(root.ActualHeight * scale),
(int)(dragStart * scale), (int)((root.ActualWidth - dragStart - 138) * scale),
(int)(titleHeight * scale), Math.Max(1, (int)(5 * scale)));
diff --git a/src/Files.App/Platforms/Desktop/Program.cs b/src/Files.App/Platforms/Desktop/Program.cs
index a68afaa35842..68ab8842bb90 100644
--- a/src/Files.App/Platforms/Desktop/Program.cs
+++ b/src/Files.App/Platforms/Desktop/Program.cs
@@ -11,7 +11,7 @@
namespace Files.App
{
///
- /// Represents the entry point of the Files app on Uno Platform (Skia desktop, X11).
+ /// Represents the entry point of the Files app on Uno Platform (Skia desktop, Wayland/X11).
/// Replaces Program.cs, which is built for Windows only (WinAppSDK AppInstance redirection).
///
internal sealed class Program
@@ -102,8 +102,13 @@ public static int Main(string[] args)
using (var trace = Files.Platform.Abstractions.Diagnostics.PerformanceTrace.Begin("startup.cursor"))
CursorSettingsResolver.ApplyToProcess();
- var host = UnoPlatformHostBuilder.Create()
- .App(() => new App())
+ var hostBuilder = UnoPlatformHostBuilder.Create()
+ .App(() => new App());
+#if UNO_WAYLAND
+ // Preferred when WAYLAND_DISPLAY is set; UNO_SKIA_HOST=x11|wayland|auto overrides the choice
+ hostBuilder = hostBuilder.UseWayland();
+#endif
+ var host = hostBuilder
.UseX11(x11 => x11.RenderingBackend(renderingBackend switch
{
RenderingBackendChoice.Software => X11RenderingBackend.Software,