From e6dc923770d02176c48c8dbf48e01f38de0d0aa6 Mon Sep 17 00:00:00 2001
From: Manuel Kaufmann <humitos@gmail.com>
Date: Mon, 3 Dec 2012 10:22:55 -0300
Subject: [PATCH sugar-toolkit-gtk3] Ensure __motion_notify_event_cb was
called before a LongPress SL #4166
Using touch is possible to call '__long_pressed_event_cb' without a
call to '__motion_notify_event_cb'. In this case this is a problem
because the variable 'self.path' is properly set in
'__motion_notify_event_cb' and it's needed on
'__long_pressed_event_cb'.
This patch calls '__motion_notify_event_cb' in the case that
'self.path' is 'None'.
Signed-off-by: Manuel Kaufmann <humitos@gmail.com>
---
src/sugar3/graphics/palettewindow.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/sugar3/graphics/palettewindow.py b/src/sugar3/graphics/palettewindow.py
index 7063681..27de0d0 100644
a
|
b
|
class CellRendererInvoker(Invoker): |
1439 | 1439 | |
1440 | 1440 | def __long_pressed_event_cb(self, controller, x, y, widget): |
1441 | 1441 | if self.point_in_cell_renderer(x, y): |
| 1442 | # This is because it's possible that |
| 1443 | # __long_pressed_event_cb be called before calling |
| 1444 | # __motion_notify_event_cb, where self.path is properly |
| 1445 | # set |
| 1446 | if self.path is None: |
| 1447 | self.__motion_notify_event_cb(widget, Gtk.get_current_event()) |
1442 | 1448 | self.notify_right_click() |
1443 | 1449 | |
1444 | 1450 | def point_in_cell_renderer(self, event_x, event_y): |