#13251: wxExecute generates additional icon in Alt+Tab process list

44 views
Skip to first unread message

wxTrac

unread,
May 27, 2011, 5:39:04 AM5/27/11
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/13251>

#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


--
Ticket URL: <http://trac.wxwidgets.org/ticket/13251>

wxTrac

unread,
May 27, 2011, 5:50:30 AM5/27/11
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/13251#comment:1>

#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.


--
Ticket URL: <http://trac.wxwidgets.org/ticket/13251#comment:1>

wxTrac

unread,
Jun 1, 2011, 12:00:49 PM6/1/11
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/13251#comment:2>

#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 ();

I expect to see no icon, but I see one.


--
Ticket URL: <http://trac.wxwidgets.org/ticket/13251#comment:2>

wxTrac

unread,
Jul 23, 2011, 4:41:17 PM7/23/11
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/13251#comment:3>

#13251: wxExecute generates additional icon in Alt+Tab process list
-----------------------+----------------------------------------------------
Reporter: joim | Owner:

Type: defect | Status: confirmed


Priority: normal | Milestone:
Component: wxMSW | Version: 2.9-svn
Keywords: wxExecute | Blockedby:
Patch: 0 | Blocking:
-----------------------+----------------------------------------------------

Changes (by vadz):

* status: new => confirmed


Comment:

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.


--
Ticket URL: <http://trac.wxwidgets.org/ticket/13251#comment:3>

wxTrac

unread,
Sep 30, 2012, 7:30:26 PM9/30/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/13251#comment:4>

#13251: wxExecute generates additional icon in Alt+Tab process list
-----------------------+----------------------------------------------------
Reporter: joim | Owner:
Type: defect | Status: confirmed
Priority: normal | Milestone:
Component: wxMSW | Version: 2.9-svn
Keywords: wxExecute | Blockedby:
Patch: 1 | Blocking:
-----------------------+----------------------------------------------------
Changes (by catalin):

* patch: 0 => 1


Comment:

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.


--
Ticket URL: <http://trac.wxwidgets.org/ticket/13251#comment:4>

wxTrac

unread,
Oct 1, 2012, 5:57:52 AM10/1/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/13251#comment:5>

#13251: wxExecute generates additional icon in Alt+Tab process list
-----------------------+----------------------------------------------------
Reporter: joim | Owner:
Type: defect | Status: confirmed
Priority: normal | Milestone: 2.9.5
Component: wxMSW | Version: 2.9-svn
Keywords: wxExecute | Blockedby:
Patch: 1 | Blocking:
-----------------------+----------------------------------------------------
Changes (by vadz):

* milestone: => 2.9.5


Comment:

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.


--
Ticket URL: <http://trac.wxwidgets.org/ticket/13251#comment:5>

wxTrac

unread,
Oct 12, 2012, 7:26:22 PM10/12/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/13251#comment:6>

#13251: wxExecute generates additional icon in Alt+Tab process list
-----------------------+----------------------------------------------------
Reporter: joim | Owner: vadz
Type: defect | Status: accepted
Priority: normal | Milestone: 2.9.5
Component: wxMSW | Version: 2.9-svn
Keywords: wxExecute | Blockedby:
Patch: 1 | Blocking:
-----------------------+----------------------------------------------------
Changes (by vadz):

* owner: => vadz
* status: confirmed => accepted


Comment:

Seems to work well under XP too, will commit soon, thanks.


--
Ticket URL: <http://trac.wxwidgets.org/ticket/13251#comment:6>

wxTrac

unread,
Oct 13, 2012, 6:53:01 PM10/13/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/13251#comment:7>

#13251: wxExecute generates additional icon in Alt+Tab process list
-----------------------+----------------------------------------------------
Reporter: joim | Owner: vadz
Type: defect | Status: accepted
Priority: normal | Milestone: 2.9.5
Component: wxMSW | Version: 2.9-svn
Keywords: wxExecute | Blockedby:
Patch: 1 | Blocking:
-----------------------+----------------------------------------------------

Comment(by VZ):

(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.

See #13251.


--
Ticket URL: <http://trac.wxwidgets.org/ticket/13251#comment:7>

wxTrac

unread,
Oct 13, 2012, 6:53:24 PM10/13/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/13251#comment:8>

#13251: wxExecute generates additional icon in Alt+Tab process list
---------------------+------------------------------------------------------
Reporter: joim | Owner: vadz
Type: defect | Status: closed
Priority: normal | Milestone: 2.9.5
Component: wxMSW | Version: 2.9-svn
Resolution: fixed | Keywords: wxExecute
Blockedby: | Patch: 1
Blocking: |
---------------------+------------------------------------------------------
Changes (by VZ):

* status: accepted => closed
* resolution: => fixed


Comment:

(In [72667]) Use a "hidden" dialog, not frame, in sync wxExecute() hack in
wxMSW.

Replace a "hidden" (not really, but shown far off screen) frame with a
dialog
to avoid this frame appearing in the Alt+TAB list.

Closes #13251.


--
Ticket URL: <http://trac.wxwidgets.org/ticket/13251#comment:8>
Reply all
Reply to author
Forward
0 new messages