From b87b375bf7a67faad1ad4d5480388286ccc99716 Mon Sep 17 00:00:00 2001 From: Bert Freudenberg Date: Tue, 17 Jul 2007 07:34:03 +0200 Subject: [PATCH] make set_active() asynchronous (fix for 2230) --- shell/model/homemodel.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/shell/model/homemodel.py b/shell/model/homemodel.py index e935f660..7d1039b1 100644 --- a/shell/model/homemodel.py +++ b/shell/model/homemodel.py @@ -132,12 +132,22 @@ class HomeModel(gobject.GObject): if old_activity: service = old_activity.get_service() if service: - service.set_active(False) + service.set_active(False, + reply_handler=self._set_active_success, + error_handler=self._set_active_error) if new_activity: service = new_activity.get_service() if service: - service.set_active(True) + service.set_active(True, + reply_handler=self._set_active_success, + error_handler=self._set_active_error) + + def _set_active_success(self): + pass + + def _set_active_error(self, err): + logging.error("set_active() failed: %s" % err) def _active_window_changed_cb(self, screen): window = screen.get_active_window()