Try to handle the case when the frame cover the activity window.

This commit is contained in:
Marco Pesenti Gritti 2007-10-23 15:49:19 +02:00
parent 7fd05154d3
commit 3b57c5f247
2 changed files with 11 additions and 5 deletions

View File

@ -161,18 +161,22 @@ class Shell(gobject.GObject):
activityfactory.create(activity_type) activityfactory.create(activity_type)
def take_activity_screenshot(self): def take_activity_screenshot(self):
if self._model.get_zoom_level() != ShellModel.ZOOM_ACTIVITY:
return
if self.get_frame().visible:
return
home_model = self._model.get_home() home_model = self._model.get_home()
service = home_model.get_active_activity().get_service() activity = home_model.get_active_activity()
service.TakeScreenshot() if activity:
activity.get_service().TakeScreenshot()
def set_zoom_level(self, level): def set_zoom_level(self, level):
old_level = self._model.get_zoom_level() old_level = self._model.get_zoom_level()
if level == old_level: if level == old_level:
return return
if old_level == ShellModel.ZOOM_ACTIVITY and \ self.take_activity_screenshot()
not self.get_frame().visible:
self.take_activity_screenshot()
if level == ShellModel.ZOOM_ACTIVITY: if level == ShellModel.ZOOM_ACTIVITY:
if self._pending_host is not None: if self._pending_host is not None:

View File

@ -184,6 +184,8 @@ class Frame(object):
if self._animator: if self._animator:
self._animator.stop() self._animator.stop()
self._shell.take_activity_screenshot()
self._animator = animator.Animator(0.5) self._animator = animator.Animator(0.5)
self._animator.add(_Animation(self, 1.0)) self._animator.add(_Animation(self, 1.0))
self._animator.start() self._animator.start()