Bug: UI unresponsive after click `run` with fsg/psg
Before You Begin
Before proceeding, please make sure to follow these steps:
- [x] I have checked for similar issues in the project's issue tracker.
- [x] I have searched closed issues to see if a similar problem was reported before.
Issue Details
- start cli2gui UI
- enter arguments
- click
Run - UI will get stuck and warn unresponsive state
Description
This problem only occurs on pysimpleguiwrapper
Expected Behavior
UI should not be blocked
Actual Behavior
Unresponsive warn happens.
System Information
Please provide the following additional information about your system or environment:
- Operating System (OS): Windows 11
- OS Version: 22631.4249
- Browser (if applicable):
- Browser Version (if applicable):
- Project Version (if applicable): 2024.2
Hey thanks for the issue, I wasn't able to replicate this locally. I've created a test file based on the code you'd shared with me previously (just removing most of the business type logic). Seems not to freeze up the ui.
Hey thanks for the issue, I wasn't able to replicate this locally. I've created a test file based on the code you'd shared with me previously (just removing most of the business type logic). Seems not to freeze up the ui.
could you please send your test script I'm testing on https://github.com/mokurin000/fuckingfast-batch-download/commit/test-freeze
also, did you add some fake payload (for exmaple time.sleep() ?
Yeah sure its https://github.com/FHPythonUtils/Cli2Gui/blob/master/tests/argparse/test_22.py
Can't seem to view the image
Ah could it be the threading do you think? Shouldn't block dearpygui though? Unless I need to think about spawning a UI thread perhaps
Yeah sure its https://github.com/FHPythonUtils/Cli2Gui/blob/master/tests/argparse/test_22.py
Can't seem to view the image
Ah could it be the threading do you think? Shouldn't block dearpygui though? Unless I need to think about spawning a UI thread perhaps
Ah, I think I may have misdescribe. I encountered blocking when I did not open another thread to start the main function. If Thread.start() is replaced with Thread.run(), it will run the task in the current thread, and then because the task is running in the UI thread, it will block the UI. What I did to solve the problem was to open the task in another thread (the wrapper)
Ah right thanks for the clarification. I'll give that a go when I get the chance. I don't know enough about the inner workings of dearpygui to know if thread.run should block the UI thread but it sounds like it should?
I'll do some investigation and get back to you if that's alright? :)
sorry for the misoperation..
dearpygui may spawns own event loop thread by default
While psg/fsg does not.
Thread.run() will simply run the Callable object in current thread
