static Key keys[] = {
/* modifier key function argument */
{ 0, XK_F1, spawn, {.v = dmenucmd } },
- { 0, XK_F2, spawn, {.v = termcmd } },
+ { 0, XK_F2, kbspawn, {.v = termcmd } },
{ MODKEY, XK_b, togglebar, {0} },
{ MODKEY, XK_n, focusstack, {.i = +1 } },
{ MODKEY, XK_h, focusstack, {.i = 0 } },
static void setup(void);
static void showhide(Client *c);
static void sigchld(int unused);
+static void kbspawn(const Arg *arg);
static void spawn(const Arg *arg);
static void tag(const Arg *arg);
static void tagmon(const Arg *arg);
if(!XGetWindowAttributes(dpy, ev->window, &wa))
return;
- if(wa.override_redirect)
+ if(wa.override_redirect) {
+ key_buffer_len = 0;
+ key_buffering = False;
return;
+ }
if(!wintoclient(ev->window))
manage(ev->window, &wa);
}
}
void
+kbspawn(const Arg *arg) {
+ key_buffering = True;
+ key_buffer_len = 0;
+ grab_typing_keys();
+ spawn(arg);
+}
+
+void
spawn(const Arg *arg) {
int tag = 0, i;
if(arg->v == termcmd) {
}
if(arg->v == dmenucmd)
dmenumon[0] = '0' + selmon->num;
- key_buffering = True;
- key_buffer_len = 0;
- grab_typing_keys();
if(fork() == 0) {
if(dpy)
close(ConnectionNumber(dpy));