diff --git a/cmd/wmii.rc.rc b/cmd/wmii.rc.rc index befb82c0..5432f163 100755 --- a/cmd/wmii.rc.rc +++ b/cmd/wmii.rc.rc @@ -141,10 +141,14 @@ fn wi_seltag { wmiir read /tag/sel/ctl | sed 1q } +fn wi_readevent { + wmiir read /event +} + fn wi_eventloop { wi_initkeys - wmiir read /event | + wi_readevent | while(ifs=$wi_nl{wi_event=`{read}}) { ifs=$wi_nl{ wi_arg=`{echo $wi_event | sed 's/^[^ ]+ //'}} diff --git a/cmd/wmii/main.c b/cmd/wmii/main.c index 2ecf1a62..0ffedd91 100644 --- a/cmd/wmii/main.c +++ b/cmd/wmii/main.c @@ -287,8 +287,6 @@ spawn_command(const char *cmd) { if(doublefork() == 0) { if(setsid() == -1) fatal("Can't setsid: %r"); - /* Was closeexeced, but Xlib-xcb doesn't like it. */ - close(ConnectionNumber(display)); shell = passwd->pw_shell; if(shell[0] != '/') @@ -370,10 +368,7 @@ main(int argc, char *argv[]) { sock = ixp_announce(address); if(sock < 0) fatal("Can't create socket '%s': %r", address); - /* Grr! Xlib-xcb doesn't like this in the least. - * And I thought XF86 Xlib was bad... *sigh* closeexec(ConnectionNumber(display)); - */ closeexec(sock); if(wmiirc)