diff --git a/src/draw.c b/src/draw.c index c213fc97..21f288b8 100644 --- a/src/draw.c +++ b/src/draw.c @@ -775,6 +775,7 @@ void draw_temp_symbol(int what, GC gc, int n,int layer,short tmp_flip, short rot xctx->inst[n].xx2 + xoffset, xctx->inst[n].yy2 + yoffset); } if(fix_broken) { /* do a copyArea on first layer only. Faster. */ + symbol_bbox(n, &xctx->inst[n].x1, &xctx->inst[n].y1, &xctx->inst[n].x2, &xctx->inst[n].y2); MyXCopyAreaDouble(display, xctx->save_pixmap, xctx->window, xctx->gc[0], xctx->inst[n].x1 + xoffset, xctx->inst[n].y1 + yoffset, xctx->inst[n].x2 + xoffset, xctx->inst[n].y2 + yoffset, diff --git a/src/main.c b/src/main.c index 88527cd0..0d6a180c 100644 --- a/src/main.c +++ b/src/main.c @@ -71,6 +71,10 @@ static void child_handler(int signum) int main(int argc, char **argv) { int i; + #ifdef __unix__ + int stdin_is_a_fifo = 0; + struct stat statbuf; + #endif Display *display; signal(SIGINT, sig_handler); signal(SIGSEGV, sig_handler); @@ -97,8 +101,13 @@ int main(int argc, char **argv) argc = process_options(argc, argv); #ifdef __unix__ - /* if invoked in background detach from console */ - if(getpgrp() != tcgetpgrp(STDOUT_FILENO) && !cli_opt_no_readline) { + /* if invoked in background (and not invoked from a command pipeline) detach from console */ + + if(!fstat(0, &statbuf)) { + if(statbuf.st_mode & S_IFIFO) stdin_is_a_fifo = 1; /* input coming from a command pipe */ + } + + if(!stdin_is_a_fifo && getpgrp() != tcgetpgrp(STDOUT_FILENO) && !cli_opt_no_readline) { cli_opt_detach = 1; } #endif