[Bugs] #4419 sugar UNSP: Bottom-frame icons (Network, Battery, Sound etc.) not working on XO-4 (build 28), in ebook-portrait mode

Sugar Labs Bugs bugtracker-noreply at sugarlabs.org
Tue Feb 19 07:20:08 EST 2013


#4419: Bottom-frame icons (Network, Battery,Sound etc.) not working on XO-4 (build
28), in ebook-portrait mode
------------------------------------------+---------------------------------
    Reporter:  ajay_garg                  |          Owner:  erikos     
        Type:  defect                     |         Status:  new        
    Priority:  Unspecified by Maintainer  |      Milestone:  0.98       
   Component:  sugar                      |        Version:  0.98.x     
    Severity:  Unspecified                |       Keywords:  r?         
Distribution:  Fedora                     |   Status_field:  Unconfirmed
------------------------------------------+---------------------------------
Changes (by erikos):

  * keywords:  => r?


Comment:

 The following does update the cached screen width and height variables
 when the screen dimensions change.

 {{{
 diff --git a/src/sugar3/graphics/palettewindow.py
 b/src/sugar3/graphics/palettewindow.py
 index c48ae55..7fe850d 100644
 --- a/src/sugar3/graphics/palettewindow.py
 +++ b/src/sugar3/graphics/palettewindow.py
 @@ -775,10 +775,13 @@ class Invoker(GObject.GObject):

          self.parent = None

 +
          self._screen_area = Gdk.Rectangle()
          self._screen_area.x = self._screen_area.y = 0
 -        self._screen_area.width = Gdk.Screen.width()
 -        self._screen_area.height = Gdk.Screen.height()
 +        screen = Gdk.Screen.get_default()
 +        screen.connect('size-changed', self.__size_changed_cb)
 +        self._set_dimensions()
 +
          self._position_hint = self.ANCHORED
          self._cursor_x = -1
          self._cursor_y = -1
 @@ -797,6 +800,13 @@ class Invoker(GObject.GObject):
              self._palette.destroy()
              self._palette = None

 +    def __size_changed_cb(self, screen):
 +        self._set_dimensions()
 +
 +    def _set_dimensions(self):
 +        self._screen_area.width = Gdk.Screen.width()
 +        self._screen_area.height = Gdk.Screen.height()
 +
      def _get_position_for_alignment(self, alignment, palette_dim):
          palette_halign = alignment[0]
          palette_valign = alignment[1]
 }}}

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


More information about the Bugs mailing list