X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=spectrwm.c;h=8bdecf16e41fd9ab7fd800a97a87df5f3b50c50b;hb=e18f7c05ed1d3400a9368267ec73b4d1999243db;hp=20adaa4d8471b58f9de6081b87d27122055c4305;hpb=2594aa6939354b420ea38eeb5cc419a9dfd86a2f;p=spectrwm.git diff --git a/spectrwm.c b/spectrwm.c index 20adaa4..8bdecf1 100644 --- a/spectrwm.c +++ b/spectrwm.c @@ -1822,8 +1822,8 @@ bar_toggle(struct swm_region *r, union arg *args) void bar_refresh(void) { - XSetWindowAttributes wa; struct swm_region *r; + uint32_t wa[2]; int i, num_screens; /* do this here because the conf file is in memory */ @@ -1855,18 +1855,15 @@ bar_refresh(void) } } - bzero(&wa, sizeof wa); num_screens = xcb_setup_roots_length(xcb_get_setup(conn)); for (i = 0; i < num_screens; i++) TAILQ_FOREACH(r, &screens[i].rl, entry) { if (r->bar == NULL) continue; - wa.border_pixel = - screens[i].c[SWM_S_COLOR_BAR_BORDER].color; - wa.background_pixel = - screens[i].c[SWM_S_COLOR_BAR].color; - XChangeWindowAttributes(display, r->bar->id, - CWBackPixel | CWBorderPixel, &wa); + wa[0] = screens[i].c[SWM_S_COLOR_BAR].color; + wa[1] = screens[i].c[SWM_S_COLOR_BAR_BORDER].color; + xcb_change_window_attributes(conn, r->bar->id, + XCB_CW_BACK_PIXEL | XCB_CW_BORDER_PIXEL, wa); } bar_update(); } @@ -2207,7 +2204,6 @@ restart(struct swm_region *r, union arg *args) bar_extra_stop(); bar_extra = 1; unmap_all(); - xcb_disconnect(conn); XCloseDisplay(display); execvp(start_argv[0], start_argv); warn("execvp failed");