From: SourceForge.net <no...@so...> - 2003-01-28 10:30:03
|
Bugs item #672526, was opened at 2003-01-22 16:11 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=672526&group_id=10894 Category: 02. Event Loops Group: None Status: Open Resolution: Works For Me Priority: 5 Submitted By: Gilles Noyer (gnoyer) Assigned to: David Gravereaux (davygrvy) Summary: X11 event lost with popen. Initial Comment: Hello I have a problem on Windows XP and tcl 8.4.1 The application is not refreshed after the end of an other application lauched with the popen function. Moving the windows refresh the windows and permit to work again. The little sample show the problem. Click on the click button. This open notepad move the window notepad. Closing notepad not refresh the tcl windows and the application is not available. This problem is done on a lot of Windows XP stations. The problem is only in Windows XP and look like an X11 event problem. Thanks a lot. Gilles Noyer ---------------------------------------------------------------------- >Comment By: Gilles Noyer (gnoyer) Date: 2003-01-28 10:34 Message: Logged In: YES user_id=694494 I tested with exec and the problem look like the same only the frequency change to 3 times on 5 lauches instead of 4 timere on 5 lauches. I know that XP and 2000 are differents to manager X11 event. (ie the order is different and can cause some pbs) I will ask more informations about this and post them. ---------------------------------------------------------------------- Comment By: David Gravereaux (davygrvy) Date: 2003-01-28 09:37 Message: Logged In: YES user_id=7549 Are you sure the GUI program supports pipes? That's a very odd mix. Can you use [exec] instead? ---------------------------------------------------------------------- Comment By: David Gravereaux (davygrvy) Date: 2003-01-28 09:27 Message: Logged In: YES user_id=7549 I can't reproduce it here, but I'll bet it's the call to [gets]. notepad doesn't use pipes. And not until that blocking gets call comes back does Tcl continue. I'll bet money there is nothing wrong with Tcl_DoOneEvent or it's child Tcl_WaitForEvent. I recommend not using pipes to an application that doesn't support pipes. ---------------------------------------------------------------------- Comment By: Gilles Noyer (gnoyer) Date: 2003-01-28 09:22 Message: Logged In: YES user_id=694494 Sorry, I called "popen" the little code : set fid [open "| notepad" r ] because in fact I want to open a GUI program having I/O to the standard chanel. My application not use notepad but an other GUI program, and I want to have the result in the standart output when it finished. In the program the "gets" is used to get the result of the GUI program. You are right in the sample it is not used. My application work fine on Windows NT and 2000 but not in XP. I know that Microsoft change some event strategy on XP. ---------------------------------------------------------------------- Comment By: Gilles Noyer (gnoyer) Date: 2003-01-28 09:09 Message: Logged In: YES user_id=694494 more precisions : This only a XP problem. To reproduce the problem the tcl windows need to be covered by the notepad window. This problem is solved by setting "Windows NT compatibility" property flag to wish84. The problem is random, try 3 times on a PC. On some XP station I do not reproduce it. This look like the X11 main loop event. ---------------------------------------------------------------------- Comment By: David Gravereaux (davygrvy) Date: 2003-01-28 09:00 Message: Logged In: YES user_id=7549 in the test script is this line: set fid [open "| notepad" r ] As notepad.exe does not write nor read anything to the standard channels that where provided to it by Tcl in notepad's STARTUPINFO when it was launched, I don't understand why pipes are being used for this. Normally when a process is launched from wish, it is launch in a hidden and detached console (hides the new console window that would be blank anyway due to the redirection). But as notepad.exe is a GUI application, it comes to the foreground (not attached to the hidden console window) because it runs in the windows subsystem not the console subsystem. Gilles, could you explain the problem a bit more? Where is popen()? In Tcl it is TclpCreateProcess(), but are you refering to something different? Was notepad used just as a universal example, but the problem for you is with a different application? Could a "launch" command that provides a different behavior without the pipe misunderstanding be more what you desire? I'm actually surprised that [gets] is not blocking for you (or me). IMHO, the fact that tcl can knowing launch a GUI application and has the nerve to set pipes to it, is a bad behavior. Tcl read the PE header in ApplicationType(), so it could have grabbed the subsystem bit to see that it is GUI. One day, I would to see this changed. ---------------------------------------------------------------------- Comment By: Jeffrey Hobbs (hobbs) Date: 2003-01-28 01:33 Message: Logged In: YES user_id=72656 I tried this on Win2K and WinXP using the TDK2.5beta version of Tcl (8.4.1+) and don't have any problems. Has anyone seem something similar? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=672526&group_id=10894 |