#13251: wxExecute generates additional icon in Alt+Tab process list -----------------------+--------------------------------------------------- - Reporter: joim | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: wxMSW | Version: 2.9-svn Keywords: wxExecute | Blockedby: Patch: 0 | Blocking: -----------------------+--------------------------------------------------- - I start from my wx program an external program with the wxExecute function (with the wxEXEC_SYNC default parameter).
When I press Alt+Tab while the external program is still running, there are two icons for my wx program in the process list shown by the windows operating system.
I am using Windows XP.
I think this comes from the dummy window "winActive" in the function void *wxGUIAppTraits::BeforeChildWaitLoop() in the file src/msw/app.cpp on line 191
#13251: wxExecute generates additional icon in Alt+Tab process list -----------------------+--------------------------------------------------- - Reporter: joim | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: wxMSW | Version: 2.9-svn Keywords: wxExecute | Blockedby: Patch: 0 | Blocking: -----------------------+--------------------------------------------------- -
Comment(by vadz):
I can't reproduce this in the exec sample, if I synchronously execute notepadin it I only see one icon, not two.
OTOH I also noticed that this workaround with active but hidden window doesn't work anyhow under Windows 7 which still switches to another program when notepad is closed. So it really looks like we need to avoid disabling the main window anyhow. This would require relatively extensive changes however.
#13251: wxExecute generates additional icon in Alt+Tab process list -----------------------+--------------------------------------------------- - Reporter: joim | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: wxMSW | Version: 2.9-svn Keywords: wxExecute | Blockedby: Patch: 0 | Blocking: -----------------------+--------------------------------------------------- -
Comment(by joim):
I see. In the exec sample I also can't reproduce.
But I think, the icon that appears during the notepad is running, is not the icon of the main exec sample window, but the icon of the dummy window (when you debug step by step, you see first disappearing the task icon (wxWindowDisabler) and then reappearing (dummy window show), and you see, that there is no window title below the icon.
When I replace in the exec sample the OnSyncExec function with
Hide (); wxExecute ("C:\\Programme\\Notepad++\\notepad++.exe", wxEXEC_SYNC); Show ();
Still not sure what to do about this. Some fresh ideas wanted as the current approach simply doesn't work under Win7 and we still lose focus/activation so we could just as well not do it at all.
I can confirm what the OP is seeing. When using wxExecute with wxEXEC_SYNC
an icon for the dummy frame is shown in Alt+Tab list.
This can be fixed by changing the dummy frame to a dummy dialog. No
secondary effects noticed. It also improves the workaround. Patch
attached.
In reply to comment 3: I've tested this under Win7 and the workaround
seems to work, I'll try to explain below.
With the dummy frame:
1) the app is active and opens Notepad in a sync way;
2) the user closes Notepad;
3) result: the focus is not always returned to the app; FWIS it is
returned if the main frame is the last to have been activated before
running wxExecute _and_ was moved around a bit;
With dummy dialog:
1) the app is active and opens Notepad in a sync way;
2) the user closes Notepad;
3) result: the focus is always returned to the app.
Notice that if the user switches to some other app after step 1, the focus
is indeed not returned to the wx app after closing Notepad in any of the 2
cases.
Thanks, this looks like a decent workaround. I'll try to test it under XP
and if it works there too will apply it. If anybody else can do it, please
add a comment about the test results here.
(In [72666]) Set the standard sample icon for the exec sample.
Do this for consistency with all the other ones and also because it makes
it
simpler to notice any unwanted icons for hidden windows created by this
sample.