diff --git a/modules/highgui/cmake/detect_gtk.cmake b/modules/highgui/cmake/detect_gtk.cmake index c58246ac54..5e9412d427 100644 --- a/modules/highgui/cmake/detect_gtk.cmake +++ b/modules/highgui/cmake/detect_gtk.cmake @@ -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() diff --git a/modules/highgui/src/window_gtk.cpp b/modules/highgui/src/window_gtk.cpp index 98698cbade..598850d4ac 100644 --- a/modules/highgui/src/window_gtk.cpp +++ b/modules/highgui/src/window_gtk.cpp @@ -659,14 +659,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 @@ -675,13 +667,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;