Repository navigation
Conversation
…orer: the Open with chooser too (Lemxy#191)
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.
Fixes #191.
Problem
When WinRust replaces Explorer as the shell, Windows' own dialogs — most visibly the "How do you want to open this file?" chooser shown for an unassociated file or a link with no default app — are created at
(0,0)or off the monitor and get clipped. Only the "Just once" button is reachable, so the user can't pick a program (and can't set a default to make the prompt stop).The chooser is OS-provided; WinRust never draws it. The shell normally positions it, and with Explorer gone that placement is lost.
Fix
1.
rs-shell: keep stray dialogs on screen (covers external apps, e.g. a login link from TIDAL).A WinEvent hook (
EVENT_OBJECT_SHOW) is installed whenever Explorer is not the shell — shell mode, and the overlay when it replaces Explorer. When a new top-level window shows, if it sticks out of its monitor it is moved back inside the work area. It is event-driven (no polling), ignores maximized/full-screen windows and anything larger than the screen, and does nothing while Explorer is still the shell.2.
rust-explorer: the chooser from our own file manager.activate()(double-click / Enter / Space) now reuses the existingkeep_on_screen()around itsShellExecuteW, exactly as the context-menu path (sh::show) already does. So a.cfgdouble-click is handled even if rs-shell's watcher isn't running.This does not touch file associations — "Always" stays Windows' (
UserChoiceis OS-guarded; seesrc/install/tools.rs). The fix only makes the system dialog reachable so the user can choose.Testing
cargo build -p rust-explorer -p rs-shell— clean.cargo test -p rust-explorer -p rs-shell— all pass.cargo test --workspace— all pass exceptrtaskmgr-win32::gpu::tests::real_adapters_have_memory_directx_location_and_temperature, which fails on a cleanmaintoo on this machine (GPU reports an empty location string); unrelated.Not verified on a live shell-swapped session — built and unit-tested only.