Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorReinier Heeres <reinier@heeres.eu>2007-11-22 10:57:44 (GMT)
committer Reinier Heeres <reinier@heeres.eu>2007-11-22 10:57:44 (GMT)
commitb876648bd616fa57b0e3c8050af46bb1c6268e75 (patch)
tree046db655e2e2b2c888ca39a6f9d5d3ff054d0a16 /shell
parent82e61c6747c40ea4ae1c65510cd9e4740719bafa (diff)
Remove activities from donut after not succesfully launched after 1.5min, #4612
Diffstat (limited to 'shell')
-rw-r--r--shell/model/homemodel.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/shell/model/homemodel.py b/shell/model/homemodel.py
index d6f6764..2441dbc 100644
--- a/shell/model/homemodel.py
+++ b/shell/model/homemodel.py
@@ -263,6 +263,10 @@ class HomeModel(gobject.GObject):
home_activity.props.launching = True
self._add_activity(home_activity)
+ # FIXME: better learn about finishing processes by receiving a signal.
+ # Now just check whether an activity has a window after ~90sec
+ gobject.timeout_add(90000, self._check_activity_launched, activity_id)
+
def notify_activity_launch_failed(self, activity_id):
home_activity = self._get_activity_by_id(activity_id)
if home_activity:
@@ -270,3 +274,9 @@ class HomeModel(gobject.GObject):
self._remove_activity(home_activity)
else:
logging.error('Model for activity id %s does not exist.' % activity_id)
+
+ def _check_activity_launched(self, activity_id):
+ home_activity = self._get_activity_by_id(activity_id)
+ if home_activity and home_activity.props.launching:
+ logging.debug('Activity %s still launching, assuming it failed...', activity_id)
+ self.notify_activity_launch_failed(activity_id)