Compress sequential MappingNotify events into one.

This commit is contained in:
crs 2003-07-05 14:47:41 +00:00
parent 24fc257b3c
commit 47b480c0bc
1 changed files with 13 additions and 0 deletions

View File

@ -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);