def METHOD_NAME(self, widget, event):
    if event.is_hint:
        window, x, y, state = event.window.get_pointer()
    else:
        x = event.x
        y = event.y
        state = event.get_state()
    self.motion_notify_func(x, y, state)