[Sugar-devel] [PATCH sugar-toolkit-gtk3] Pass the activity process pid to NotifyLaunch

Daniel Narvaez dwnarvaez at gmail.com
Sat Feb 2 07:19:41 EST 2013


From: Daniel Narvaez <dwnarvaez at gmail.com>

This will be used by the shell to map the windows to their
activity_id without requiring custom window properties.
---
 src/sugar3/activity/activityfactory.py | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/sugar3/activity/activityfactory.py b/src/sugar3/activity/activityfactory.py
index d544cd0..53195c8 100644
--- a/src/sugar3/activity/activityfactory.py
+++ b/src/sugar3/activity/activityfactory.py
@@ -211,11 +211,6 @@ class ActivityCreationHandler(GObject.GObject):
         if self._handle.activity_id is None:
             self._handle.activity_id = create_activity_id()
 
-        self._shell.NotifyLaunch(
-                    self._service_name, self._handle.activity_id,
-                    reply_handler=self._no_reply_handler,
-                    error_handler=self._notify_launch_error_handler)
-
         environ = get_environment(self._bundle)
         (log_path, log_file) = open_log_file(self._bundle)
         command = get_command(self._bundle, self._handle.activity_id,
@@ -258,6 +253,13 @@ class ActivityCreationHandler(GObject.GObject):
             stdout=log_file.fileno(),
             stderr=log_file.fileno())
 
+        self._shell.NotifyLaunch(
+                    self._service_name,
+                    self._handle.activity_id,
+                    child.pid,
+                    reply_handler=self._no_reply_handler,
+                    error_handler=self._notify_launch_error_handler)
+ 
         GObject.child_watch_add(child.pid,
                                 _child_watch_cb,
                                 (environment_dir, log_file,
-- 
1.8.1



More information about the Sugar-devel mailing list