-rw-r--r-- | agg-plot/agg_platform_support_win32.cpp | 13 | ||||
-rw-r--r-- | agg-plot/agg_platform_support_x11.cpp | 13 |
diff --git a/agg-plot/agg_platform_support_win32.cpp b/agg-plot/agg_platform_support_win32.cpp index 40f2fdd2..84d8580a 100644 --- a/agg-plot/agg_platform_support_win32.cpp +++ b/agg-plot/agg_platform_support_win32.cpp @@ -1106,9 +1106,16 @@ namespace agg { bool status; - pthread_mutex_unlock (m_specific->m_mutex); - status = ::GetMessage(&msg, 0, 0, 0); - pthread_mutex_lock (m_specific->m_mutex); + if (m_specific->m_is_mapped) + { + pthread_mutex_unlock (m_specific->m_mutex); + status = ::GetMessage(&msg, 0, 0, 0); + pthread_mutex_lock (m_specific->m_mutex); + } + else + { + status = ::GetMessage(&msg, 0, 0, 0); + } if(! status) { diff --git a/agg-plot/agg_platform_support_x11.cpp b/agg-plot/agg_platform_support_x11.cpp index 4f6143a6..c745ee9b 100644 --- a/agg-plot/agg_platform_support_x11.cpp +++ b/agg-plot/agg_platform_support_x11.cpp @@ -732,9 +732,16 @@ namespace agg } XEvent x_event; - pthread_mutex_unlock (m_specific->m_mutex); - XNextEvent(m_specific->m_display, &x_event); - pthread_mutex_lock (m_specific->m_mutex); + if (m_specific->m_is_mapped) + { + pthread_mutex_unlock (m_specific->m_mutex); + XNextEvent(m_specific->m_display, &x_event); + pthread_mutex_lock (m_specific->m_mutex); + } + else + { + XNextEvent(m_specific->m_display, &x_event); + } // In the Idle mode discard all intermediate MotionNotify events if(!m_wait_mode && x_event.type == MotionNotify) |