Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Description
Bug summary
Double Click is not getting recognized asTrue
inMouseEvent.dblclick
.
I see them as two separate single clicks but the second one'sMouseEvent.dblclick
is False in MPL 3.5.1. It works fine on 3.5.0 and 3.4.3.
Code for reproduction
Actual code is here inVisualQC
CLI instructions to reproduce from this codebase are rather complicated needing a lot of setup, unfortunately. But the simplest example to reproduce is here:
frommatplotlibimportpyplotaspltimportnumpyasnpdefonclick(event):print('MouseEvent: button value {} name {} dblclk: {}'''.format(event.button.value,event.button.name,event.dblclick))fig,ax=plt.subplots()ax.plot(np.random.rand(10))cid=fig.canvas.mpl_connect('button_press_event',onclick)fig.canvas.manager.show()fig.canvas.draw_idle()# starting a 'blocking' loop to let the user interactfig.canvas.start_event_loop(timeout=-1)fig.canvas.mpl_disconnect(cid)
Actual outcome
< single click >
MouseEvent: button value 1 name LEFT dblclk:
< right click >
MouseEvent: button value 3 name RIGHT dblclk:
< double click with trackpad on MacBook pro >
MouseEvent: button value 1 name LEFT dblclk:
MouseEvent: button value 1 name LEFT dblclk:
< right click >
MouseEvent: button value 3 name RIGHT dblclk:
< double click external mouse >
MouseEvent: button value 1 name LEFT dblclk:
MouseEvent: button value 1 name LEFT dblclk:
Expected outcome
% single click
MouseEvent: button value 1 name LEFT dblclk: False
< right click >
MouseEvent: button value 3 name RIGHT dblclk: False
< double click with trackpad on MacBook pro >
MouseEvent: button value 2 name LEFT dblclk: True
< right click >
MouseEvent: button value 3 name RIGHT dblclk: False
< double click external mouse >
MouseEvent: button value 2 name LEFT dblclk: True
Additional information
numpy 1.17.4 / scipy 1.1.0 / matplotlib 3.5.1
python 3.7.2 (default, Dec 29 2018, 00:00:04)
[Clang 4.0.1 (tags/RELEASE_401/final)]
platform Darwin-21.3.0-x86_64-i386-64bit
Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_X86_64
Operating system
MacOS Darwin-21.3.0
Matplotlib Version
3.5.1
Matplotlib Backend
TkAgg
Python version
3.7.2
Jupyter version
No response
Installation
pip