-
-
Notifications
You must be signed in to change notification settings - Fork 447
Fix setting window freeze issue & Improve singleton window opener #3204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@check-spelling-bot Report🔴 Please reviewSee the 📂 files view, the 📜action log, or 📝 job summary for details.
See ❌ Event descriptions for more information. If the flagged items are 🤯 false positivesIf items relate to a ...
|
Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX. |
📝 WalkthroughWalkthroughThis pull request introduces changes to two files in the Flow.Launcher project. The Changes
Sequence DiagramsequenceDiagram
participant Window as Window<T>
participant Opener as SingletonWindowOpener
Opener->>Window: Open<T>()
alt Window is Minimized
Opener->>Window: Set WindowState to Normal
end
alt Window is Not Visible
Opener->>Window: Show()
else Window is Visible
Opener->>Window: Activate and Bring to Foreground
end
Opener->>Window: Ensure Focus
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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
🧹 Nitpick comments (2)
Flow.Launcher/Helper/SingletonWindowOpener.cs (1)
26-34
: Consider adding error handling for window activation.While the visibility check and activation logic is good, consider adding try-catch blocks around
window.Activate()
as it can throw Win32Exception in certain scenarios (e.g., if the window handle is invalid).else { + try + { window.Activate(); // Bring the window to the foreground if already open + } + catch (System.ComponentModel.Win32Exception) + { + // If activation fails, fall back to showing the window + window.Show(); + } }Flow.Launcher/SettingWindow.xaml.cs (1)
37-41
: Consider performance impact of software rendering.Software rendering might impact UI performance. Consider:
- Adding a configuration option to toggle software rendering
- Only enabling it when needed (e.g., detect system resume from sleep)
- Documenting the performance implications
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
Flow.Launcher/Helper/SingletonWindowOpener.cs
(1 hunks)Flow.Launcher/SettingWindow.xaml.cs
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: gitStream.cm
- GitHub Check: gitStream.cm
- GitHub Check: gitStream.cm
🔇 Additional comments (1)
Flow.Launcher/Helper/SingletonWindowOpener.cs (1)
20-24
: LGTM! Good fix for the minimized window issue.The explicit handling of minimized window state ensures the window becomes visible when requested. The comment effectively explains the rationale and links to the reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Fix setting window freeze issue after lock screen (Win+L) or sleep (Some commits seem to change the codes that try to fix this issue 😢)
Improve singleton window opener
Already tested on my computer and it works well now!
Related issue: #3139, #3169, #3187