Skip to content

Commit

Permalink
Fix lost keypresses after workspace change (#1067)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
edman007 authored and Mathias Gumz committed Aug 2, 2013
1 parent 3ad6e29 commit 58e09b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
5 changes: 0 additions & 5 deletions src/Keys.cc
Expand Up @@ -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();
Expand Down
8 changes: 2 additions & 6 deletions src/Screen.cc
Expand Up @@ -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) {
Expand Down

0 comments on commit 58e09b7

Please sign in to comment.