[Bugs] #4343 sugar URGE: Timeout to get the palette 'feels' really long

Sugar Labs Bugs bugtracker-noreply at sugarlabs.org
Mon Mar 25 16:08:26 EDT 2013


#4343: Timeout to get the palette 'feels' really long
----------------------------+-----------------------------------------------
    Reporter:  humitos      |          Owner:  erikos            
        Type:  defect       |         Status:  new               
    Priority:  Urgent       |      Milestone:  0.98              
   Component:  sugar        |        Version:  Unspecified       
    Severity:  Unspecified  |       Keywords:  13.1.0, regression
Distribution:  Unspecified  |   Status_field:  Unconfirmed       
----------------------------+-----------------------------------------------

Comment(by erikos):

 The coordinates we are passing from the PaletteMenu when the Palettes is
 up are global ones, we need to map them to the treeview first.

 {{{
 diff --git a/src/sugar3/graphics/palettewindow.py
 b/src/sugar3/graphics/palettewindow.py
 index 995e258..a0581a8 100644
 --- a/src/sugar3/graphics/palettewindow.py
 +++ b/src/sugar3/graphics/palettewindow.py
 @@ -221,7 +221,7 @@ class _PaletteMenuWidget(Gtk.Menu):
          y = event.y_root

          if type(self._invoker) is CellRendererInvoker:
 -            in_invoker = self._invoker.point_in_cell_renderer(x, y)
 +            in_invoker = self._invoker.point_in_cell_renderer()
          else:
              rect = self._invoker.get_rect()
              in_invoker = x >= rect.x and x < (rect.x + rect.width) \
 @@ -1465,8 +1465,11 @@ class CellRendererInvoker(Invoker):
          if self.point_in_cell_renderer(x, y):
              self.notify_right_click()

 -    def point_in_cell_renderer(self, event_x, event_y):
 -        pos = self._tree_view.get_path_at_pos(int(event_x), int(event_y))
 +    def point_in_cell_renderer(self, x=None, y=None):
 +        if x is None and y is None:
 +            x, y = self._tree_view.get_pointer()
 +            x, y = self._tree_view.convert_widget_to_bin_window_coords(x,
 y)
 +        pos = self._tree_view.get_path_at_pos(int(x), int(y))
          if pos is None:
              return False
 }}}

 The effect can be seen, in a Journal with less entries than fit in the
 page, when moving the mouse out of the activity icon towards the bottom
 the Palette will stay up without this patch.

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


More information about the Bugs mailing list