Fix lost keypresses after workspace change (#1067)

Do not Ungrab the keyboard for a KeyPress event, this causes us to lose the
KeyRelease event which is needed to ungrab the keyboard after the event
happened.
This commit is contained in:
Ed Martin 2013-08-02 08:46:45 +02:00 committed by Mathias Gumz
parent 3ad6e299f6
commit 58e09b7190
2 changed files with 2 additions and 11 deletions

View file

@ -581,11 +581,6 @@ bool Keys::doAction(int type, unsigned int mods, unsigned int key,
return false;
}
// if focus changes, windows will get NotifyWhileGrabbed,
// which they tend to ignore
if (type == KeyPress)
XUngrabKeyboard(Fluxbox::instance()->display(), CurrentTime);
WinClient *old = WindowCmd<void>::client();
WindowCmd<void>::setClient(current);
temp_key->m_command->execute();

View file

@ -812,12 +812,8 @@ void BScreen::propertyNotify(Atom atom) {
}
void BScreen::keyPressEvent(XKeyEvent &ke) {
if (Fluxbox::instance()->keys()->doAction(ke.type, ke.state, ke.keycode,
Keys::GLOBAL|Keys::ON_DESKTOP))
// re-grab keyboard, so we don't pass KeyRelease to clients
// also for catching invalid keys in the middle of keychains
FbTk::EventManager::instance()->grabKeyboard(rootWindow().window());
Fluxbox::instance()->keys()->doAction(ke.type, ke.state, ke.keycode,
Keys::GLOBAL|Keys::ON_DESKTOP);
}
void BScreen::keyReleaseEvent(XKeyEvent &ke) {