aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Martin <edman007@edman007.com>2013-08-02 06:46:45 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2013-08-02 06:46:45 (GMT)
commit58e09b719077605efadac9b712acb8f5e752f732 (patch)
tree1f4828c990b9d43afcf88283e9b2d3218300afa6
parent3ad6e299f6156d97b91de30f374c2bbdad433f42 (diff)
downloadfluxbox-58e09b719077605efadac9b712acb8f5e752f732.zip
fluxbox-58e09b719077605efadac9b712acb8f5e752f732.tar.bz2
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.
-rw-r--r--src/Keys.cc5
-rw-r--r--src/Screen.cc8
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,
581 return false; 581 return false;
582 } 582 }
583 583
584 // if focus changes, windows will get NotifyWhileGrabbed,
585 // which they tend to ignore
586 if (type == KeyPress)
587 XUngrabKeyboard(Fluxbox::instance()->display(), CurrentTime);
588
589 WinClient *old = WindowCmd<void>::client(); 584 WinClient *old = WindowCmd<void>::client();
590 WindowCmd<void>::setClient(current); 585 WindowCmd<void>::setClient(current);
591 temp_key->m_command->execute(); 586 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) {
812} 812}
813 813
814void BScreen::keyPressEvent(XKeyEvent &ke) { 814void BScreen::keyPressEvent(XKeyEvent &ke) {
815 if (Fluxbox::instance()->keys()->doAction(ke.type, ke.state, ke.keycode, 815 Fluxbox::instance()->keys()->doAction(ke.type, ke.state, ke.keycode,
816 Keys::GLOBAL|Keys::ON_DESKTOP)) 816 Keys::GLOBAL|Keys::ON_DESKTOP);
817 // re-grab keyboard, so we don't pass KeyRelease to clients
818 // also for catching invalid keys in the middle of keychains
819 FbTk::EventManager::instance()->grabKeyboard(rootWindow().window());
820
821} 817}
822 818
823void BScreen::keyReleaseEvent(XKeyEvent &ke) { 819void BScreen::keyReleaseEvent(XKeyEvent &ke) {