diff options
Diffstat (limited to 'src/dwm.c')
| -rw-r--r-- | src/dwm.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -316,7 +316,13 @@ DwmIpc *dwm_create(State *state, const char *socket) GSocketAddress *addr = g_unix_socket_address_new(socket); if (!g_socket_connect(dwm->socket, addr, NULL, &error)) { g_assert_nonnull(error); - log_error("Failed to connect to %s: %s", socket, error->message); + log_debug("Failed to connect socket %s: %s", socket, error->message); + log_info("Skipped dwm ipc [socket=%s]", socket); + + g_error_free(error); + g_object_unref(dwm->socket); + g_free(dwm); + return NULL; } dwm->source = g_socket_create_source(dwm->socket, G_IO_IN, NULL); @@ -335,7 +341,7 @@ DwmIpc *dwm_create(State *state, const char *socket) ipc_subscribe(dwm, events[i]); g_source_attach(dwm->source, NULL); - log_debug("Attached dwm ipc source"); + log_info("Attached dwm ipc source [socket=%s]", socket); return dwm; } @@ -359,6 +365,8 @@ static void change_tag_action(Button *btn) void dwm_register_tags(DwmIpc *dwm, Color color, Color selected, Color text_color, Color line_color) { + if (dwm == NULL) return; + dwm->color = color; dwm->text_color = text_color; dwm->selected = selected; @@ -378,6 +386,8 @@ void dwm_register_tags(DwmIpc *dwm, Color color, Color selected, Color text_colo void dwm_destroy(DwmIpc *dwm) { + if (dwm == NULL) return; + g_source_destroy(dwm->source); g_source_unref(dwm->source); g_object_unref(dwm->socket); |
