aboutsummaryrefslogtreecommitdiff
path: root/src/fluxbox.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/fluxbox.cc')
-rw-r--r--src/fluxbox.cc27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index cd289ed..271d93f 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.cc
@@ -777,11 +777,13 @@ void Fluxbox::handleEvent(XEvent * const e) {
777#ifdef DEBUG 777#ifdef DEBUG
778 cerr<<__FILE__<<"("<<__FUNCTION__<<"): MappingNotify"<<endl; 778 cerr<<__FILE__<<"("<<__FUNCTION__<<"): MappingNotify"<<endl;
779#endif // DEBUG 779#endif // DEBUG
780 780 if (e->xmapping.request == MappingKeyboard
781 FbTk::KeyUtil::instance().init(); // reinitialise the key utils 781 || e->xmapping.request == MappingModifier) {
782 // reconfigure keys (if the mapping changes, they don't otherwise update 782 XRefreshKeyboardMapping(&e->xmapping);
783 m_key->reconfigure(StringUtil::expandFilename(*m_rc_keyfile).c_str()); 783 FbTk::KeyUtil::instance().init(); // reinitialise the key utils
784 784 // reconfigure keys (if the mapping changes, they don't otherwise update
785 m_key->reconfigure(StringUtil::expandFilename(*m_rc_keyfile).c_str());
786 }
785 break; 787 break;
786 case CreateNotify: 788 case CreateNotify:
787 break; 789 break;
@@ -1076,7 +1078,6 @@ void Fluxbox::handleKeyEvent(XKeyEvent &ke) {
1076 if (keyScreen() == 0 || mouseScreen() == 0) 1078 if (keyScreen() == 0 || mouseScreen() == 0)
1077 return; 1079 return;
1078 1080
1079
1080 switch (ke.type) { 1081 switch (ke.type) {
1081 case KeyPress: 1082 case KeyPress:
1082 m_key->doAction(ke); 1083 m_key->doAction(ke);
@@ -1089,9 +1090,10 @@ void Fluxbox::handleKeyEvent(XKeyEvent &ke) {
1089 if (m_watching_screen && m_watch_keyrelease) { 1090 if (m_watching_screen && m_watch_keyrelease) {
1090 // mask the mod of the released key out 1091 // mask the mod of the released key out
1091 // won't mask anything if it isn't a mod 1092 // won't mask anything if it isn't a mod
1092 ke.state &= ~FbTk::KeyUtil::instance().keycodeToModmask(ke.keycode); 1093 unsigned int state = FbTk::KeyUtil::instance().isolateModifierMask(ke.state);
1093 1094 state &= ~FbTk::KeyUtil::instance().keycodeToModmask(ke.keycode);
1094 if ((m_watch_keyrelease & ke.state) == 0) { 1095
1096 if ((m_watch_keyrelease & state) == 0) {
1095 1097
1096 m_watching_screen->notifyReleasedKeys(ke); 1098 m_watching_screen->notifyReleasedKeys(ke);
1097 XUngrabKeyboard(FbTk::App::instance()->display(), CurrentTime); 1099 XUngrabKeyboard(FbTk::App::instance()->display(), CurrentTime);
@@ -1107,8 +1109,6 @@ void Fluxbox::handleKeyEvent(XKeyEvent &ke) {
1107 default: 1109 default:
1108 break; 1110 break;
1109 } 1111 }
1110
1111
1112} 1112}
1113 1113
1114/// handle system signals 1114/// handle system signals
@@ -1951,12 +1951,15 @@ void Fluxbox::unfocusWindow(WinClient &client, bool full_revert, bool unfocus_fr
1951 1951
1952 1952
1953void Fluxbox::watchKeyRelease(BScreen &screen, unsigned int mods) { 1953void Fluxbox::watchKeyRelease(BScreen &screen, unsigned int mods) {
1954
1954 if (mods == 0) { 1955 if (mods == 0) {
1955 cerr<<"WARNING: attempt to grab without modifiers!"<<endl; 1956 cerr<<"WARNING: attempt to grab without modifiers!"<<endl;
1956 return; 1957 return;
1957 } 1958 }
1958 m_watching_screen = &screen; 1959 m_watching_screen = &screen;
1959 m_watch_keyrelease = mods; 1960
1961 // just make sure we are saving the mods with any other flags (xkb)
1962 m_watch_keyrelease = FbTk::KeyUtil::instance().isolateModifierMask(mods);
1960 XGrabKeyboard(FbTk::App::instance()->display(), 1963 XGrabKeyboard(FbTk::App::instance()->display(),
1961 screen.rootWindow().window(), True, 1964 screen.rootWindow().window(), True,
1962 GrabModeAsync, GrabModeAsync, CurrentTime); 1965 GrabModeAsync, GrabModeAsync, CurrentTime);