-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Implement Single instance lock feature with passing arguments to initial instance #2951
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
…feature/open-files
…feature/open-files
…feature/open-files
Should be reviewed after #2918 merged |
@leaanthony Maybe we can take a look on this too? Also I have one more PR to enable custom url protocols support in wails as well 🚀 |
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.
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.
I would recommend setting this to one because all that means is that if two messages are sent at the same time the second routine sending will block until the first message is processed. Setting it higher only ensures that the caller doesn't block on sending up to the limit.
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.
LGTM, that's an awesome PR thanks @APshenkin 🙏
I only added two minor comments regarding the Windows code.
@tmclane Make sense. Updated to set it to one @leaanthony @stffabi @tmclane |
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.
👍 from me
Thanks for the awesome PR 🙏 |
Awesome, thanks for your time @APshenkin |
Description
Implements Single instance lock feature with additional passing arguments to initial instance #1351
There is implementation for single instance lock in V3 as plugin, but it doesn't allow to pass arguments of second instance to first one.
Now in V2 it's possible.
Also in plugin version there was option
ActivateAppOnSubsequentLaunch
. I decided to not put it here. As now we have callbacks when second instance is called, I think it should be on "developer" side how to treat this. For example somebody will want to handle it differently depends on what type of arguments were passed.Also in addition Windows
runtime.Show()
andruntime.WindowUnminimise()
were modified for better handling different scenarios related to change focus of apps.You can see how it works here.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Test repo is available here https://github.com/APshenkin/wails-open-file/tree/feature/single-lock
PR should be fetched and replace in go.mod should be adjusted
Test Configuration
Checklist:
website/src/pages/changelog.mdx
with details of this PR