some minor fixes

This commit is contained in:
kolunmi 2023-03-05 13:44:57 -07:00
parent 6236d01e15
commit fbb2b67ba2

33
dwlb.c
View File

@ -172,8 +172,8 @@ struct Seat {
static int sock_fd; static int sock_fd;
static char socketdir[256]; static char socketdir[256];
static char *socketpath = NULL; static char *socketpath;
static char sockbuf[768]; static char sockbuf[4096];
static char *stdinbuf; static char *stdinbuf;
static size_t stdinbuf_cap; static size_t stdinbuf_cap;
@ -187,13 +187,13 @@ static struct wl_cursor_image *cursor_image;
static struct wl_surface *cursor_surface; static struct wl_surface *cursor_surface;
static struct znet_tapesoftware_dwl_wm_v1 *dwl_wm; static struct znet_tapesoftware_dwl_wm_v1 *dwl_wm;
static char **tags = NULL; static char **tags;
static uint32_t tags_l, tags_c; static uint32_t tags_l, tags_c;
static char **layouts = NULL; static char **layouts;
static uint32_t layouts_l, layouts_c; static uint32_t layouts_l, layouts_c;
static Bar *bar_list = NULL; static Bar *bar_list;
static Seat *seat_list = NULL; static Seat *seat_list;
static struct fcft_font *font; static struct fcft_font *font;
static uint32_t height; static uint32_t height;
@ -279,11 +279,9 @@ draw_text(char *text,
if (colors[color_ind].bg) { if (colors[color_ind].bg) {
if (draw_bg) if (draw_bg)
cur_bg_color = &colors[color_ind].color; cur_bg_color = &colors[color_ind].color;
} else { } else if (draw_fg) {
if (draw_fg) { pixman_image_unref(fg_fill);
pixman_image_unref(fg_fill); fg_fill = pixman_image_create_solid_fill(&colors[color_ind].color);
fg_fill = pixman_image_create_solid_fill(&colors[color_ind].color);
}
} }
color_ind++; color_ind++;
} }
@ -1654,8 +1652,7 @@ main(int argc, char **argv)
/* Load selected font */ /* Load selected font */
fcft_init(FCFT_LOG_COLORIZE_AUTO, 0, FCFT_LOG_CLASS_ERROR); fcft_init(FCFT_LOG_COLORIZE_AUTO, 0, FCFT_LOG_CLASS_ERROR);
fcft_set_scaling_filter(FCFT_SCALING_FILTER_LANCZOS3); fcft_set_scaling_filter(FCFT_SCALING_FILTER_LANCZOS3);
font = fcft_from_name(1, (const char *[]) {fontstr}, NULL); if (!(font = fcft_from_name(1, (const char *[]) {fontstr}, NULL)))
if (!font)
DIE("Could not load font"); DIE("Could not load font");
textpadding = font->height / 2; textpadding = font->height / 2;
height = font->height + vertical_padding * 2; height = font->height + vertical_padding * 2;
@ -1732,17 +1729,17 @@ main(int argc, char **argv)
free(tags[i]); free(tags[i]);
free(tags); free(tags);
} }
DL_FOREACH_SAFE(bar_list, bar, bar2)
teardown_bar(bar);
DL_FOREACH_SAFE(seat_list, seat, seat2)
teardown_seat(seat);
zwlr_layer_shell_v1_destroy(layer_shell); zwlr_layer_shell_v1_destroy(layer_shell);
zxdg_output_manager_v1_destroy(output_manager); zxdg_output_manager_v1_destroy(output_manager);
if (ipc) if (ipc)
znet_tapesoftware_dwl_wm_v1_destroy(dwl_wm); znet_tapesoftware_dwl_wm_v1_destroy(dwl_wm);
DL_FOREACH_SAFE(bar_list, bar, bar2)
teardown_bar(bar);
DL_FOREACH_SAFE(seat_list, seat, seat2)
teardown_seat(seat);
fcft_destroy(font); fcft_destroy(font);
fcft_fini(); fcft_fini();