#2159 NORM Trial-3: Journal should be the active activity at boot

Zarro Boogs per Child bugtracker at laptop.org
Thu Aug 2 09:06:56 EDT 2007


#2159: Journal should be the active activity at boot
---------------------+------------------------------------------------------
  Reporter:  Eben    |       Owner:  marco  
      Type:  defect  |      Status:  new    
  Priority:  normal  |   Milestone:  Trial-3
 Component:  sugar   |     Version:         
Resolution:          |    Keywords:  review?
  Verified:  0       |  
---------------------+------------------------------------------------------
Comment (by marco):

 {{{
 +    def _set_current_activity(self, new_activity, notify_activity):
 }}}

 While we are at it, can you please rename this and the property to
 set_active_activity?

 {{{
      def present(self):
 -        self._window.activate(gtk.get_current_event_time())
 +        self._window.activate(1)

      def close(self):
 -        self._window.close(gtk.get_current_event_time())
 +        self._window.close(1)

 }}}

 Please add a comment about why we are passing in 1 here.

 {{{
 +            if not self._current_host is None:
 +                self._current_host.present()
 }}}

 I think we are generally using is not None rather than not [something] is
 None.

 {{{
 +            if self._current_activity is None:
 +                self._set_current_activity(activity, False)
 }}}

 Why we are not notifying the activity here? To avoid a double notification
 for activities which doesn't startup iconified? Though ideally the Journal
 would get the set_active too.

 {{{
 +        if window.get_window_type() == wnck.WINDOW_DESKTOP:
 +            # HomeWindow is on top, so make the window below it current
 +            windows = screen.get_windows_stacked()
 +            windows.reverse()
 +            for window in windows:
 +                activity = self._get_activity_by_xid(window.get_xid())
 +                if not activity is None:
 +                    self._set_current_activity(activity, False)
 +                    return
 +            self._set_current_activity(None, False)
 }}}

 Same question as above. Are we trying to avoid double set_active when
 zooming out to Home? In the activity close case we want to do a set_active
 though.

 Can you please clarify the two cases above? If we are trying to avoid
 double set_active maybe the easier solution would be to add a set_active
 method on HomeActivity which tracks the current active state and notify
 the service only when necessary. With such a check in place I think the
 whole logic in _active_window_changed_cb could be reduced to a search down
 the windows stack.

-- 
Ticket URL: <http://dev.laptop.org/ticket/2159#comment:3>
One Laptop Per Child <http://laptop.org/>



More information about the Bugs mailing list