Repository navigation
Code Quality: Switch Win32 compat mode off on Linux (P4-Z) - #74
Merged
Merged
Conversation
Move the FindFirstFileEx/StorageFolder enumeration, ReadDirectoryChangesW watchers, alternate data streams, Recycle Bin shell items and BitLocker prompt verbatim into ShellViewModel.Windows.cs. Linux lists archive roots and folders through IStorableResolver/ArchiveFolder (read-only, no watcher) and can navigate into folders inside an archive. Ratchet the compat-off baseline to 2 keys. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LeKXJc3DnK3PzAqwgA72NY
FilesWin32Compat now defaults to false and stays as an opt-in lens (defines FILES_WIN32_COMPAT). The desktop build compiles with 0 errors and without the CsWin32 prebuild: registry cloud detectors and MTP shell resolution move to *.Windows.cs, the remaining Win32 call sites get small #if WINDOWS blocks or Linux fallbacks, ICommonDialogService and IStartMenuService get desktop stubs, and IStorageItemWithPath.Item plus the unused desktop WinRT StorageHelpers members are gone. Linux CI builds Files.App with compat off as a blocking step. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LeKXJc3DnK3PzAqwgA72NY
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolved / Related Issues
Phase 4 work package P4-Z (docs/linux-port/PLAN.md, Phase 4 plan Revision 3). No issue.
Stacked on #73 (P4-E). P4-E wasn't merged when this started, so this branch is based on
linux/p4-e. Merge #73 first; this PR's own change is the last commit (889d848).What changed
Directory.Build.props:FilesWin32Compatnow defaults tofalse.-p:FilesWin32Compat=trueremains as an opt-in inventory lens and now also definesFILES_WIN32_COMPAT, so files that only build in compat mode (Utils/Shell,Services/Windows) still compile.IStorageItemWithPath.Itembecame Windows-only, one more round: 2 → 10 → 0.*.Windows.csunchanged:CloudDrivesDetector,GenericCloudDetector,OXDriveCloudDetector(registry and exe icons) andMtpHelpers(Shell COM; its only caller is already under#if WINDOWS).#if WINDOWSblocks with Linux fallbacks:Task.Runinstead ofSTATask.BringToForegroundEx, the ShellItem/ShellDataObject drag payload (Linux usesDesktopFileDragHelper) andGetDoubleClickTime(Linux uses 500 ms) are guarded.DriveHelpers.OpenFormatDialogAsync.ShellHelpers.cs(portable) is compiled again on desktop.DesktopStubServices.cs:DesktopCommonDialogService(LINUX-TODO(pickers): xdg-desktop-portal FileChooser). Pickers report cancelled, as the Win32 version effectively did on Linux.DesktopStartMenuService: no pins.IStorageItemWithPath.Itemand its explicit implementations are now#if WINDOWS. Drag-out-of-archive checks use a newIsArchiveMember()extension (Windows: the originalZipStorage*test; Linux:ArchiveFolder/ArchiveEntryFileorIsZipPath).StorageHelpersmembers are deleted:ToStorageItem(IStorageItemWithPath),ToStorageItemResult,GetFileSize,ToType.LINUX-TODO):storage-sense: Open Storage Sense does nothing.launch: commands typed into the address bar are reported as an invalid path.ci-linux.yml: the Files.App desktop build passes-p:FilesWin32Compat=falseand is blocking. A new step fails ifFiles.App.CsWin32was built. Locally, after deleting itsbin/obj, the default build left both absent, and the project graph has no CsWin32 reference.Steps used to test these changes
dotnet build src/Files.App -f net10.0-desktop(compat off by default): 0 errors.-p:FilesWin32Compat=true: 0 errors.headless-run.sh, showcase drives and seed). Each step passed: browse; copy into Reports; move into Notes; trash; restore from the Recycle Bin; browse into Projects.zip and its Projects folder; liveexec touch/rm; search; Properties. The files on disk were checked afterwards.#if WINDOWSbranches and*.Windows.csfiles haven't been compiled.🤖 Generated with Claude Code
https://claude.ai/code/session_01LeKXJc3DnK3PzAqwgA72NY