-
-
Notifications
You must be signed in to change notification settings - Fork 697
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
destroy_context doesn't clean up the window #2173
Comments
Probably Linux-only (with the minimal example given), because on Windows you can only get to |
Here's a modified example that will show somewhat similar behavior on Windows: import dearpygui.dearpygui as dpg
dpg.create_context()
dpg.create_viewport()
dpg.setup_dearpygui()
with dpg.window(label="tutorial"):
dpg.add_text("Hello world")
dpg.add_button(label="Exit", callback=lambda: dpg.stop_dearpygui())
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()
print("window closed")
while True:
pass Instead of closing the window, press Exit - and you'll get an unresponsive window. |
Also, this is most probably a duplicate of #2013 - see my comment in that issue. |
Also, there's a discussion in #1593 which shows how old the issue is! 😂 |
Ah, sorry for the duplicate, moving to #2013. |
Alright, since I can't reopen the other issues I'll stay here :D Any plans on addressing this issue? If you are sure that |
I'm not sure how to fix this issue properly - it's up to @hoffstadt to decide... It might well be that |
Having the same issue on POPOS with SwayWM. I have to kill the python process to close the viewport. Is there a way around this? For now this is a showstopper for me to use dpg! |
On Windows, you could use WinAPI wrappers to close your window directly. I don't know if such a package exists on Linux - basically you need some kind of a SwayWM or Wayland API. Google says there's PyWayland, at least. This would make your code platform-dependent, but with this kind of issues there's no cross-platform workarounds. |
Other GUI frameworks I tried don't have this problem and am unsure if this is wayland related, more seems like a bug or oversight. |
It's a bug in DPG, just like I said in a comment in another ticket. I'm talking about Wayland because you can use its API to forcefully close the window - as a workaround for the DPG bug. DPG does not close the window itself. Most users don't see it because their programs end immediately after |
As an option, use |
Any update on this? |
PR #2275 is going to fix this. |
Version of Dear PyGui
Version: 1.9.1
Operating System: Ubuntu 22.04 (KDE Plasma 5.27.7)
My Issue
Calling
dpg.destroy_context()
doesn't close the window, but just makes it unresponsive.This seems like a very basic thing, so maybe there's something wrong with my OS or window manager? It works as expected on my Windows 11 system.
I also tried a range of DPG versions, all of them have the same issue on my Linux system.
To Reproduce
Run the code below and simply close the window by clicking on the x. The window doesn't close but just becomes unresponsive. It does unblock
dpg.start_dearpygui()
, callsdestroy_context
and goes into the while True loop as expected.Expected behavior
The window should close properly.
Standalone, minimal, complete and verifiable example
The text was updated successfully, but these errors were encountered: