Skip to content

fix(settings): stop settings window floating above other apps#1014

Open
meisolated wants to merge 2 commits into
crynta:mainfrom
thevedus:fix/settings-window-always-on-top
Open

fix(settings): stop settings window floating above other apps#1014
meisolated wants to merge 2 commits into
crynta:mainfrom
thevedus:fix/settings-window-always-on-top

Conversation

@meisolated

@meisolated meisolated commented Jul 17, 2026

Copy link
Copy Markdown

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 the always_on_top flag was redundant there and was the sole cause of the bug. macOS deliberately skips parent() (per the existing #33 comment) and genuinely needs the flag.

This PR gates always_on_top (both the builder flag and the set_always_on_top re-assert on reopen) to macOS only:

Testing

  • Windows: open Settings → switch to another app → Settings goes behind it; click back into the Terax main window → Settings stays above main.

Summary by CodeRabbit

  • Bug Fixes
    • Improved settings window behavior across platforms.
    • Ensured the settings window remains always on top only on macOS, preventing unintended behavior on other platforms.

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.
@meisolated
meisolated requested a review from crynta as a code owner July 17, 2026 07:51
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

Settings window platform behavior

Layer / File(s) Summary
Gate always-on-top handling by platform
src-tauri/src/lib.rs
open_settings_window limits always-on-top reassertion and initial configuration to macOS in both existing-window and creation paths.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related issues

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title follows Conventional Commits and accurately summarizes the platform-specific settings window fix.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5c2f4cd and 2aa59d2.

📒 Files selected for processing (1)
  • src-tauri/src/lib.rs

Comment thread src-tauri/src/lib.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant