[Bugs] #4221 sugar NORM: Hover effect stays after changing zoom views with keyboard shortcuts

Sugar Labs Bugs bugtracker-noreply at sugarlabs.org
Thu Mar 14 06:51:23 EDT 2013


#4221: Hover effect stays after changing zoom views with keyboard shortcuts
-----------------------+----------------------------------------------------
    Reporter:  erikos  |          Owner:  erikos     
        Type:  defect  |         Status:  assigned   
    Priority:  Normal  |      Milestone:  0.98       
   Component:  sugar   |        Version:  Unspecified
    Severity:  Major   |       Keywords:  regression 
Distribution:  OLPC    |   Status_field:  Assigned   
-----------------------+----------------------------------------------------

Comment(by erikos):

 For point b:

 When we use the view keys to toggle the view we do not get a popdown or a
 leave event for the canvas icon in order to clear the state. In the logs
 we do get:

 {{{
 1363257990.450653 DEBUG root: _key_pressed_cb: 68 0 F2
 1363257990.456624 DEBUG root: new zoom level: 1
 Traceback (most recent call last):
   File "/home/erikos/sugar-build/install/lib/python2.7/site-
 packages/sugar3/graphics/animator.py", line 107, in _next_frame_cb
     animation.do_frame(current_time, self._duration, self._easing)
   File "/home/erikos/sugar-build/install/lib/python2.7/site-
 packages/sugar3/graphics/animator.py", line 148, in do_frame
     self.next_frame(frame)
   File "/home/erikos/sugar-build/install/lib/python2.7/site-
 packages/sugar3/graphics/palettewindow.py", line 739, in next_frame
     self._palette.popup(immediate=True)
   File "/home/erikos/sugar-build/install/lib/python2.7/site-
 packages/sugar3/graphics/palette.py", line 207, in popup
     PaletteWindow.popup(self, immediate)
   File "/home/erikos/sugar-build/install/lib/python2.7/site-
 packages/sugar3/graphics/palettewindow.py", line 626, in popup
     self._widget.set_transient_for(self._invoker.get_toplevel())
   File "/usr/lib64/python2.7/site-packages/gi/types.py", line 47, in
 function
     return info.invoke(*args, **kwargs)
 TypeError: argument parent: Expected Gtk.Window, but got
 jarabe.desktop.homebox.HomeBox
 }}}

 I guess we can cover the case where we can not call "set_transient_for"
 for the Palette and in that case emit a 'popdown' signal. This can be
 handled by the canvas icon to clear the state.

 {{{
 diff --git a/src/sugar3/graphics/palettewindow.py
 b/src/sugar3/graphics/palettewindow.py
 index c48ae55..524fb03 100644
 --- a/src/sugar3/graphics/palettewindow.py
 +++ b/src/sugar3/graphics/palettewindow.py
 @@ -623,7 +623,11 @@ class PaletteWindow(GObject.GObject):
              self._alignment =
 self._invoker.get_alignment(full_size_request)

              self.update_position()
 -            self._widget.set_transient_for(self._invoker.get_toplevel())
 +            try:
 +
 self._widget.set_transient_for(self._invoker.get_toplevel())
 +            except TypeEror:
 +                self.emit('popdown')
 +                return

          self._popdown_anim.stop()
 }}}

 (we should add a comment here in the code explaining the whys)

-- 
Ticket URL: <http://bugs.sugarlabs.org/ticket/4221#comment:10>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system


More information about the Bugs mailing list