Try to handle the case when the frame cover the activity window.
This commit is contained in:
parent
7fd05154d3
commit
3b57c5f247
@ -161,17 +161,21 @@ 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 \
|
|
||||||
not self.get_frame().visible:
|
|
||||||
self.take_activity_screenshot()
|
self.take_activity_screenshot()
|
||||||
|
|
||||||
if level == ShellModel.ZOOM_ACTIVITY:
|
if level == ShellModel.ZOOM_ACTIVITY:
|
||||||
|
@ -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()
|
||||||
|
Loading…
Reference in New Issue
Block a user