X-Git-Url: https://jasonwoof.com/gitweb/?p=dwm.git;a=blobdiff_plain;f=dwm.c;h=7b017cbcfa756b616c7a086710382f98a95bd344;hp=dc9f31800a171d738ae9be2844622a024f66ec04;hb=6857120180bace35d1bc88b0a298e61ef5fbe8d6;hpb=9e9918ad967382660aea6bd7e9634f5995de04e0 diff --git a/dwm.c b/dwm.c index dc9f318..7b017cb 100644 --- a/dwm.c +++ b/dwm.c @@ -211,6 +211,7 @@ static void setmfact(const Arg *arg); 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); @@ -1269,8 +1270,11 @@ maprequest(XEvent *e) { 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); } @@ -1795,6 +1799,14 @@ sigchld(int unused) { } 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) { @@ -1809,9 +1821,6 @@ spawn(const Arg *arg) { } 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));