fbpad: do not redraw the whole screen if it was already visible
authorAli Gholami Rudi <ali@rudi.ir>
Thu, 19 Sep 2013 05:33:01 +0000 (19 10:03 +0430)
committerAli Gholami Rudi <ali@rudi.ir>
Thu, 19 Sep 2013 05:42:08 +0000 (19 10:12 +0430)
fbpad.c
term.c

diff --git a/fbpad.c b/fbpad.c
index 5bd90ef..81f1fc7 100644 (file)
--- a/fbpad.c
+++ b/fbpad.c
@@ -89,8 +89,9 @@ static void switchterm(int oidx, int nidx, int show, int save, int load)
                scr_snap(&terms[oidx]);
        term_save(&terms[oidx]);
        term_load(&terms[nidx], show);
-       if (load)
-               term_redraw(!TERMOPEN(nidx) || !TERMSNAP(nidx) || scr_load(&terms[nidx]));
+       if (show)
+               term_redraw(load && (!TERMOPEN(nidx) || !TERMSNAP(nidx) ||
+                                       scr_load(&terms[nidx])));
 }
 
 static void showterm(int n)
diff --git a/term.c b/term.c
index 416329d..f24315d 100644 (file)
--- a/term.c
+++ b/term.c
@@ -359,7 +359,8 @@ void term_redraw(int all)
                }
                lazy_flush();
        } else {
-               pad_blank(0);
+               if (all)
+                       pad_blank(0);
        }
 }