I guess you are experiencing the same as described in the following already closed open3d issue using the old visualization gui stuff.
https://github.com/isl-org/Open3D/issues/1715
As stated there the best solution found so far is to switch to the new filament based gui as that is aware of other windows not controlled by open3d visualization gl code.
The sort answer is that visualization methods switch focus of gl window to front and than assume that no other window in the same program steals them the focus. Consequently when switching to tkinter gui open3d visualization code will not notice that it is not drawing to gl window but to the tkinter which it has no access to. - Any other program would whenever entering gl drawing code simply ensure that it is drawing to the right window and grab focus.
EDIT:
The above is true for what you have written in your post. But it is not true when you meant what you have put in headline "After running an open3d window and closing it, tkinter messagebox crashes and gives X Error of failed request: BadWindow (invalid Window Parameter)".
Your post made me assume the visualization window is still open. So do you close the visualization window and then open the tkinter window or open the tkinter window while the open3d visualization is open?
EDIT
Did some research in my own project. Tkinter
is the nasty ignoring beast. I finally resorted to use subprocess
module to sandbox the filedialog.askdirectory
and messagebox.askyesnocanel
. My solution you can find on https://github.com/isl-org/Open3D/issues/6125 .
Sorry not having better news than saying Tkinter is the bad and evil.