aboutsummaryrefslogtreecommitdiffstats
path: root/kbfunc.c
diff options
context:
space:
mode:
authorokan2017-12-29 18:50:43 +0000
committerokan2017-12-29 18:50:43 +0000
commit94fa8f6008663944358afaeb58a1217cf564a95c (patch)
tree4bdd8f886ccf464e30724d945a5843cbdfbc9bb7 /kbfunc.c
parent2752425282f3222e609d25dee2df4f4d666274d5 (diff)
downloadcwm-94fa8f6008663944358afaeb58a1217cf564a95c.tar.gz
As done for buttonrelease, work specific un-cycling and un-highlighting actions
into the keyrelease event, only performing what's actually needed for each; should result in much fewer events against keyreleases. No intended behaviour change. Additionally, like we do for group membership, grab the keyboard only when required for cycling.
Diffstat (limited to '')
-rw-r--r--kbfunc.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/kbfunc.c b/kbfunc.c
index e2ecca1..cbeba36 100644
--- a/kbfunc.c
+++ b/kbfunc.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: kbfunc.c,v 1.157 2017/12/29 16:55:50 okan Exp $
+ * $OpenBSD: kbfunc.c,v 1.158 2017/12/29 18:50:43 okan Exp $
*/
#include <sys/types.h>
@@ -398,7 +398,14 @@ kbfunc_client_vtile(void *ctx, struct cargs *cargs)
void
kbfunc_client_cycle(void *ctx, struct cargs *cargs)
{
- client_cycle(ctx, cargs->flag);
+ struct screen_ctx *sc = ctx;
+
+ /* For X apps that ignore/steal events. */
+ if (cargs->xev == CWM_XEV_KEY)
+ XGrabKeyboard(X_Dpy, sc->rootwin, True,
+ GrabModeAsync, GrabModeAsync, CurrentTime);
+
+ client_cycle(sc, cargs->flag);
}
void
@@ -406,7 +413,7 @@ kbfunc_client_toggle_group(void *ctx, struct cargs *cargs)
{
struct client_ctx *cc = ctx;
- /* For X apps that steal events. */
+ /* For X apps that ignore/steal events. */
if (cargs->xev == CWM_XEV_KEY)
XGrabKeyboard(X_Dpy, cc->win, True,
GrabModeAsync, GrabModeAsync, CurrentTime);