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.
This commit is contained in:
Sam Parkinson 2016-06-16 09:58:55 +10:00
parent 0f4309a324
commit 2971749b83
No known key found for this signature in database
GPG Key ID: 34E268B2FA2F8B13

View File

@ -1381,6 +1381,7 @@ class CursorInvoker(Invoker):
def __long_pressed_event_cb(self, controller, x, y, widget): def __long_pressed_event_cb(self, controller, x, y, widget):
self._long_pressed_recognized = True self._long_pressed_recognized = True
x, y = widget.get_window().get_root_coords(x, y)
self.notify_right_click(x, y) self.notify_right_click(x, y)
def get_toplevel(self): def get_toplevel(self):