Make Journal active at startup. #2159
Also distinguish between "active" in the sense of "the user is actually using this activity" and "active" in the sense of "the activity would be active *if* the user switched to Activity view". It's the latter sense, now called "pending" that the Journal is in at startup. Pending is also used for the next-up activity when you quit the current active activity.
This commit is contained in:
@@ -47,6 +47,7 @@ class Shell(gobject.GObject):
|
||||
self._hosts = {}
|
||||
self._screen = wnck.screen_get_default()
|
||||
self._current_host = None
|
||||
self._pending_host = None
|
||||
self._screen_rotation = 0
|
||||
|
||||
self._key_handler = KeyHandler(self)
|
||||
@@ -65,6 +66,8 @@ class Shell(gobject.GObject):
|
||||
home_model.connect('activity-removed', self._activity_removed_cb)
|
||||
home_model.connect('active-activity-changed',
|
||||
self._active_activity_changed_cb)
|
||||
home_model.connect('pending-activity-changed',
|
||||
self._pending_activity_changed_cb)
|
||||
|
||||
# Unfreeze the display when it's stable
|
||||
hw_manager = hardwaremanager.get_manager()
|
||||
@@ -100,6 +103,12 @@ class Shell(gobject.GObject):
|
||||
|
||||
self._current_host = host
|
||||
|
||||
def _pending_activity_changed_cb(self, home_model, home_activity):
|
||||
if home_activity:
|
||||
self._pending_host = self._hosts[home_activity.get_xid()]
|
||||
else:
|
||||
self._pending_host = None
|
||||
|
||||
def get_model(self):
|
||||
return self._model
|
||||
|
||||
@@ -156,6 +165,8 @@ class Shell(gobject.GObject):
|
||||
return
|
||||
|
||||
if level == ShellModel.ZOOM_ACTIVITY:
|
||||
if self._pending_host is not None:
|
||||
self._pending_host.present()
|
||||
self._screen.toggle_showing_desktop(False)
|
||||
else:
|
||||
self._model.set_zoom_level(level)
|
||||
|
||||
@@ -189,7 +189,7 @@ class ActivitiesDonut(hippo.CanvasBox, hippo.CanvasItem):
|
||||
self._model = shell.get_model().get_home()
|
||||
self._model.connect('activity-added', self._activity_added_cb)
|
||||
self._model.connect('activity-removed', self._activity_removed_cb)
|
||||
self._model.connect('active-activity-changed', self._activity_changed_cb)
|
||||
self._model.connect('pending-activity-changed', self._activity_changed_cb)
|
||||
|
||||
self.connect('button-release-event', self._button_release_event_cb)
|
||||
|
||||
@@ -385,7 +385,7 @@ class ActivitiesDonut(hippo.CanvasBox, hippo.CanvasItem):
|
||||
cr.fill()
|
||||
|
||||
# Selected Wedge
|
||||
current_activity = self._model.get_current_activity()
|
||||
current_activity = self._model.get_pending_activity()
|
||||
if current_activity is not None:
|
||||
selected_index = self._model.index(current_activity)
|
||||
[angle_start, angle_end] = self._get_angles(selected_index)
|
||||
|
||||
Reference in New Issue
Block a user