From f6578248c066d29b6b9ff06a057046fbf09e6545 Mon Sep 17 00:00:00 2001 From: Johan Malm Date: Thu, 18 Jun 2020 20:39:55 +0100 Subject: [PATCH] src/keybind.c: move keybind_print() to dbg.c --- include/labwc.h | 1 + src/config/keybind.c | 10 ---------- src/config/rcxml.c | 4 +--- src/debug/dbg.c | 11 +++++++++++ src/output.c | 1 - src/theme/theme.c | 3 +-- 6 files changed, 14 insertions(+), 16 deletions(-) diff --git a/include/labwc.h b/include/labwc.h index 8011cdd9..f8202fcc 100644 --- a/include/labwc.h +++ b/include/labwc.h @@ -182,5 +182,6 @@ void action(struct server *server, struct keybind *keybind); void dbg_show_one_view(struct view *view); void dbg_show_views(struct server *server); +void dbg_show_keybinds(); #endif /* LABWC_H */ diff --git a/src/config/keybind.c b/src/config/keybind.c index e6764dae..81f53c01 100644 --- a/src/config/keybind.c +++ b/src/config/keybind.c @@ -60,13 +60,3 @@ void keybind_init() keybind_add(&rc.keybinds, "A-Tab", "NextWindow"); keybind_add(&rc.keybinds, "A-F3", "Execute"); } - -void keybind_print() -{ - struct keybind *keybind; - wl_list_for_each_reverse (keybind, &rc.keybinds, link) { - printf("KEY=%s-", keybind->action); - for (size_t i = 0; i < keybind->keysyms_len; i++) - printf(" %d\n", keybind->keysyms[i]); - } -} diff --git a/src/config/rcxml.c b/src/config/rcxml.c index 27417869..3efb15e7 100644 --- a/src/config/rcxml.c +++ b/src/config/rcxml.c @@ -168,7 +168,6 @@ void rcxml_init() LIBXML_TEST_VERSION wl_list_init(&rc.keybinds); keybind_init(); - keybind_print(); } void rcxml_read(const char *filename) @@ -176,7 +175,6 @@ void rcxml_read(const char *filename) FILE *stream; char *line = NULL; size_t len = 0; - ssize_t n_read; struct buf b; /* Read into buffer and then call rcxml_parse_xml() */ @@ -186,7 +184,7 @@ void rcxml_read(const char *filename) return; } buf_init(&b); - while ((n_read = getline(&line, &len, stream) != -1)) { + while (getline(&line, &len, stream) != -1) { char *p = strrchr(line, '\n'); if (p) *p = '\0'; diff --git a/src/debug/dbg.c b/src/debug/dbg.c index 86a65cea..0da3ffd9 100644 --- a/src/debug/dbg.c +++ b/src/debug/dbg.c @@ -1,4 +1,5 @@ #include "labwc.h" +#include "rcxml.h" static void show_one_xdg_view(struct view *view) { @@ -72,3 +73,13 @@ void dbg_show_views(struct server *server) wl_list_for_each_reverse (view, &server->views, link) dbg_show_one_view(view); } + +void dbg_show_keybinds() +{ + struct keybind *keybind; + wl_list_for_each_reverse (keybind, &rc.keybinds, link) { + printf("KEY=%s-", keybind->action); + for (size_t i = 0; i < keybind->keysyms_len; i++) + printf(" %d\n", keybind->keysyms[i]); + } +} diff --git a/src/output.c b/src/output.c index dd62bc4e..a668b8f7 100644 --- a/src/output.c +++ b/src/output.c @@ -51,7 +51,6 @@ static void render_decorations(struct wlr_output *output, struct view *view) draw_rect(&ddata, deco_box(view, LAB_DECO_PART_BOTTOM)); draw_rect(&ddata, deco_box(view, LAB_DECO_PART_LEFT)); - if (view_hasfocus(view)) ddata.rgba = theme.window_active_title_bg_color; else diff --git a/src/theme/theme.c b/src/theme/theme.c index f9951e85..8a44cf4f 100644 --- a/src/theme/theme.c +++ b/src/theme/theme.c @@ -85,14 +85,13 @@ void theme_read(const char *filename) FILE *stream; char *line = NULL; size_t len = 0; - ssize_t n_read; stream = fopen(filename, "r"); if (!stream) { fprintf(stderr, "warn: cannot read '%s'\n", filename); return; } - while ((n_read = getline(&line, &len, stream) != -1)) { + while (getline(&line, &len, stream) != -1) { char *p = strrchr(line, '\n'); if (p) *p = '\0'; -- 2.52.0