Skip to content
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

Unused function startWindowThread ? #7562

Closed
LaurentBerger opened this issue Oct 27, 2016 · 4 comments
Closed

Unused function startWindowThread ? #7562

LaurentBerger opened this issue Oct 27, 2016 · 4 comments
Labels
bug category: documentation Documentation fix or update category: highgui-gui future This issue can't be fixed during restrictions of the compatibility requirements
Milestone

Comments

@LaurentBerger
Copy link
Contributor

Hi,
reading doc i found startThread It seems this function is empty or used as an internal function :
https://github.com/opencv/opencv/blob/master/modules/highgui/src/window.cpp#L239
and https://github.com/opencv/opencv/blob/master/modules/highgui/src/window.cpp#L642
May be it shouldn't be in doc

@kinchungwong
Copy link
Contributor

kinchungwong commented Oct 27, 2016

The function on Line 642 that gives an error at runtime is only enabled if OpenCV is built without linking to any of the supported windowing system API.
See

#if defined (HAVE_WIN32UI) // see window_w32.cpp
#elif defined (HAVE_GTK) // see window_gtk.cpp
#elif defined (HAVE_COCOA) // see window_carbon.cpp
#elif defined (HAVE_CARBON)
#elif defined (HAVE_QT) // see window_QT.cpp
#elif defined (WINRT) && !defined (WINRT_8_0) // see window_winrt.cpp
#else

The comments on these lines explained where to find the corresponding function implementations for each windowing API.

#if   defined (HAVE_WIN32UI)  // see window_w32.cpp
#elif defined (HAVE_GTK)      // see window_gtk.cpp
#elif defined (HAVE_COCOA)    // see window_carbon.cpp
#elif defined (HAVE_CARBON)
#elif defined (HAVE_QT)       // see window_QT.cpp
#elif defined (WINRT) && !defined (WINRT_8_0) // see window_winrt.cpp

Currently, it appears that only GTK requires this function. For other windowing API, the function is empty. Search results: https://github.com/opencv/opencv/search?utf8=%E2%9C%93&q=cvStartWindowThread

@mshabunin mshabunin added bug category: documentation Documentation fix or update category: highgui-gui future This issue can't be fixed during restrictions of the compatibility requirements labels Nov 15, 2016
@mshabunin
Copy link
Contributor

This function is exported, we can not remove it from public API without breaking compatibility. Probably we could deprecate it and remove from API and documentation in future.

@caraffi
Copy link

caraffi commented Feb 4, 2021

I think the fact that remains in the API but it is not document is very confusing. In the case of GTK, is it necessary to call it or is it automatically called?

@crackwitz
Copy link
Contributor

crackwitz commented Feb 5, 2021

related issue #9087, related forum thread https://forum.opencv.org/t/what-does-cv-startwindowthread-do/1326

5.0 milestone... if I am informed correctly, a unified OpenGL GUI is planned for that. regardless of whether this function is removed, I'd still like to see the behavior of GUI staying responsive in the absence of waitKey calls. highly convenient, particularly when prototyping interactively with python, or single-stepping through code. I don't know how the new OpenGL GUI is going to be implemented but if it involves an event loop thread, perhaps spawn it implicit in the first namedWindow/imshow call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug category: documentation Documentation fix or update category: highgui-gui future This issue can't be fixed during restrictions of the compatibility requirements
Projects
None yet
Development

No branches or pull requests

6 participants