[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:25:23 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
------------------------------------------+---------------------------------
Comment(by erikos):
Actually, the second option is to just not cache the dimensions:
{{{
diff --git a/src/sugar3/graphics/palettewindow.py
b/src/sugar3/graphics/palettewindow.py
index c48ae55..67a4407 100644
--- a/src/sugar3/graphics/palettewindow.py
+++ b/src/sugar3/graphics/palettewindow.py
@@ -777,8 +777,6 @@ class Invoker(GObject.GObject):
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()
self._position_hint = self.ANCHORED
self._cursor_x = -1
self._cursor_y = -1
@@ -841,8 +839,8 @@ class Invoker(GObject.GObject):
def _in_screen(self, rect):
return rect.x >= self._screen_area.x and \
rect.y >= self._screen_area.y and \
- rect.x + rect.width <= self._screen_area.width and \
- rect.y + rect.height <= self._screen_area.height
+ rect.x + rect.width <= Gdk.Screen.width() and \
+ rect.y + rect.height <= Gdk.Screen.height()
def _get_area_in_screen(self, rect):
"""Return area of rectangle visible in the screen"""
@@ -850,9 +848,9 @@ class Invoker(GObject.GObject):
x1 = max(rect.x, self._screen_area.x)
y1 = max(rect.y, self._screen_area.y)
x2 = min(rect.x + rect.width,
- self._screen_area.x + self._screen_area.width)
+ self._screen_area.x + Gdk.Screen.width())
y2 = min(rect.y + rect.height,
- self._screen_area.y + self._screen_area.height)
+ self._screen_area.y + Gdk.Screen.height())
return (x2 - x1) * (y2 - y1)
@@ -882,8 +880,8 @@ class Invoker(GObject.GObject):
rect.x = max(0, rect.x)
rect.y = max(0, rect.y)
- rect.x = min(rect.x, self._screen_area.width - rect.width)
- rect.y = min(rect.y, self._screen_area.height - rect.height)
+ rect.x = min(rect.x, Gdk.Screen.width() - rect.width)
+ rect.y = min(rect.y, Gdk.Screen.height() - rect.height)
return rect
}}}
I think I prefer that one.
--
Ticket URL: <http://bugs.sugarlabs.org/ticket/4419#comment:4>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system
More information about the Bugs
mailing list