Opened 11 years ago

Closed 9 years ago

#4343 closed defect (fixed)

Journal:Timeout to get the palette 'feels' really long

Reported by: humitos Owned by: erikos
Priority: High Milestone: Unspecified
Component: Sugar Version: Unspecified
Severity: Unspecified Keywords: 13.1.0, regression
Cc: humitos, manuq, dsd Distribution/OS: Unspecified
Bug Status: Unconfirmed

Description (last modified by humitos)

Steps to reproduce it:

  1. Go to the Journal
  2. Move the mouse all around the icons (second column) -> hovering on many of them
    • at this time you will notice that the gray background is not shown on the icons
  3. Stop the cursor on one of them
  4. Wait...
  5. The palette appears

Issue:

The time that you have to wait is really long (up to 15 second in my case). This time increases if you move the mouse a lot over the icons.

Expected behaviour:

Spend just 0.5 seconds like in Home View

Environment:

XO-4 13.1.0 build 19

Change History (16)

comment:1 Changed 11 years ago by humitos

I noticed this while I was testing #4276

comment:2 Changed 11 years ago by humitos

  • Description modified (diff)

Changed 11 years ago by humitos

comment:3 Changed 11 years ago by humitos

I attached the shell.log.

I started moving the mouse at

1355775959.985861 DEBUG root: ListView.update_dates

and I moved it for around 20 secs aprox. The palette appeared at:

1355776044.317999 DEBUG root: visibility_notify_event_cb

So, it took 65 aprox:

>>> 1355776044.317999 - 1355775959.985861 - 20
64.33213782310486

comment:4 Changed 11 years ago by dsd

  • Cc dsd added
  • Milestone changed from Unspecified by Release Team to 0.98

comment:5 Changed 11 years ago by manuq

1 to 4 are improvement patches for the method that checks if the mouse pointer is inside the cell. By the way, Simon and I found that the bottle-neck is in another place. Comment self.notify_mouse_enter() in CellRendererInvoker.motion_notify_event_cb to see.

comment:6 Changed 11 years ago 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.

comment:7 Changed 11 years ago by dnarvaez

  • Milestone changed from 0.98 to Unspecified

comment:8 Changed 11 years ago by dnarvaez

  • Priority changed from Urgent to Normal

comment:9 Changed 10 years ago by godiard

  • Summary changed from Timeout to get the palette 'feels' really long to Journal:Timeout to get the palette 'feels' really long

comment:10 Changed 10 years ago by godiard

  • Priority changed from Normal to High

comment:11 Changed 9 years ago by godiard

  • Resolution set to fixed
  • Status changed from new to closed

This issue was solved with the optimizations described here http://wiki.sugarlabs.org/go/Features/Optimize_TreeViews

Note: See TracTickets for help on using tickets.