From 92c867e77e4da3c07ed400b7d66ec200b4e15bc2 Mon Sep 17 00:00:00 2001 From: okan Date: Wed, 22 May 2013 16:54:09 +0000 Subject: get rid of long standing XXX: now that we configure screens based on config options, add the keybinding GrabKey calls here --- calmwm.c | 10 +--------- conf.c | 10 +++++++--- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/calmwm.c b/calmwm.c index a9afd91..6be90ea 100644 --- a/calmwm.c +++ b/calmwm.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: calmwm.c,v 1.75 2013/05/14 13:39:53 okan Exp $ + * $OpenBSD: calmwm.c,v 1.76 2013/05/22 16:54:09 okan Exp $ */ #include @@ -144,7 +144,6 @@ dpy_init(const char *dpyname) static void x_setup(void) { - struct keybinding *kb; int i; Cursor_default = XCreateFontCursor(X_Dpy, XC_X_cursor); @@ -155,13 +154,6 @@ x_setup(void) for (i = 0; i < ScreenCount(X_Dpy); i++) screen_init(i); - - /* - * XXX key grabs weren't done before, since Screenq was empty, - * do them here for now (this needs changing). - */ - TAILQ_FOREACH(kb, &Conf.keybindingq, entry) - conf_grab(&Conf, kb); } static void diff --git a/conf.c b/conf.c index b49b489..72c72d4 100644 --- a/conf.c +++ b/conf.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: conf.c,v 1.130 2013/05/22 16:32:15 okan Exp $ + * $OpenBSD: conf.c,v 1.131 2013/05/22 16:54:09 okan Exp $ */ #include @@ -98,8 +98,9 @@ static char *color_binds[CWM_COLOR_MAX] = { void conf_screen(struct screen_ctx *sc) { - int i; - XftColor xc; + struct keybinding *kb; + int i; + XftColor xc; sc->gap = Conf.gap; @@ -139,6 +140,9 @@ conf_screen(struct screen_ctx *sc) sc->visual, sc->colormap); if (sc->xftdraw == NULL) errx(1, "XftDrawCreate"); + + TAILQ_FOREACH(kb, &Conf.keybindingq, entry) + xu_key_grab(sc->rootwin, kb->modmask, kb->keysym); } static struct { -- cgit v1.2.3-2-gb3c3