[Sugar-devel] Window handling for non-Python activities
Daniel Narvaez
dwnarvaez at gmail.com
Mon Feb 25 12:50:36 EST 2013
On 25 February 2013 18:45, Daniel Drake <dsd at laptop.org> wrote:
> On Mon, Feb 25, 2013 at 11:22 AM, Daniel Drake <dsd at laptop.org> wrote:
>> How can we solve this issue? Do we need to modify all of these activities?
>>
>> Or can we improve Sugar here? If Sugar can determine the PID of the
>> new window, I guess it could observe that it is a child process of the
>> python launcher (which it is tracking) and behave better here. That
>> does sound a bit ugly though, maybe fixing the activities is nicer?
>>
>> Whatever we decide we should produce a quick wiki doc to explain how
>> these launchers should/shouldn't work.
>
> Without modifying Sugar, here's how I got such activities to behave
> (took a few tries to find a working solution).
>
> TuxPaintLauncher __init__ uses subprocess.Popen to launch TuxPaint,
> and then schedules a GTK+ exit to happen only after the launcher's
> window registration has happened.
>
> subprocess.Popen(options)
> gobject.idle_add(gtk.main_quit)
Does that only solve the "launch failed" problem or does it make them
work properly? I mean I wouldn't expect the shell to be able to show
the right icon in the frame for example, because it would not be able
to map the tux paint window to the activity.
More information about the Sugar-devel
mailing list