-
Notifications
You must be signed in to change notification settings - Fork 15
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
fix: Only allow single instance of NoPorts Desktop on Windows #1713
Conversation
HWND hwnd = ::FindWindow(kWindowClassName, kWindowName); | ||
if (hwnd != NULL) { | ||
::ShowWindow(hwnd, SW_NORMAL); | ||
::SetForegroundWindow(hwnd); | ||
return EXIT_FAILURE; | ||
} | ||
|
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.
If we find a window matching the default Flutter window class name && Titled "NoPorts Desktop" open that instead.
constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; | ||
|
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.
moved this to its .h file so we have access to it in main.cpp too.
I rebased 03d23e4 back onto trunk since it was based on a wildly divergent branch, then I retested. |
Correction, I am retesting... VSCode cached commits... so they appeared in the build despite the rebase. |
Okay, ready for review, tested with a git history that matches that of this PR. |
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.
Built and tested on windows home and clean build odf windows.. Clicking the toolbar brings up the existing instance not a new one
- What I did
The existing behavior:
Desired behavior (that this PR provides):
Retained behavior:
- How I did it
- How to verify it
- Description for the changelog
fix: Only allow single instance of NoPorts Desktop on Windows