Convert print_errf/dbgf in win.c and compton.c

And improve some of the log messages. Like, when compton exits because
of unsupported options, explain which options are causing compton to
quit.

Convert some debugging messages that are guarded behind ifdef's to log_trace,
so user don't need to re-compile to enabled them.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui
2018-12-20 02:49:29 +00:00
parent 185c0ce97c
commit 833eb966f1
6 changed files with 115 additions and 202 deletions

View File

@@ -4,7 +4,9 @@
#include <xcb/xcb.h>
#include <pixman.h>
#include <stdio.h>
#include "utils.h"
#include "log.h"
typedef struct pixman_region32 pixman_region32_t;
typedef struct pixman_box32 pixman_box32_t;
@@ -23,9 +25,9 @@ static inline void
dump_region(const region_t *x) {
int nrects;
const rect_t *rects = pixman_region32_rectangles((region_t *)x, &nrects);
fprintf(stderr, "nrects: %d\n", nrects);
log_trace("nrects: %d", nrects);
for (int i = 0; i < nrects; i++)
fprintf(stderr, "(%d, %d) - (%d, %d)\n", rects[i].x1, rects[i].y1, rects[i].x2, rects[i].y2);
log_trace("(%d, %d) - (%d, %d)", rects[i].x1, rects[i].y1, rects[i].x2, rects[i].y2);
}
/// Convert one xcb rectangle to our rectangle type