Merge pull request #23250 from tintou:./tintou/glib-req

highgui: Set hard GLib requirement to >=2.32
pull/23393/head
Alexander Smorkalov 2 years ago committed by GitHub
commit a4ff46aab7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      modules/highgui/cmake/detect_gtk.cmake
  2. 14
      modules/highgui/src/window_gtk.cpp

@ -20,7 +20,7 @@ if(WITH_GTK)
endif()
endif()
endif()
ocv_check_modules(GTHREAD gthread-2.0)
ocv_check_modules(GTHREAD gthread-2.0>=2.32)
if(HAVE_GTK AND NOT HAVE_GTHREAD)
message(FATAL_ERROR "gthread not found. This library is required when building with GTK support")
else()

@ -662,14 +662,6 @@ CV_IMPL int cvStartWindowThread(){
cvInitSystem(0,NULL);
if (!thread_started)
{
#if !GLIB_CHECK_VERSION(2, 32, 0) // https://github.com/GNOME/glib/blame/b4d58a7105bb9d75907233968bb534b38f9a6e43/glib/deprecated/gthread.h#L274
if (!g_thread_supported ())
{
/* the GThread system wasn't inited, so init it */
g_thread_init(NULL);
}
#endif
(void)getWindowMutex(); // force mutex initialization
// protects the 'last key pressed' variable
@ -678,13 +670,7 @@ CV_IMPL int cvStartWindowThread(){
// conditional that indicates a key has been pressed
cond_have_key = g_cond_new();
#if !GLIB_CHECK_VERSION(2, 32, 0)
// this is the window update thread
window_thread = g_thread_create(icvWindowThreadLoop,
NULL, TRUE, NULL);
#else
window_thread = g_thread_new("OpenCV window update", icvWindowThreadLoop, NULL);
#endif
}
thread_started = window_thread!=NULL;
return thread_started;

Loading…
Cancel
Save