aboutsummaryrefslogtreecommitdiff
path: root/src/Screen.cc
diff options
context:
space:
mode:
authorThomas Lübking <thomas.luebking@gmail.com>2016-07-15 15:16:54 (GMT)
committerThomas Lübking <thomas.luebking@gmail.com>2016-08-27 07:36:19 (GMT)
commit1e235e3f01733e3282a76e6be8862206d1504bdf (patch)
treee605c784c9f7042299c706acfb69d8cbab447657 /src/Screen.cc
parent2c6647112667109b109e578ffd55ae8409c9e1af (diff)
downloadfluxbox-1e235e3f01733e3282a76e6be8862206d1504bdf.zip
fluxbox-1e235e3f01733e3282a76e6be8862206d1504bdf.tar.bz2
Grab keyboard synchronouosly to allow replays
This allows to catch if a grabbed key (combo) is actually w/o effect (because eg. the OnDesktop condition does not match) and then replay the event ungrabbed to pass it to the focused client. Just like mouse grabbing, this BEARS THE POTENTIAL TO LOCK INPUT, thus needs AS MUCH TESTING AS POSSIBLE BUG: 1137
Diffstat (limited to 'src/Screen.cc')
-rw-r--r--src/Screen.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 013b6c6..277952b 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -658,11 +658,14 @@ void BScreen::propertyNotify(Atom atom) {
658 658
659void BScreen::keyPressEvent(XKeyEvent &ke) { 659void BScreen::keyPressEvent(XKeyEvent &ke) {
660 if (Fluxbox::instance()->keys()->doAction(ke.type, ke.state, ke.keycode, 660 if (Fluxbox::instance()->keys()->doAction(ke.type, ke.state, ke.keycode,
661 Keys::GLOBAL|Keys::ON_DESKTOP)) { 661 Keys::GLOBAL|(ke.subwindow ? 0 : Keys::ON_DESKTOP))) {
662 662
663 // re-grab keyboard, so we don't pass KeyRelease to clients 663 // re-grab keyboard, so we don't pass KeyRelease to clients
664 // also for catching invalid keys in the middle of keychains 664 // also for catching invalid keys in the middle of keychains
665 FbTk::EventManager::instance()->grabKeyboard(rootWindow().window()); 665 FbTk::EventManager::instance()->grabKeyboard(rootWindow().window());
666 XAllowEvents(Fluxbox::instance()->display(), SyncKeyboard, CurrentTime);
667 } else {
668 XAllowEvents(Fluxbox::instance()->display(), ReplayKeyboard, CurrentTime);
666 } 669 }
667} 670}
668 671