all repos — fluxbox @ 1e235e3f01733e3282a76e6be8862206d1504bdf

custom fork of the fluxbox windowmanager

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
Thomas Lübking thomas.luebking@gmail.com
commit

1e235e3f01733e3282a76e6be8862206d1504bdf

parent

2c6647112667109b109e578ffd55ae8409c9e1af

2 files changed, 5 insertions(+), 2 deletions(-)

jump to
M src/FbTk/KeyUtil.ccsrc/FbTk/KeyUtil.cc

@@ -129,7 +129,7 @@ // Grab with numlock, capslock and scrlock

for (int i = 0; i < 8; i++) { XGrabKey(display, key, mod | (i & 1 ? LockMask : 0) | (i & 2 ? nummod : 0) | (i & 4 ? scrollmod : 0), - win, True, GrabModeAsync, GrabModeAsync); + win, True, GrabModeAsync, GrabModeSync); } }
M src/Screen.ccsrc/Screen.cc

@@ -658,11 +658,14 @@ }

void BScreen::keyPressEvent(XKeyEvent &ke) { if (Fluxbox::instance()->keys()->doAction(ke.type, ke.state, ke.keycode, - Keys::GLOBAL|Keys::ON_DESKTOP)) { + Keys::GLOBAL|(ke.subwindow ? 0 : 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()); + XAllowEvents(Fluxbox::instance()->display(), SyncKeyboard, CurrentTime); + } else { + XAllowEvents(Fluxbox::instance()->display(), ReplayKeyboard, CurrentTime); } }