Ticket #4166: 0001-Ensure-__motion_notify_event_cb-was-called-before-a-.patch

File 0001-Ensure-__motion_notify_event_cb-was-called-before-a-.patch, 1.5 KB (added by humitos, 11 years ago)
  • src/sugar3/graphics/palettewindow.py

    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): 
    14391439
    14401440    def __long_pressed_event_cb(self, controller, x, y, widget):
    14411441        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())
    14421448            self.notify_right_click()
    14431449
    14441450    def point_in_cell_renderer(self, event_x, event_y):