DearPyGui icon indicating copy to clipboard operation
DearPyGui copied to clipboard

Right-clicking context menu that appears when you right-click legend causes modal window to close without warning

Open my1e5 opened this issue 2 years ago • 0 comments

If I have a plot in a modal window, and if I right-click the legend in a certain way it causes the modal window to close without warning or any error messages.

I think I've worked out the exact sequence of clicks that causes the bug. If you right-click the legend once, then right-click the empty context menu that appears (but specifically at a location that overlaps with the legend underneath) then right-click anywhere else in the viewport (that isn't the context menu), the modal window will close without warning.

image

Code

import dearpygui.dearpygui as dpg
dpg.create_context()

def show_plot():
    with dpg.window(modal=True):
        with dpg.plot():
            dpg.add_plot_legend()
            dpg.add_plot_axis(dpg.mvXAxis)
            dpg.add_plot_axis(dpg.mvYAxis)
            dpg.add_line_series([0, 1], [0, 1], parent=dpg.last_item(), label="line1")

with dpg.window():
    dpg.add_button(label="Show Plot", callback=show_plot)

dpg.create_viewport(width=800, height=600)
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()

DearPyGui version 1.6.2, Python 3.10.0, Windows 10

my1e5 avatar Sep 14 '22 16:09 my1e5