aboutsummaryrefslogtreecommitdiff
path: root/src/event.c
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-06-29 13:13:20 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-06-29 13:13:20 +0200
commit98a074417fb9ac157c32d637123b6eaae19239f9 (patch)
tree583236741d6fdae64fb5a82eb6f7cb4394da844a /src/event.c
parent5ff9125db3a7f8f545cbfb5f7bf452c8b0db4d41 (diff)
downloadjwm-98a074417fb9ac157c32d637123b6eaae19239f9.tar.gz
Handle modifiers when window switching
Before this patch, releasing Shift would end the switch, even if the Shift key was part of the prevstacked key binding. This patch fixes that. It ranks the modifiers, so that Shift can act as an "alternate" modifier for all modifiers, Alt for all keys but Shift, Ctrl for all keys but Alt and Shift and so forth. The Hyper key cannot act as an "alternate" modifier for any modifier. It is a bit complex, but hopefully intuitive.
Diffstat (limited to 'src/event.c')
-rw-r--r--src/event.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/src/event.c b/src/event.c
index 8850665..05218d8 100644
--- a/src/event.c
+++ b/src/event.c
@@ -452,24 +452,15 @@ void HandleKeyPress(const XKeyEvent *event) {
****************************************************************************/
void HandleKeyRelease(const XKeyEvent *event) {
ClientNode *np;
- KeyType key;
- key = GetKey(event);
+ if(!switching || Switching(event))
+ return;
- switch(key & 0xFF) {
- case KEY_NEXT:
- case KEY_PREV:
- case KEY_NEXT_STACKED:
- case KEY_PREV_STACKED:
- break;
- default:
- if(switching) {
- switching = 0;
- np = GetActiveClient();
- if (np) RaiseClient(np);
- JXUngrabKeyboard(display, CurrentTime);
- }
- }
+ /* End window switching */
+ switching = 0;
+ np = GetActiveClient();
+ if (np) RaiseClient(np);
+ JXUngrabKeyboard(display, CurrentTime);
}
/****************************************************************************