-
-
Notifications
You must be signed in to change notification settings - Fork 699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Viewport stuck after closing when executing blocking instructions afterwards on MacOS #1593
Comments
On Windows it works with the render_loop method: import dearpygui.dearpygui as dpg
dpg.create_context()
dpg.create_viewport()
# here happens the DPG magic :)
dpg.setup_dearpygui()
dpg.show_viewport()
while dpg.is_dearpygui_running():
dpg.render_dearpygui_frame()
else:
dpg.destroy_context()
a = input("enter something:") |
Will check on this! |
Maybe mvCleanupViewport needs to be called if running flag is cleared? I don't see anything that is testing this flag. All I could see was glfw's "should close" also clearing this flag. I hope that helps. I may be mistaken though. I too would like to close the viewport. |
@hoffstadt This is not isolated to MacOS. I am running windows 10. |
Related to this: on both macOS (12.2.1 on M1 Pro) and Windows (10 Enterprise 21H1 on Xeon), if you create another context and viewport immediately after destroying one, the first viewport doesn't close until the second context is destroyed (I appreciate this is possibly a bad design though!): import dearpygui.dearpygui as dpg
def temporary_viewport(lifetime_in_frames: int) -> None:
dpg.create_context()
dpg.create_viewport(title="Test", width=800, height=340)
with dpg.window(label="Test", tag="Test"):
dpg.add_text(f"Lifetime of this viewport should be {lifetime_in_frames} frames")
dpg.setup_dearpygui()
dpg.show_viewport()
frame_count = 0
while dpg.is_dearpygui_running():
frame_count += 1
if frame_count > lifetime_in_frames:
dpg.stop_dearpygui()
dpg.destroy_context()
break
dpg.render_dearpygui_frame()
print("Done")
if __name__ == "__main__":
temporary_viewport(lifetime_in_frames=60) # blocks for 60 frames
# would expect first viewport to disappear here
temporary_viewport(lifetime_in_frames=600) # but now we end up with two viewports
# and both of them disappear after a further 600 frames |
Issue for an old version of DPG. Closing. |
OS : MacOS 12.1
Machine : MacBook Air (13-inch, Early 2015) 1,6 GHz Dual-Core Intel Core i5
Python : 3.10.1
DearPyGui : 1.3.1
The text was updated successfully, but these errors were encountered: