summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@gnugeneration.com>2016-11-10 19:28:04 -0800
committerGitHub <noreply@github.com>2016-11-10 19:28:04 -0800
commitf92c2b443b380ddd17e5d9c9ac9a55e49cde444f (patch)
tree3e031697d99616113969f8cce38d30880c4e5522
parenta1aba8e0fe5c94ebf04258b609666c92b756954f (diff)
parent95bfa88795a34b177fc8c31ad920186528d43ebc (diff)
Merge pull request #8 from vcaputo/decrement_key_is_grabbed
key: decrement key_is_grabbed release of multi-Alt
-rw-r--r--src/key.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/key.c b/src/key.c
index 7a15ed0..47a2c8d 100644
--- a/src/key.c
+++ b/src/key.c
@@ -57,10 +57,13 @@ void vwm_key_released(vwm_t *vwm, Window win, XKeyReleasedEvent *keyrelease)
VWM_TRACE("XK_Alt_[LR] released");
/* aborted? try restore focused_origin */
- if (key_is_grabbed > 1 && vwm->focused_origin) {
- VWM_TRACE("restoring %p on %p", vwm->focused_origin, vwm->focused_origin->desktop);
- vwm_desktop_focus(vwm, vwm->focused_origin->desktop);
- vwm_win_focus(vwm, vwm->focused_origin);
+ if (key_is_grabbed > 1) {
+ key_is_grabbed--; /* This is important to prevent treating the final lone Alt release as another cancel/rollback. */
+ if (vwm->focused_origin) {
+ VWM_TRACE("restoring %p on %p", vwm->focused_origin, vwm->focused_origin->desktop);
+ vwm_desktop_focus(vwm, vwm->focused_origin->desktop);
+ vwm_win_focus(vwm, vwm->focused_origin);
+ }
}
/* make the focused window the most recently used */
© All Rights Reserved