Fixed Unix key repeat not being disabled even after setKeyRepeatEnabled(false) is called. (#871)

This commit is contained in:
binary1248 2015-04-20 01:36:45 +02:00
parent 17570c324e
commit db8c237f6a

View File

@ -768,6 +768,24 @@ void WindowImplX11::processEvents()
{ {
free(lastKeyReleaseEvent); free(lastKeyReleaseEvent);
lastKeyReleaseEvent = NULL; lastKeyReleaseEvent = NULL;
// If key repeat is disabled, discard the matching key press event as well
if (!m_keyRepeat)
{
free(event);
if (!m_xcbEvents.empty())
{
event = m_xcbEvents.front();
m_xcbEvents.pop_front();
}
else
{
event = xcb_poll_for_event(m_connection);
}
continue;
}
} }
} }