Compress sequential MappingNotify events into one.
This commit is contained in:
parent
24fc257b3c
commit
47b480c0bc
|
@ -635,6 +635,19 @@ CXWindowsScreen::onPreDispatch(CEvent* event)
|
||||||
|
|
||||||
switch (xevent->type) {
|
switch (xevent->type) {
|
||||||
case MappingNotify:
|
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
|
// keyboard mapping changed
|
||||||
XRefreshKeyboardMapping(&xevent->xmapping);
|
XRefreshKeyboardMapping(&xevent->xmapping);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue