bug report: motion_notify_event in backend_gtk.py

I agree, the if clause should not be there, and have removed it from
cvs. If the state information is required it should be passed as an
argument to FigureCanvasBase.motion_notify_event() , like x and y are.

Regards
Steve

Send instant messages to your online friends http://au.messenger.yahoo.com

···

On Wed, 2005-07-20 at 20:27 -0700, matplotlib-users-request@lists.sourceforge.net wrote:

Hello everyone,

I just upgraded my matplotlib from 0.80 to to 0.83.1 and discovered a bug in the GTK backend. To be specific, the following code, beginning by line 171 in backend_gtk.py, is the problem:

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

        # flipy so y=0 is bottom of canvas
        y = self.figure.bbox.height() - y

        if state:
            FigureCanvasBase.motion_notify_event(self, x, y)
        return True

Due to the 'if state' clause, the Canvas will only receive the 'motion_notify_event' if at the same time the mouse button is pressed. This has not been the case in previous version of matplotlib. There is e.g. no such distinction in backend_qt.py.

Regards,

Niklas Volbers.