Follow up on wierd bug -- timing issue



I ran some more tests with Eric Mangold (he was helping me over IRC) and found that the bindings do work _if_ I put a small sleep before I call gtk.main(), which suggests that this is some sort of timing issue, maybe with the change in the pipe being detected by my app before sawfish thinks the echo is "done." But I'm not sure.

To make sure it wasn't specific to named pipes I reimplemented the same app to use signals instead, and sure enough if the shell command is "kill -s 10 myapppid" the exact same problem occurs.

teratorn ran strace and found that gtk.main() is continuing to run in the background -- it's not frozen. The issue is that the only way for gtk.main() to quit is for my menu to appear, and for the user to select something in the menu for them to click outside the menu. However, because the menu never actually appears because of this mysterious timing bug, gtk.main() just goes on forever.

dataangel wrote:

I'm working a python app right now. It persistently runs in the background, and then when the string "show-menu" is put into a named pipe called menutriggerpipe, the app reads this and has a menu popup.

If I do "echo show-menu >> menutriggerpipe" by hand in the console, this works. If I run sawfish-client and do (system "echo show-menu >> menutriggerpipe") this works. If I bind the shell command to a key in OpenBox, this works.

If I bind it to a key using either the Bindings configurer or by hand in my .sawfishrc, this does not work with sawfish. My app uses the pygtk library and will get stuck indefinitely in gtk.main() and never draw the menu for some reason if I have sawfish do the message through a binding. The message is received, and it is the correct message, but for some reason completely unbeknownst to me gtk.main() will get stuck.

At first I thought this maybe a pygtk bug, but seeing as it works by hand in the terminal, in sawfish-client, and it works as a binding in OpenBox, I figure it has to be a sawfish bug.

If someone needs my code to fix it let me know,

dataangel





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]