seeing-things / zwo

ZWO SDK and custom software for debugging and using it.
23 stars 4 forks source link

Can't close preview window #62

Closed bgottula closed 1 year ago

bgottula commented 3 years ago

It used to be the case that I could close the preview window, which would cause the associated threads to terminate. I just tried this and on my machine the window just re-opens at a different much larger size. Presumably this code doesn't work anymore? https://github.com/seeing-things/zwo/blob/master/capture/src/preview.cpp#L201-L211

While fixing this, make it so the histogram window can also be closed if not needed.

jgottula commented 3 years ago

Mint 19.x was on 18.04/bionic with opencv 3.2 (Dec 2016).

Mint 20.x is on 20.04/focal with opencv 4.2 (Dec 2019).

The whole GTK UI backend sort of got rewritten in between there. Here's one of the bigger commits. https://github.com/opencv/opencv/commit/9e239c7a1e86bc76d066c165559df32bacc44dd3

Dunno if that exception was ever actually truly a specified/guaranteed thing.

bgottula commented 1 year ago

I implemented a fix for this that seems to work for now, using OpenCV 4.2 on Ubuntu 20.04. I'm pretty sure it's using the Qt backend on my machine. I suspect that this code will always be a bit fragile because it relies on behaviors that may be inconsistent between different backends and isn't really documented.