A minor goofup :: this is a "sugar-toolkit-gtk3" patch, and not a "sugar" patch.<br><br>Sorry for being an idiot.<br><br><div class="gmail_quote">On Wed, Mar 6, 2013 at 6:00 PM, Ajay Garg <span dir="ltr"><<a href="mailto:ajay@activitycentral.com" target="_blank">ajay@activitycentral.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The solution has been build upon the "no-caching" solution provided by erikos at<br>
<a href="http://bugs.sugarlabs.org/ticket/4419#comment:4" target="_blank">http://bugs.sugarlabs.org/ticket/4419#comment:4</a><br>
<br>
Theerafter, the cause of <a href="http://bugs.sugarlabs.org/attachment/ticket/3833/Screenshot%20of%20_Journal_.png" target="_blank">http://bugs.sugarlabs.org/attachment/ticket/3833/Screenshot%20of%20_Journal_.png</a><br>
is not taking "style.GRID_CELL_SIZE" into account, when calucating the alignments for the palettes.<br>
<br>
I will have to thank manuq a great deal, for his comment <a href="http://bugs.sugarlabs.org/ticket/3833#comment:11" target="_blank">http://bugs.sugarlabs.org/ticket/3833#comment:11</a>,<br>
which helped me debug the real issue.<br>
In particular, his observation that the "landscape"-mode-obscurity occurs only in one of the erikos' solutions;<br>
while the "portrait-mode-obscurity" occurs only in both of erikos's solutions.<br>
<br>
Finally, this patch provides the no-obscurity solution for all cases :)<br>
<br>
<br>
src/sugar3/graphics/palettewindow.py | 18 ++++++++----------<br>
1 file changed, 8 insertions(+), 10 deletions(-)<br>
<br>
diff --git a/src/sugar3/graphics/palettewindow.py b/src/sugar3/graphics/palettewindow.py<br>
index c48ae55..e192a7c 100644<br>
--- a/src/sugar3/graphics/palettewindow.py<br>
+++ b/src/sugar3/graphics/palettewindow.py<br>
@@ -777,8 +777,6 @@ class Invoker(GObject.GObject):<br>
<br>
self._screen_area = Gdk.Rectangle()<br>
self._screen_area.x = self._screen_area.y = 0<br>
- self._screen_area.width = Gdk.Screen.width()<br>
- self._screen_area.height = Gdk.Screen.height()<br>
self._position_hint = self.ANCHORED<br>
self._cursor_x = -1<br>
self._cursor_y = -1<br>
@@ -841,8 +839,8 @@ class Invoker(GObject.GObject):<br>
def _in_screen(self, rect):<br>
return rect.x >= self._screen_area.x and \<br>
rect.y >= self._screen_area.y and \<br>
- rect.x + rect.width <= self._screen_area.width and \<br>
- rect.y + rect.height <= self._screen_area.height<br>
+ rect.x + rect.width <= (Gdk.Screen.width() - style.GRID_CELL_SIZE) and \<br>
+ rect.y + rect.height <= (Gdk.Screen.height() - style.GRID_CELL_SIZE)<br>
<br>
def _get_area_in_screen(self, rect):<br>
"""Return area of rectangle visible in the screen"""<br>
@@ -850,9 +848,9 @@ class Invoker(GObject.GObject):<br>
x1 = max(rect.x, self._screen_area.x)<br>
y1 = max(rect.y, self._screen_area.y)<br>
x2 = min(rect.x + rect.width,<br>
- self._screen_area.x + self._screen_area.width)<br>
+ self._screen_area.x + Gdk.Screen.width() - style.GRID_CELL_SIZE)<br>
y2 = min(rect.y + rect.height,<br>
- self._screen_area.y + self._screen_area.height)<br>
+ self._screen_area.y + Gdk.Screen.height() - style.GRID_CELL_SIZE)<br>
<br>
return (x2 - x1) * (y2 - y1)<br>
<br>
@@ -882,8 +880,8 @@ class Invoker(GObject.GObject):<br>
rect.x = max(0, rect.x)<br>
rect.y = max(0, rect.y)<br>
<br>
- rect.x = min(rect.x, self._screen_area.width - rect.width)<br>
- rect.y = min(rect.y, self._screen_area.height - rect.height)<br>
+ rect.x = min(rect.x, Gdk.Screen.width() - style.GRID_CELL_SIZE - rect.width)<br>
+ rect.y = min(rect.y, Gdk.Screen.height()- style.GRID_CELL_SIZE - rect.height)<br>
<br>
return rect<br>
<br>
@@ -913,7 +911,7 @@ class Invoker(GObject.GObject):<br>
<br>
if best_alignment in self.LEFT or best_alignment in self.RIGHT:<br>
dtop = rect.y - screen_area.y<br>
- dbottom = screen_area.y + screen_area.height - rect.y - rect.width<br>
+ dbottom = screen_area.y + Gdk.Screen.height() - style.GRID_CELL_SIZE - rect.y - rect.width<br>
<br>
iv = 0<br>
<br>
@@ -928,7 +926,7 @@ class Invoker(GObject.GObject):<br>
<br>
elif best_alignment in self.TOP or best_alignment in self.BOTTOM:<br>
dleft = rect.x - screen_area.x<br>
- dright = screen_area.x + screen_area.width - rect.x - rect.width<br>
+ dright = screen_area.x + Gdk.Screen.width() - style.GRID_CELL_SIZE - rect.x - rect.width<br>
<br>
ih = 0<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
1.7.11.7<br>
<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><font face="arial, sans-serif">Regards,<br><br>Ajay Garg</font><br style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><font face="arial, sans-serif">Dextrose Developer</font><br style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Activity Central: </span><a href="http://activitycentral.com/" style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)" target="_blank">http://activitycentral.com</a>