Fix behavior for autorepeat keys

This reverts 58e09b7190 after having regressions
and bug reports in regards to autorepeated key events are not working anymore.

So, the problem with the lost keypress after the workspace change is still
open but at least the behavior for other folks is as it was. Since 58e09b7190
seems to be corelated to "auto repeat" keys it might indicate the problem
which 58e09b7190 "fixed". We will see.

Fixes #1115.
This commit is contained in:
Mathias Gumz 2015-01-21 10:06:01 +01:00
parent 8e92ad53e0
commit 980ab5e3f5
2 changed files with 13 additions and 2 deletions

View file

@ -575,6 +575,12 @@ bool Keys::doAction(int type, unsigned int mods, unsigned int key,
return false; 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(); WinClient *old = WindowCmd<void>::client();
WindowCmd<void>::setClient(current); WindowCmd<void>::setClient(current);
temp_key->m_command->execute(); temp_key->m_command->execute();

View file

@ -680,8 +680,13 @@ void BScreen::propertyNotify(Atom atom) {
} }
void BScreen::keyPressEvent(XKeyEvent &ke) { void BScreen::keyPressEvent(XKeyEvent &ke) {
Fluxbox::instance()->keys()->doAction(ke.type, ke.state, ke.keycode, if (Fluxbox::instance()->keys()->doAction(ke.type, ke.state, ke.keycode,
Keys::GLOBAL|Keys::ON_DESKTOP); 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());
}
} }
void BScreen::keyReleaseEvent(XKeyEvent &ke) { void BScreen::keyReleaseEvent(XKeyEvent &ke) {