aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorokan2015-08-27 18:40:09 +0000
committerokan2015-08-27 18:40:09 +0000
commit0a6b4395b1446658387e705bb2409d657dd039d6 (patch)
tree7ddc43952b471b18fdb1e9b1a33a95362252fa60
parent46cb79168f52da7f4e3aa7c2c1758d4383cc866b (diff)
downloadcwm-0a6b4395b1446658387e705bb2409d657dd039d6.tar.gz
Move client cycle grab/ungrab into a more relevant place; while here,
update comments about why we need to grab/ungrab the keyboard.
-rw-r--r--client.c6
-rw-r--r--kbfunc.c12
2 files changed, 8 insertions, 10 deletions
diff --git a/client.c b/client.c
index b057e7e..cbfc407 100644
--- a/client.c
+++ b/client.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: client.c,v 1.206 2015/08/25 18:29:10 okan Exp $
+ * $OpenBSD: client.c,v 1.207 2015/08/27 18:40:09 okan Exp $
*/
#include <sys/types.h>
@@ -659,6 +659,10 @@ client_cycle(struct screen_ctx *sc, int flags)
struct client_ctx *newcc, *oldcc;
int again = 1;
+ /* For X apps that ignore events. */
+ XGrabKeyboard(X_Dpy, sc->rootwin, True,
+ GrabModeAsync, GrabModeAsync, CurrentTime);
+
if (TAILQ_EMPTY(&sc->clientq))
return;
diff --git a/kbfunc.c b/kbfunc.c
index e243ab4..0e514ad 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.115 2015/08/21 16:14:39 okan Exp $
+ * $OpenBSD: kbfunc.c,v 1.116 2015/08/27 18:40:09 okan Exp $
*/
#include <sys/types.h>
@@ -219,13 +219,7 @@ kbfunc_menu_group(struct client_ctx *cc, union arg *arg)
void
kbfunc_client_cycle(struct client_ctx *cc, union arg *arg)
{
- struct screen_ctx *sc = cc->sc;
-
- /* XXX for X apps that ignore events */
- XGrabKeyboard(X_Dpy, sc->rootwin, True,
- GrabModeAsync, GrabModeAsync, CurrentTime);
-
- client_cycle(sc, arg->i);
+ client_cycle(cc->sc, arg->i);
}
void
@@ -464,7 +458,7 @@ void
kbfunc_client_grouptoggle(struct client_ctx *cc, union arg *arg)
{
if (arg->i == 0) {
- /* XXX for stupid X apps like xpdf and gvim */
+ /* For X apps that steal events. */
XGrabKeyboard(X_Dpy, cc->win, True,
GrabModeAsync, GrabModeAsync, CurrentTime);
}