Skip to content

Commit

Permalink
debug: disable win_serialise()
Browse files Browse the repository at this point in the history
Make win_serialise() build conditional.
It's occasionally useful, but it's quite verbose.
  • Loading branch information
flatcap committed Mar 28, 2022
1 parent 40d8d5c commit 1cbc9af
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions debug/window.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
#include "gui/lib.h"
#include "lib.h"

// #define DEBUG_SHOW_SERIALISE

static struct MuttWindow *win_focus = NULL;

static const char *win_size(const struct MuttWindow *win)
Expand Down Expand Up @@ -72,6 +74,7 @@ static void win_dump(struct MuttWindow *win, int indent)
}
}

#ifdef DEBUG_SHOW_SERIALISE
static void win_serialise(struct MuttWindow *win, struct Buffer *buf)
{
if (!mutt_window_is_visible(win))
Expand All @@ -87,16 +90,19 @@ static void win_serialise(struct MuttWindow *win, struct Buffer *buf)
}
mutt_buffer_addstr(buf, ">");
}
#endif

void debug_win_dump(void)
{
win_focus = window_get_focus();
mutt_debug(LL_DEBUG1, "\n");
win_dump(RootWindow, 0);
mutt_debug(LL_DEBUG1, "\n");
#ifdef DEBUG_SHOW_SERIALISE
struct Buffer buf = mutt_buffer_make(1024);
win_serialise(RootWindow, &buf);
mutt_debug(LL_DEBUG1, "%s\n", mutt_buffer_string(&buf));
mutt_buffer_dealloc(&buf);
#endif
win_focus = NULL;
}

0 comments on commit 1cbc9af

Please sign in to comment.