From 58e09b719077605efadac9b712acb8f5e752f732 Mon Sep 17 00:00:00 2001 From: Ed Martin Date: Fri, 2 Aug 2013 08:46:45 +0200 Subject: 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. --- src/Keys.cc | 5 ----- src/Screen.cc | 8 ++------ 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/Keys.cc b/src/Keys.cc index 388ec52..ad5dca0 100644 --- a/src/Keys.cc +++ b/src/Keys.cc @@ -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::client(); WindowCmd::setClient(current); temp_key->m_command->execute(); diff --git a/src/Screen.cc b/src/Screen.cc index 366b8df..3c7c79f 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -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) { -- cgit v0.11.2