[Sugar-devel] [PATCH sugar] Fallback to _NET_WM_PID to map windows to activities

Daniel Drake dsd at laptop.org
Tue Apr 30 18:27:00 EDT 2013


Thanks, this can be used to fix the problem detailed in my mail
"Window handling for non-Python activities"

I have tested it.


On Sat, Feb 2, 2013 at 6:18 AM, Daniel Narvaez <dwnarvaez at gmail.com> wrote:
> -    def get_type(self):
> +    def get_bundle_id(self):
>          """Retrieve the activity bundle id for future reference"""
> -        if not self._windows:
> -            return None
> -        else:
> -            return SugarExt.wm_get_bundle_id(self._windows[0].get_xid())
> +        self._bundle_id

Missing return statement here?


> diff --git a/src/jarabe/view/service.py b/src/jarabe/view/service.py
> index 61b3d59..c7187c7 100644
> --- a/src/jarabe/view/service.py
> +++ b/src/jarabe/view/service.py
> @@ -80,9 +80,9 @@ class UIService(dbus.service.Object):
>          return False
>
>      @dbus.service.method(_DBUS_SHELL_IFACE,
> -                         in_signature='ss', out_signature='')
> -    def NotifyLaunch(self, bundle_id, activity_id):
> -        shell.get_model().notify_launch(activity_id, bundle_id)
> +                         in_signature='ssi', out_signature='')
> +    def NotifyLaunch(self, bundle_id, activity_id, pid):
> +        shell.get_model().notify_launch(activity_id, bundle_id, pid)

This is an API change. The toolkit calls this method so it must be
updated as well, otherwise activity launch breaks. And I guess we
might have broken compatibility with some other things like etoys.

I wonder if we can avoid this API change - can the receiver of the
dbus message look up the PID of the sender? Some possible clues here:
http://lists.freedesktop.org/archives/dbus/2008-September/010403.html


More information about the Sugar-devel mailing list