From 2971749b83219beb0e144eeda8c73407ede248af Mon Sep 17 00:00:00 2001 From: Sam Parkinson Date: Thu, 16 Jun 2016 09:58:55 +1000 Subject: [PATCH] Fix CursorInvoker wrongly positioning EventIcon palettes Steps to reproduce: 1. Long press on home view favorite icon (an event icon) Expected: Palette invoker where finger is Actuall: Palette invokes in top left corner This is because the long press controller emits coords relative to the widget's window, and EventIcons sometimes have their own windows. We can't change the long press controller, as it is a public api. But we fix this by translating the coords to the root window coords in the CursorInvoker. Using root coords is consistent with the right click handleing in the cursor invoker. --- src/sugar3/graphics/palettewindow.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sugar3/graphics/palettewindow.py b/src/sugar3/graphics/palettewindow.py index b2cafd87..9a5b8e2a 100644 --- a/src/sugar3/graphics/palettewindow.py +++ b/src/sugar3/graphics/palettewindow.py @@ -1381,6 +1381,7 @@ class CursorInvoker(Invoker): def __long_pressed_event_cb(self, controller, x, y, widget): self._long_pressed_recognized = True + x, y = widget.get_window().get_root_coords(x, y) self.notify_right_click(x, y) def get_toplevel(self):