Skip to content

Recover from task switcher issue with minimized windows#4400

Merged
jjw24 merged 1 commit intoFlow-Launcher:devfrom
DavidGBrett:fix-task-switcher-issue-with-minimized-windows
Apr 11, 2026
Merged

Recover from task switcher issue with minimized windows#4400
jjw24 merged 1 commit intoFlow-Launcher:devfrom
DavidGBrett:fix-task-switcher-issue-with-minimized-windows

Conversation

@DavidGBrett
Copy link
Copy Markdown
Contributor

@DavidGBrett DavidGBrett commented Apr 9, 2026

Catches case where window is activated but not restored / maximized and then manually does that

Partially resolves #4397

This doesn't fix the core issue but does recover from it to get to the desired state regardless.
There will still be an error sound, but the window will be restored/maximized based on the state it was before being minimized.


Summary by cubic

Fixes a rare Alt+Tab case where Settings and Plugin Settings stayed minimized after activation. On activation, each window restores to its last non-minimized state so it shows up in the task switcher.

  • Summary of changes
    • Existing logic changed: PluginSettingsWindow now tracks the last non-minimized state in OnLoaded/Window_StateChanged; SettingWindow state persistence remains the same.
    • New logic added: Activated="Window_Activated" on both windows; on activation, if minimized, SettingWindow restores to _settings.SettingWindowState and PluginSettingsWindow restores to _lastNonMinimizedWindowState.
    • Existing logic removed: None.
    • Memory usage impact: Negligible (one new field in PluginSettingsWindow and one extra event subscription per window).
    • Security risks: None.
    • Unit tests: None added; behavior verified manually via Alt+Tab.

Written for commit 8783bac. Summary will update on new commits.

@prlabeler prlabeler bot added the bug Something isn't working label Apr 9, 2026
@github-actions github-actions bot added this to the 2.2.0 milestone Apr 9, 2026
@DavidGBrett DavidGBrett changed the title band-aid fix for task switcher issue with minimized windows Band-aid fix for task switcher issue with minimized windows Apr 9, 2026
@DavidGBrett DavidGBrett marked this pull request as ready for review April 9, 2026 16:44
@gitstream-cm
Copy link
Copy Markdown

gitstream-cm bot commented Apr 9, 2026

🥷 Code experts: Jack251970

Jack251970 has most 👩‍💻 activity in the files.
Jack251970 has most 🧠 knowledge in the files.

See details

Flow.Launcher/PluginSettingsWindow.xaml

Activity based on git-commit:

Jack251970
APR 288 additions & 306 deletions
MAR
FEB
JAN
DEC
NOV

Knowledge based on git-blame:
Jack251970: 82%

Flow.Launcher/PluginSettingsWindow.xaml.cs

Activity based on git-commit:

Jack251970
APR
MAR
FEB
JAN
DEC
NOV

Knowledge based on git-blame:

Flow.Launcher/SettingWindow.xaml

Activity based on git-commit:

Jack251970
APR
MAR
FEB
JAN
DEC
NOV

Knowledge based on git-blame:
Jack251970: 100%

Flow.Launcher/SettingWindow.xaml.cs

Activity based on git-commit:

Jack251970
APR
MAR
FEB
JAN
DEC
NOV

Knowledge based on git-blame:
Jack251970: 99%

✨ Comment /gs review for LinearB AI review. Learn how to automate it here.

@gitstream-cm
Copy link
Copy Markdown

gitstream-cm bot commented Apr 9, 2026

Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 4 files

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 9, 2026

📝 Walkthrough

Walkthrough

Adds Activated event handlers to settings windows to restore a cached non-minimized WindowState when the window is activated while minimized, ensuring Alt+Tab activation correctly restores the window.

Changes

Cohort / File(s) Summary
PluginSettingsWindow
Flow.Launcher/PluginSettingsWindow.xaml, Flow.Launcher/PluginSettingsWindow.xaml.cs
Hooked Activated="Window_Activated" in XAML and added Window_Activated logic plus a _lastNonMinimizedWindowState cache to restore state when activation occurs while minimized.
SettingWindow
Flow.Launcher/SettingWindow.xaml, Flow.Launcher/SettingWindow.xaml.cs
Hooked Activated="Window_Activated" in XAML and added Window_Activated handler to restore persisted non-minimized state on activation when current state is minimized.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • Yusyuriv
  • jjw24
  • Jack251970
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description is directly related to the changeset, explaining the problem, the solution approach, and acknowledging it as a partial fix.
Linked Issues check ✅ Passed The changes directly address the core requirement from #4397: enabling minimized Settings and Plugin Settings windows to be restored via Alt+Tab activation.
Out of Scope Changes check ✅ Passed All changes are scoped to the stated objective: adding Window_Activated handlers to both SettingWindow and PluginSettingsWindow to restore minimized windows on activation.
Title check ✅ Passed The title accurately and concisely summarizes the main change: recovering minimized windows from a task switcher issue via Activated event handlers.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

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 the current code and only fix it if needed.

Inline comments:
In `@Flow.Launcher/PluginSettingsWindow.xaml.cs`:
- Around line 95-104: The restore logic in Window_Activated uses
_settings.SettingWindowState (global SettingWindow history) which can reopen
PluginSettingsWindow with the wrong state; add a PluginSettingsWindow-local
field (e.g., _lastNonMinimizedState) that you update whenever this window's
StateChanged handler sees a non-minimized state, and change Window_Activated to
restore WindowState from that local field instead of
_settings.SettingWindowState; update any StateChanged or closing logic in the
PluginSettingsWindow class to maintain _lastNonMinimizedState so the window
reliably returns to its own last non-minimized state.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5e62d825-f765-456b-a5bf-d6a32c0d4403

📥 Commits

Reviewing files that changed from the base of the PR and between 3e320d5 and e3dc615.

📒 Files selected for processing (4)
  • Flow.Launcher/PluginSettingsWindow.xaml
  • Flow.Launcher/PluginSettingsWindow.xaml.cs
  • Flow.Launcher/SettingWindow.xaml
  • Flow.Launcher/SettingWindow.xaml.cs

@DavidGBrett DavidGBrett marked this pull request as draft April 9, 2026 16:50
Catches case where window is activated but not restored / maximized and then manually does that
@DavidGBrett DavidGBrett force-pushed the fix-task-switcher-issue-with-minimized-windows branch from e3dc615 to 8783bac Compare April 9, 2026 16:55
@DavidGBrett DavidGBrett marked this pull request as ready for review April 9, 2026 17:36
@coderabbitai coderabbitai bot removed the bug Something isn't working label Apr 9, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 4 files

@DavidGBrett DavidGBrett changed the title Band-aid fix for task switcher issue with minimized windows [FIX]: recover from task switcher issue with minimized windows Apr 9, 2026
@prlabeler prlabeler bot added the bug Something isn't working label Apr 9, 2026
@DavidGBrett DavidGBrett changed the title [FIX]: recover from task switcher issue with minimized windows fix: recover from task switcher issue with minimized windows Apr 11, 2026
@DavidGBrett DavidGBrett changed the title fix: recover from task switcher issue with minimized windows Recover from task switcher issue with minimized windows Apr 11, 2026
@jjw24 jjw24 merged commit ffb2200 into Flow-Launcher:dev Apr 11, 2026
9 checks passed
@DavidGBrett DavidGBrett deleted the fix-task-switcher-issue-with-minimized-windows branch April 11, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Alt tab (Task Switcher) not working with minimised settings window

2 participants