gaps improvements

This commit is contained in:
Nate Symer 2018-07-12 11:51:25 -04:00
parent abcc2ef9eb
commit 8fdf85fee0
128 changed files with 1670 additions and 2718 deletions

View file

@ -46,7 +46,7 @@ static void swaybar_output_free(struct swaybar_output *output) {
if (!output) {
return;
}
wlr_log(WLR_DEBUG, "Removing output %s", output->name);
wlr_log(L_DEBUG, "Removing output %s", output->name);
zwlr_layer_surface_v1_destroy(output->layer_surface);
wl_surface_destroy(output->surface);
wl_output_destroy(output->output);

View file

@ -31,7 +31,7 @@ static bool i3bar_parse_json(struct status_line *status, const char *text) {
status_error(status, "[failed to parse i3bar json]");
return false;
}
wlr_log(WLR_DEBUG, "Got i3bar json: '%s'", text);
wlr_log(L_DEBUG, "Got i3bar json: '%s'", text);
for (size_t i = 0; i < json_object_array_length(results); ++i) {
json_object *full_text, *short_text, *color, *min_width, *align, *urgent;
json_object *name, *instance, *separator, *separator_block_width;
@ -193,7 +193,7 @@ bool i3bar_handle_readable(struct status_line *status) {
void i3bar_block_send_click(struct status_line *status,
struct i3bar_block *block, int x, int y, uint32_t button) {
wlr_log(WLR_DEBUG, "block %s clicked", block->name ? block->name : "(nil)");
wlr_log(L_DEBUG, "block %s clicked", block->name ? block->name : "(nil)");
if (!block->name || !status->i3bar_state.click_events) {
return;
}

View file

@ -327,7 +327,7 @@ bool handle_ipc_readable(struct swaybar *bar) {
json_object *result = json_tokener_parse(resp->payload);
if (!result) {
free_ipc_response(resp);
wlr_log(WLR_ERROR, "failed to parse payload as json");
wlr_log(L_ERROR, "failed to parse payload as json");
return false;
}
json_object *json_change, *json_pango_markup;
@ -340,7 +340,7 @@ bool handle_ipc_readable(struct swaybar *bar) {
bar->config->mode = strdup(change);
}
} else {
wlr_log(WLR_ERROR, "failed to parse response");
wlr_log(L_ERROR, "failed to parse response");
json_object_put(result);
free_ipc_response(resp);
return false;

View file

@ -75,13 +75,13 @@ int main(int argc, char **argv) {
}
if (debug) {
wlr_log_init(WLR_DEBUG, NULL);
wlr_log_init(L_DEBUG, NULL);
} else {
wlr_log_init(WLR_ERROR, NULL);
wlr_log_init(L_ERROR, NULL);
}
if (!bar_id) {
wlr_log(WLR_ERROR, "No bar_id passed. "
wlr_log(L_ERROR, "No bar_id passed. "
"Provide --bar_id or let sway start swaybar");
return 1;
}
@ -89,7 +89,7 @@ int main(int argc, char **argv) {
if (!socket_path) {
socket_path = get_socketpath();
if (!socket_path) {
wlr_log(WLR_ERROR, "Unable to retrieve socket path");
wlr_log(L_ERROR, "Unable to retrieve socket path");
return 1;
}
}

View file

@ -298,8 +298,7 @@ static uint32_t render_binding_mode_indicator(cairo_t *cairo,
int text_width, text_height;
get_text_size(cairo, config->font, &text_width, &text_height,
output->scale, config->mode_pango_markup,
"%s", mode);
output->scale, config->pango_markup, "%s", mode);
int ws_vertical_padding = WS_VERTICAL_PADDING * output->scale;
int ws_horizontal_padding = WS_HORIZONTAL_PADDING * output->scale;
@ -330,7 +329,7 @@ static uint32_t render_binding_mode_indicator(cairo_t *cairo,
double text_y = height / 2.0 - text_height / 2.0;
cairo_set_source_u32(cairo, config->colors.binding_mode.text);
cairo_move_to(cairo, x + width / 2 - text_width / 2, (int)floor(text_y));
pango_printf(cairo, config->font, output->scale, config->mode_pango_markup,
pango_printf(cairo, config->font, output->scale, config->pango_markup,
"%s", mode);
return surface_height;
}
@ -497,7 +496,7 @@ void render_frame(struct swaybar *bar, struct swaybar_output *output) {
// different height than what we asked for
wl_surface_commit(output->surface);
wl_display_roundtrip(bar->display);
} else if (height > 0) {
} else {
// Replay recording into shm and send it off
output->current_buffer = get_next_buffer(bar->shm,
output->buffers,

View file

@ -49,14 +49,14 @@ bool status_handle_readable(struct status_line *status) {
json_object *version;
if (json_object_object_get_ex(proto, "version", &version)
&& json_object_get_int(version) == 1) {
wlr_log(WLR_DEBUG, "Switched to i3bar protocol.");
wlr_log(L_DEBUG, "Switched to i3bar protocol.");
status->protocol = PROTOCOL_I3BAR;
}
json_object *click_events;
if (json_object_object_get_ex(
proto, "click_events", &click_events)
&& json_object_get_boolean(click_events)) {
wlr_log(WLR_DEBUG, "Enabled click events.");
wlr_log(L_DEBUG, "Enabled click events.");
status->i3bar_state.click_events = true;
const char *events_array = "[\n";
ssize_t len = strlen(events_array);
@ -91,7 +91,7 @@ struct status_line *status_line_init(char *cmd) {
int pipe_read_fd[2];
int pipe_write_fd[2];
if (pipe(pipe_read_fd) != 0 || pipe(pipe_write_fd) != 0) {
wlr_log(WLR_ERROR, "Unable to create pipes for status_command fork");
wlr_log(L_ERROR, "Unable to create pipes for status_command fork");
exit(1);
}