From: <no...@so...> - 2002-05-29 21:15:30
|
Bugs item #410389, was opened at 2001-03-21 17:01 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=112997&aid=410389&group_id=12997 Category: 55. [grab] Group: = 8.3.2 Status: Open Resolution: None Priority: 5 Submitted By: Tupone Alfredo (atupone) Assigned to: Jeffrey Hobbs (hobbs) Summary: grab with multiple interpreter Initial Comment: I am running an application with multiple interpreter. If I make a local grab on one window in an interpreter, and I ask on another interpreter who is grabbing, it reports the name of the window the other interpreter is grabbing. This is creating a problem, particularly because the menu posting, as is in the tk library file menu.tcl, is looking for this and trying to remove the old grab on an unexisting window ---------------------------------------------------------------------- >Comment By: Don Porter (dgp) Date: 2002-05-29 17:15 Message: Logged In: YES user_id=80530 Thanks for the patch. It was reversed, and appeared to include some other unrelated stuff dealing with spinbox and a change to tkOption.c. I've removed those changes, and re-created the patch against the current core-8-3-1-branch, attached here as grab.patch. The patch does take care of the bug revealed in demo.tcl, but I'm not sure the overall approach is sound. The patch basically takes the storage of the window holding the grab out of the "display" structure and adds it to the "main window" structure. This changes it from a per-display item to a per-Tk-application item. This does avoid any problem when grab windows cross between interps, but I suspect it will introduce new problems when one interp operates on multiple displays. It will take someone more expert than I on the Tk internals to evaluate the patch more fully. Thanks for contributing though. It's a good fix for the immediate problem. ---------------------------------------------------------------------- Comment By: Tupone Alfredo (atupone) Date: 2002-05-27 14:37 Message: Logged In: YES user_id=76397 I just download a patch file that I take from my cvs with rdiff. It is gzipped! I heavily worked with that patch against the 8.3.2 version. Nothing seems changed on the affected files so I suppose it's working with the last 8.3.4. I had only some shot with the last tk version and that patch. It seems to work, too. ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2002-05-20 14:36 Message: Logged In: YES user_id=80530 That's good to hear. Is your fix available to contribute back to Tk ? ---------------------------------------------------------------------- Comment By: Tupone Alfredo (atupone) Date: 2002-05-16 15:15 Message: Logged In: YES user_id=76397 My fix to tk, outlined in the followup dated 2001-04-03 01:14, works! At least in my environment. ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2002-05-14 18:06 Message: Logged In: YES user_id=80530 I just re-discovered this problem. I'm assigning it to the [grab]-area maintainer. I'm attaching a demonstration script. Evaluate it with wish and there will be three windows. An empty root window and a [tk_getOpenFile] window from the master interp, and another root window with a "File" menu from the slave interp. The [tk_getOpenFile] widget holds a grab. Click on the "File" menu of the slave window, and and error will be reported as the slave interp tries to operate on the window reported back by [grab current], which exists in the master, not the slave. It appears that [grab] is storing the window holding the grab in a TkDisplay structure which is shared among interps. If Tk is going to assume that different interps are separate "applications" with separate widget trees, then such information should probably be kept per-interp, thus not in the TkDisplay structure. ---------------------------------------------------------------------- Comment By: Tupone Alfredo (atupone) Date: 2001-04-02 19:14 Message: Logged In: YES user_id=76397 The previous patch did not work, 'cause th display structure don't get freed when the tcl interpreter is deleted. So we got a big memory leak and we do not want. Now I'm trying to move some grab info from the display structure, to the TkMain, that is interpreter specific. In this way I do not create more Item that will not be deleted. Seems to work .... I hope ---------------------------------------------------------------------- Comment By: Tupone Alfredo (atupone) Date: 2001-03-22 11:01 Message: Logged In: YES user_id=76397 I Think I have fixed this problem inserting a field (Tcl_Interp* interp) in the TkDisplay structure. Testing and filling it in the GetScreen on file tkWindow.c ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=112997&aid=410389&group_id=12997 |