From 47b480c0bcdd140aa91d9895921a17a5120a0cb7 Mon Sep 17 00:00:00 2001 From: crs Date: Sat, 5 Jul 2003 14:47:41 +0000 Subject: [PATCH] Compress sequential MappingNotify events into one. --- lib/platform/CXWindowsScreen.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/platform/CXWindowsScreen.cpp b/lib/platform/CXWindowsScreen.cpp index 81553d59..964fe739 100644 --- a/lib/platform/CXWindowsScreen.cpp +++ b/lib/platform/CXWindowsScreen.cpp @@ -635,6 +635,19 @@ CXWindowsScreen::onPreDispatch(CEvent* event) switch (xevent->type) { case MappingNotify: + { + CLock lock(&m_mutex); + if (XPending(m_display) > 0) { + XEvent tmpEvent; + XPeekEvent(m_display, &tmpEvent); + if (tmpEvent.type == MappingNotify) { + // discard this MappingNotify since another follows. + // we tend to get a bunch of these in a row. + return true; + } + } + } + // keyboard mapping changed XRefreshKeyboardMapping(&xevent->xmapping);