From 981282bb564bdc9c2a60e9f94d262deb1b418bcc Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Wed, 11 Dec 2013 17:30:48 +0100 Subject: [PATCH] GWIN console visible bug fix --- releases.txt | 1 + src/gwin/console.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/releases.txt b/releases.txt index e5336c79..3b0f617f 100644 --- a/releases.txt +++ b/releases.txt @@ -8,6 +8,7 @@ FEATURE: Add support for edge to edge touch calibration. FEATURE: Added progressbar widget FEATURE: Added gdispGDrawThickLine() by user jpa- DEPRECATE: TDISP module removed +FIX: Console does not execute gwinPrintf() anymore if not visible *** changes after 1.9 *** diff --git a/src/gwin/console.c b/src/gwin/console.c index 1be18662..7966b6ff 100644 --- a/src/gwin/console.c +++ b/src/gwin/console.c @@ -90,6 +90,9 @@ void gwinPutChar(GHandle gh, char c) { #define gcw ((GConsoleObject *)gh) uint8_t width, fy, fp; + if (!gwinGetVisible(gh)) + return; + if (gh->vmt != &consoleVMT || !gh->font) return; @@ -147,11 +150,17 @@ void gwinPutChar(GHandle gh, char c) { } void gwinPutString(GHandle gh, const char *str) { + if (!gwinGetVisible(gh)) + return; + while(*str) gwinPutChar(gh, *str++); } void gwinPutCharArray(GHandle gh, const char *str, size_t n) { + if (!gwinGetVisible(gh)) + return; + while(n--) gwinPutChar(gh, *str++); } @@ -211,6 +220,9 @@ void gwinPrintf(GHandle gh, const char *fmt, ...) { char tmpbuf[MAX_FILLER + 1]; #endif + if (!gwinGetVisible(gh)) + return; + if (gh->vmt != &consoleVMT || !gh->font) return;