Repository navigation
Conversation
MemerGamer
left a comment
There was a problem hiding this comment.
Thanks for this, Lex. The split looks careful: startup order in Program.Linux.cs, OpenBeneath/openat2 semantics, native flag values, packaging paths and resource keys all check out as equivalent, and it merges cleanly. Locally src/Files.App builds with 0 errors (net10.0-desktop, Release), and Files.Platform.Tests passes apart from 3 TrustedNativeDirectory tests that most likely fail only because of my local temp path; CI is green.
A few things to fix before merging, since the PR says there is no intended behavior change:
- System dark/light detection regression (
src/Files.App/Services/App/AppThemeModeService.cs). Before, the code calledLinuxColorScheme.Initialize()synchronously and readLinuxColorScheme.IsDark, which checks theFILES_COLOR_SCHEMEoverride, then the portal,GTK_THEME, kdeglobals and gsettings. Now it readsISystemAppearanceService.Current.IsDark == true, which comes only from the portalcolor-scheme, isbool?, and stays null until the fire-and-forgetRefreshAsync()completes. With the theme set to Default, startup resolves to Light first, and setups without a portal (KDE-only, GTK_THEME, gsettings) plus theFILES_COLOR_SCHEMEoverride no longer affect this path.LinuxColorScheme.Initialize()/.Changedare also left with no callers, so that watcher never starts. Either keep theLinuxColorSchemecall behind the desktop seam, or fall back toPaletteIsDark/ the full chain whenIsDarkis null. - Stale path in a repo test:
scripts/linux/tests/test_install_root_helper.py:127still readssrc/Files.Platform.Linux/Native/PosixNative.cs, which now lives undersrc/Files.Platform.Posix/Native/. CI doesn't run this test, so it isn't caught there. Please update the path, including the split if the#if ELEVATION_HELPERbranches moved to another file. - Root env hook installed by
[ModuleInitializer](TracedProcessRegistration.cs): safe today becauseProgram.Mainloads the Linux assembly first, but if Posix code ever starts a process before that assembly loads, the root child-environment sanitizing is skipped without any error. Please install it explicitly fromProgram/AddDesktopPlatform, or at least document the load-order invariant next toPrepareStartInfo. - Minor:
FilesDesktopOS=macOScan't compile yet (Program.Linux.cs,DesktopPlatform.csandMainWindow.Linux.csstill referenceFiles.Platform.Linuxunconditionally). That's fine for scaffolding, but please mention it in the PR description.AddLinuxAppData()on its own no longer registersILocalSettingsStore, sinceAddPosixPlatformowns it now. The renames are also partial (LinuxMediaPreview/LinuxMedia*resw keys,StorageNetworkService.Linux.cs).
Happy to re-test once 1 and 2 are addressed.
🤖 Generated with Claude Code
|
Thanks for the detailed review. Pushed
Local checks: |
Extract the OS-neutral desktop code into a new Files.Platform.Posix project that references only Files.Platform.Abstractions, and rename the Linux-prefixed types, files and namespaces to Desktop*/Posix* so the Linux head is one implementation of a shared desktop layer instead of the layer itself. * Add a FilesDesktopOS selector (defaults to Linux) and gate the desktop Wayland/X11 targets on it. Linux behaviour is unchanged: the same Uno packages, the same define, the same output. * Move the shared POSIX primitives (stat, enumeration, watching, file operations, permissions, archives, launching, icons, previews, search and settings) into Files.Platform.Posix; Files.Platform.Linux keeps the Linux-only services and references it. * Route the root/elevation environment applied when starting a process through a Posix-level hook that the Linux assembly installs, and move the safe "open beneath a directory handle" primitive into the Posix native layer. * Gather the app layer's Linux entry points behind DesktopPlatform (DI registration, user directories, drag file list, display scale, FileManager1) and move the Linux startup, single instance and Uno host code from Program.cs into Program.Linux.cs. * Let CredentialsHelpers use any non-Windows ISecretStore. * Fix the tests left stale by the move and restore the /usr/lib/linuxfiles helper, state and cache paths that the packaging, polkit policy and launchers still use. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…itly - Seed LinuxSystemAppearanceService's palette synchronously from LinuxColorScheme, keep its Changed watcher alive, and let FILES_COLOR_SCHEME win over portal values. A default theme now resolves correctly before the portal answers and on desktops that only expose GTK_THEME, kdeglobals or gsettings. - Install the root child-environment hook from AddLinuxPlatform instead of a module initializer, so the load-order requirement is explicit. - Point the root-helper test at PosixNative's new location.
3afee50 to
f40aa7c
Compare
Resolved / Related Issues
No linked issue. This is a refactor with no intended behavior change.
What changed
Files.Platform.Posixproject that references onlyFiles.Platform.Abstractions.Files.Platform.Linuxkeeps the Linux-only services and references it.Desktop*/Posix*, so the Linux head is one implementation of a shared desktop layer.FilesDesktopOSselector (defaults to Linux) and gates the Wayland/X11 targets on it. Same Uno packages, define and output for Linux.DesktopPlatform(DI registration, user directories, drag file list, display scale, FileManager1) and moves the Linux startup, single instance and Uno host code fromProgram.csintoProgram.Linux.cs.CredentialsHelpersuses any non-WindowsISecretStore./usr/lib/linuxfileshelper, state and cache paths that packaging, the polkit policy and launchers use.Steps used to test these changes
dotnet build src/Files.App -f net10.0-desktopbuilds with 0 errors.Remaining limitations
Programstartup, single-instance forwarding and drag and drop are only covered by the build and CI, not by a runtime check.Files.Platform.Posix(for example/proc/self/fdinTrustedNativeDirectoryand the freedesktop MIME and icon helpers). Moving it is left for a follow-up.FilesDesktopOS=macOSis still scaffolding:Program.Linux.cs,DesktopPlatform.csandMainWindow.Linux.csreferenceFiles.Platform.Linuxunconditionally, so that selection does not compile yet.AddLinuxAppData()no longer registersILocalSettingsStoreby itself;AddPosixPlatform()owns that registration, so callers need both.LinuxMediaPreview/LinuxMedia*resource keys andStorageNetworkService.Linux.cskeep their names because nothing depends on them being platform-neutral yet.🤖 Generated with Claude Code