Hi,

got some bones broken from my left hand/wrist causing inaccurate movement
of mouse etc., so likely useless to most, and possibly done wrong,
but does help/work for me:)

-Artturi


diff --git a/app/cwm/calmwm.h b/app/cwm/calmwm.h
index 9d2d99f19..3f1d095e8 100644
--- a/app/cwm/calmwm.h
+++ b/app/cwm/calmwm.h
@@ -76,6 +76,7 @@ enum cursor_font {
 enum color {
        CWM_COLOR_BORDER_ACTIVE,
        CWM_COLOR_BORDER_INACTIVE,
+       CWM_COLOR_BORDER_NOINPUT,
        CWM_COLOR_BORDER_URGENCY,
        CWM_COLOR_BORDER_GROUP,
        CWM_COLOR_BORDER_UNGROUP,
@@ -155,6 +156,7 @@ struct client_ctx {
 #define CLIENT_FULLSCREEN              0x0800
 #define CLIENT_STICKY                  0x1000
 #define CLIENT_ACTIVE                  0x2000
+#define CLIENT_NOINPUT                 0x4000
 #define CLIENT_HIGHLIGHT               (CLIENT_GROUP | CLIENT_UNGROUP)
 #define CLIENT_MAXFLAGS                        (CLIENT_VMAXIMIZED | 
CLIENT_HMAXIMIZED)
 #define CLIENT_MAXIMIZED               (CLIENT_VMAXIMIZED | CLIENT_HMAXIMIZED)
@@ -413,6 +415,7 @@ void                         client_toggle_hmaximize(struct 
client_ctx *);
 void                    client_toggle_maximize(struct client_ctx *);
 void                    client_toggle_sticky(struct client_ctx *);
 void                    client_toggle_vmaximize(struct client_ctx *);
+void                    client_toggle_noinput(struct client_ctx *);
 void                    client_transient(struct client_ctx *);
 void                    client_unhide(struct client_ctx *);
 void                    client_urgency(struct client_ctx *);
@@ -474,6 +477,7 @@ void                         
kbfunc_client_toggle_fullscreen(void *,
 void                    kbfunc_client_toggle_maximize(void *, struct cargs *);
 void                    kbfunc_client_toggle_hmaximize(void *, struct cargs *);
 void                    kbfunc_client_toggle_vmaximize(void *, struct cargs *);
+void                    kbfunc_client_toggle_noinput(void *, struct cargs *);
 void                    kbfunc_client_htile(void *, struct cargs *);
 void                    kbfunc_client_vtile(void *, struct cargs *);
 void                    kbfunc_client_cycle(void *, struct cargs *);
diff --git a/app/cwm/client.c b/app/cwm/client.c
index a163f4f1b..18794bbd5 100644
--- a/app/cwm/client.c
+++ b/app/cwm/client.c
@@ -209,8 +209,9 @@ client_setactive(struct client_ctx *cc)
 
        XInstallColormap(X_Dpy, cc->colormap);
 
-       if ((cc->flags & CLIENT_INPUT) ||
-           (!(cc->flags & CLIENT_WM_TAKE_FOCUS))) {
+       if (!(cc->flags & CLIENT_NOINPUT) &&
+           ((cc->flags & CLIENT_INPUT) ||
+           (!(cc->flags & CLIENT_WM_TAKE_FOCUS)))) {
                XSetInputFocus(X_Dpy, cc->win,
                    RevertToPointerRoot, CurrentTime);
        }
@@ -222,7 +223,7 @@ client_setactive(struct client_ctx *cc)
                client_draw_border(oldcc);
        }
 
-       /* If we're in the middle of cycing, don't change the order. */
+       /* If we're in the middle of cycling, don't change the order. */
        if (!sc->cycling)
                client_mtf(cc);
 
@@ -414,6 +415,16 @@ resize:
        xu_ewmh_set_net_wm_state(cc);
 }
 
+void
+client_toggle_noinput(struct client_ctx *cc)
+{
+       if (cc->flags & CLIENT_NOINPUT)
+               cc->flags &= ~CLIENT_NOINPUT;
+       else
+               cc->flags |= CLIENT_NOINPUT;
+
+}
+
 void
 client_resize(struct client_ctx *cc, int reset)
 {
@@ -560,6 +571,9 @@ client_draw_border(struct client_ctx *cc)
        else
                pixel = sc->xftcolor[CWM_COLOR_BORDER_INACTIVE].pixel;
 
+       if (cc->flags & CLIENT_NOINPUT)
+               pixel = sc->xftcolor[CWM_COLOR_BORDER_NOINPUT].pixel;
+
        if (cc->flags & CLIENT_URGENCY)
                pixel = sc->xftcolor[CWM_COLOR_BORDER_URGENCY].pixel;
 
diff --git a/app/cwm/conf.c b/app/cwm/conf.c
index e934b060c..2e97eb780 100644
--- a/app/cwm/conf.c
+++ b/app/cwm/conf.c
@@ -46,6 +46,7 @@ static int cursor_binds[] = {
 static const char *color_binds[] = {
        "#CCCCCC",              /* CWM_COLOR_BORDER_ACTIVE */
        "#666666",              /* CWM_COLOR_BORDER_INACTIVE */
+       "#66ff99",              /* CWM_COLOR_BORDER_NOINPUT */
        "#FC8814",              /* CWM_COLOR_BORDER_URGENCY */
        "blue",                 /* CWM_COLOR_BORDER_GROUP */
        "red",                  /* CWM_COLOR_BORDER_UNGROUP */
@@ -72,6 +73,7 @@ static const struct {
        { "window-maximize", kbfunc_client_toggle_maximize, CWM_CONTEXT_CC, 0 },
        { "window-vmaximize", kbfunc_client_toggle_vmaximize, CWM_CONTEXT_CC, 0 
},
        { "window-hmaximize", kbfunc_client_toggle_hmaximize, CWM_CONTEXT_CC, 0 
},
+       { "window-noinput", kbfunc_client_toggle_noinput, CWM_CONTEXT_CC, 0 },
        { "window-freeze", kbfunc_client_toggle_freeze, CWM_CONTEXT_CC, 0 },
        { "window-cycle", kbfunc_client_cycle, CWM_CONTEXT_SC,
            (CWM_CYCLE_FORWARD) },
diff --git a/app/cwm/cwmrc.5 b/app/cwm/cwmrc.5
index c044702e3..d62a03a7c 100644
--- a/app/cwm/cwmrc.5
+++ b/app/cwm/cwmrc.5
@@ -153,6 +153,9 @@ Set the color of the border while grouping a window.
 .Pp
 .It Ic color inactiveborder Ar color
 Set the color of the inactive border.
+.Ppa
+.It Ic color noinputborder Ar color
+Set the color of the noinput border.
 .Pp
 .It Ic color menubg Ar color
 Set menu background color.
@@ -330,6 +333,8 @@ Other windows in its group share remaining screen space.
 Current window is placed on the left of the screen, maximized vertically
 and resized to half of the horizontal screen space.
 Other windows in its group share remaining screen space.
+.It window-noinput
+Disable input to current window.
 .It window-move
 Move current window.
 .It window-resize
diff --git a/app/cwm/kbfunc.c b/app/cwm/kbfunc.c
index 5fa0c88e3..9d7ec738b 100644
--- a/app/cwm/kbfunc.c
+++ b/app/cwm/kbfunc.c
@@ -347,6 +347,12 @@ kbfunc_client_toggle_vmaximize(void *ctx, struct cargs 
*cargs)
        client_toggle_vmaximize(ctx);
 }
 
+void
+kbfunc_client_toggle_noinput(void *ctx, struct cargs *cargs)
+{
+       client_toggle_noinput(ctx);
+}
+
 void
 kbfunc_client_htile(void *ctx, struct cargs *cargs)
 {
diff --git a/app/cwm/parse.y b/app/cwm/parse.y
index e7eaf182e..d6ab5dc51 100644
--- a/app/cwm/parse.y
+++ b/app/cwm/parse.y
@@ -73,7 +73,7 @@ typedef struct {
 %token AUTOGROUP COMMAND IGNORE
 %token YES NO BORDERWIDTH MOVEAMOUNT
 %token COLOR SNAPDIST
-%token ACTIVEBORDER INACTIVEBORDER URGENCYBORDER
+%token ACTIVEBORDER INACTIVEBORDER URGENCYBORDER NOINPUTBORDER
 %token GROUPBORDER UNGROUPBORDER
 %token MENUBG MENUFG
 %token FONTCOLOR FONTSELCOLOR
@@ -236,6 +236,10 @@ colors             : ACTIVEBORDER STRING {
                        free(conf->color[CWM_COLOR_BORDER_URGENCY]);
                        conf->color[CWM_COLOR_BORDER_URGENCY] = $2;
                }
+               | NOINPUTBORDER STRING {
+                       free(conf->color[CWM_COLOR_BORDER_NOINPUT]);
+                       conf->color[CWM_COLOR_BORDER_NOINPUT] = $2;
+               }
                | GROUPBORDER STRING {
                        free(conf->color[CWM_COLOR_BORDER_GROUP]);
                        conf->color[CWM_COLOR_BORDER_GROUP] = $2;
@@ -317,6 +321,7 @@ lookup(char *s)
                { "unbind-mouse",       UNBINDMOUSE},
                { "ungroupborder",      UNGROUPBORDER},
                { "urgencyborder",      URGENCYBORDER},
+               { "noinputborder",      NOINPUTBORDER},
                { "yes",                YES}
        };
        const struct keywords   *p;

Reply via email to