Replaces #25486.
Closes #24668.
https://github.com/wxWidgets/wxWidgets/pull/25548
(3 files)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@paulcor approved this pull request.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
On MSW, is this the same appID as used in wxTaskBarJumpList?
If so, we probably can't use the wxApp one when passed an empty one to wxTaskBarJumpList now, but perhaps it could be cross-referenced in the docs?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@vadz pushed 3 commits.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Good catch, thanks! It's indeed the same app ID and this should indeed be mentioned in the docs, I've updated this PR to do it.
Note that I don't think any changes in the code are needed as by leaving the appID parameter empty we should be already using the previously set global app ID.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Merged #25548 into master.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
FYI
This creates a behavior change on Windows.
In particular, the Shift+Middle click function of the taskbar will no longer launch a new instance of the process when a explicit app user model id is set.
This can be fixed by also allowing the specification of the relaunch command on the windows's shell property store (SHGerPropertyStoreForWindow)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
This creates a behavior change on Windows.
Thanks, I had no idea...
In particular, the Shift+Middle click function of the taskbar will no longer launch a new instance of the process when a explicit app user model id is set.
This can be fixed by also allowing the specification of the relaunch command on the windows's shell property store (SHGerPropertyStoreForWindow)
Do you already have code doing this somewhere I could steal^H^H^H^H^H use as an inspiration?
Probably needs to be explained to a user or documented. And it may not be wise to automatically set the relaunch command in case custom args are required.
Yes, we could need to add some wxApp::MSWSetRelaunchCommand().
(Note kicad uses app user model id but we did it our own way)
Will you be able to switch to wx way once you require 3.3 or is there still anything missing here from your point of view?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Do you already have code doing this somewhere I could steal^H^H^H^H^H use as an inspiration?
Sure. This is actually hacky because I started looking at this due to a user complaint. But this does work.
The main bits:
void KIPLATFORM::ENV::SetWindowRelaunchCommand( wxWindow* aWindow, const wxString& aCommand )
{
IPropertyStore* pps;
HRESULT hr = ::SHGetPropertyStoreForWindow( aWindow->GetHWND(), IID_PPV_ARGS( &pps ) );
if( SUCCEEDED( hr ) )
{
PROPVARIANT pv;
if( !aCommand.empty() )
{
hr = ::InitPropVariantFromString( GetAppUserModelId(), &pv );
}
else
{
// empty var
::PropVariantInit( &pv );
}
if( SUCCEEDED( hr ) )
{
hr = pps->SetValue( PKEY_AppUserModel_ID, pv );
PropVariantClear( &pv );
}
if( !aCommand.empty() )
{
hr = ::InitPropVariantFromString( aCommand.wc_str(), &pv );
}
else
{
// empty var
::PropVariantInit( &pv );
}
if( SUCCEEDED( hr ) )
{
hr = pps->SetValue( PKEY_AppUserModel_RelaunchCommand, pv );
PropVariantClear( &pv );
}
if( !aCommand.empty() )
{
hr = ::InitPropVariantFromString( L"KiCad", &pv );
}
else
{
// empty var
::PropVariantInit( &pv );
}
if( SUCCEEDED( hr ) )
{
hr = pps->SetValue( PKEY_AppUserModel_RelaunchDisplayNameResource, pv );
PropVariantClear( &pv );
}
pps->Release();
}
}
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Will you be able to switch to wx way once you require 3.3 or is there still anything missing here from your point of view?
I need to explore if we are using wxApp::GetClassName for anything else. For the app user model id we have a microsoft formatted string of <organization>.<product>.<subproduct>.<version> which we then pass onto our external third party plugin ecosystem to keep things unified. I don't want to blow things up because we were using GetclassName for something else
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Thanks for the code, but it looks like this might require adding some new API, as it doesn't seem possible to decide about the right thing to do inside wx itself.
I wonder if this could/should be tied up with some API wrapping RegisterApplicationRestart() which I think would be also useful to have in wx, wouldn't it?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Register application restart is also something we handle in kicad. Basically to offer post-update restart when used with the session restoration.
But in kicad's case, implemented the relaunchcommand with a "-n" arg specifically because a user can trigger it while kicad is already open with a project. If you launch kicad again, it would otherwise try to reopen that exist same project. The -n arg in my case tells it to start blank.
But in the register application restart case, I would want it to open the previous project.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Also, there's another behavior change by app model id. That I am also fixing in kicad.
The MRU file list in windows for shortcuts in your start menu that point to your application stop working.
Fixing it requires implementing SHAddToRecentDocs to add recent items to the shell MRU using app model IDs.
And using setting the app model id within the shortcut itself which is actually not trivial, Microsoft only intended for people to do this via MSI installs.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Also, there's another behavior change by app model id. That I am also fixing in kicad.
The MRU file list in windows for shortcuts in your start menu that point to your application stop working.
This looks like something wxFileHistory could do, I think. Would it be useful for you if it took care of this?
For the restart problem, unless you'd be interested in discussing restart API more in depth (in which case we need to open a new issue and do it there), I think we'll just have to settle for documenting the limitation for now as I can't say it's obvious to me what should wx do here.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()