mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-09 07:22:21 +08:00
Compress sequential MappingNotify events into one.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user