fix(settings): stop settings window floating above other apps#1014
Open
meisolated wants to merge 2 commits into
Open
fix(settings): stop settings window floating above other apps#1014meisolated wants to merge 2 commits into
meisolated wants to merge 2 commits into
Conversation
always_on_top is OS-global, so the settings window stayed pinned over every application when switching away from Terax on Windows/Linux. The parent()/owner relationship already keeps it above the main window there (crynta#33), so gate the flag to macOS, which skips parent() and genuinely needs it.
📝 WalkthroughWalkthroughChangesSettings window platform behavior
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src-tauri/src/lib.rs`:
- Around line 88-90: Add a platform-aware regression test covering both window
reuse and creation paths: assert macOS applies always_on_top(true), while
non-macOS avoids global always_on_top and preserves the parent/owner behavior.
Anchor the test to the relevant window-ordering logic around the existing
set_always_on_top call and the code at the alternate referenced section, and
ensure it locks the IPC invariant without altering unrelated behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 1c9b5365-d6d8-49d0-892a-63d851752613
📒 Files selected for processing (1)
src-tauri/src/lib.rs
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.
Problem
Open the Settings window, then Alt-Tab (Windows) or switch to any other application: the Settings window stays pinned on top of every other app, not just Terax.
Root cause
The settings window is built with
.always_on_top(true), which is an OS-global flag — it keeps the window above all applications. The original intent (#33) was only to keep Settings above Terax's own main window so it doesn't vanish when clicking back into the editor/terminal.Fix
On Windows/Linux the window already sets
.parent(&main), and an owned window natively stays above its owner — so thealways_on_topflag was redundant there and was the sole cause of the bug. macOS deliberately skipsparent()(per the existing #33 comment) and genuinely needs the flag.This PR gates
always_on_top(both the builder flag and theset_always_on_topre-assert on reopen) to macOS only:Testing
Summary by CodeRabbit