mirror of
https://github.com/kolunmi/dwlb.git
synced 2025-10-27 18:24:42 +00:00
fix hanging when tag is empty
This commit is contained in:
parent
bdfee2104f
commit
1149930689
10
dwlb.c
10
dwlb.c
@ -209,8 +209,6 @@ static uint32_t height, textpadding, buffer_scale;
|
|||||||
|
|
||||||
static bool run_display;
|
static bool run_display;
|
||||||
|
|
||||||
static char *last_logged_title = NULL;
|
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1222,7 +1220,6 @@ read_stdin(void)
|
|||||||
if (!(bar->window_title = strdup(wordend)))
|
if (!(bar->window_title = strdup(wordend)))
|
||||||
EDIE("strdup");
|
EDIE("strdup");
|
||||||
bar->redraw = true;
|
bar->redraw = true;
|
||||||
last_logged_title = strdup(wordend);
|
|
||||||
} else if (!strcmp(wordbeg, "selmon")) {
|
} else if (!strcmp(wordbeg, "selmon")) {
|
||||||
ADVANCE();
|
ADVANCE();
|
||||||
if ((val = atoi(wordbeg)) != bar->sel) {
|
if ((val = atoi(wordbeg)) != bar->sel) {
|
||||||
@ -1552,11 +1549,10 @@ read_socket(void)
|
|||||||
hide_bar(bar);
|
hide_bar(bar);
|
||||||
}
|
}
|
||||||
} else if (!strcmp(wordbeg, "printinfo")) {
|
} else if (!strcmp(wordbeg, "printinfo")) {
|
||||||
const char *info = last_logged_title ? last_logged_title : "(none)";
|
const char *info = (bar->window_title && bar->window_title[0] != '\0') ? bar->window_title : "(none)";
|
||||||
ssize_t len = strlen(info);
|
if (send(cli_fd, info, strlen(info), 0) == -1) {
|
||||||
if (send(cli_fd, info, len, 0) != len) {
|
|
||||||
perror("send");
|
perror("send");
|
||||||
}
|
}
|
||||||
} else if (!strcmp(wordbeg, "toggle-visibility")) {
|
} else if (!strcmp(wordbeg, "toggle-visibility")) {
|
||||||
if (all) {
|
if (all) {
|
||||||
wl_list_for_each(bar, &bar_list, link)
|
wl_list_for_each(bar, &bar_list, link)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user