X-Git-Url: https://code.delx.au/spectrwm/blobdiff_plain/6b0c4d149311ff3ce8a79e23e78e80f4a936bf0e..0fb39f91df94ac144f7364259225214d773e1b7f:/spectrwm.c diff --git a/spectrwm.c b/spectrwm.c index 37b0d2e..f68e08b 100644 --- a/spectrwm.c +++ b/spectrwm.c @@ -3712,7 +3712,16 @@ spawn(int ws_idx, union arg *args, bool close_fd) close(xcb_get_file_descriptor(conn)); - setenv("LD_PRELOAD", SWM_LIB, 1); + if ((ret = getenv("LD_PRELOAD"))) { + if (asprintf(&ret, "%s:%s", SWM_LIB, ret) == -1) { + warn("spawn: asprintf LD_PRELOAD"); + _exit(1); + } + setenv("LD_PRELOAD", ret, 1); + free(ret); + } else { + setenv("LD_PRELOAD", SWM_LIB, 1); + } if (asprintf(&ret, "%d", ws_idx) == -1) { warn("spawn: asprintf SWM_WS"); @@ -4135,6 +4144,10 @@ set_region(struct swm_region *r) r->s->r_focus = r; + /* Update the focus window frame on the now unfocused region. */ + if (rf && rf->ws->focus) + draw_frame(rf->ws->focus); + ewmh_update_current_desktop(); }