You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by jm...@apache.org on 2017/01/31 18:13:29 UTC

[1/2] incubator-guacamole-server git commit: GUACAMOLE-193: Take character attributes into account when testing for visibility.

Repository: incubator-guacamole-server
Updated Branches:
  refs/heads/master d831a4b9d -> 09c493b39


GUACAMOLE-193: Take character attributes into account when testing for visibility.


Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/commit/fc6f3615
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/tree/fc6f3615
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/diff/fc6f3615

Branch: refs/heads/master
Commit: fc6f36150f7163048238ba432eccef8895423ac5
Parents: d831a4b
Author: Michael Jumper <mj...@apache.org>
Authored: Mon Jan 30 22:00:29 2017 -0800
Committer: Michael Jumper <mj...@apache.org>
Committed: Mon Jan 30 22:39:49 2017 -0800

----------------------------------------------------------------------
 src/terminal/terminal.c | 45 +++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 42 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/fc6f3615/src/terminal/terminal.c
----------------------------------------------------------------------
diff --git a/src/terminal/terminal.c b/src/terminal/terminal.c
index 5057123..849b7ed 100644
--- a/src/terminal/terminal.c
+++ b/src/terminal/terminal.c
@@ -847,6 +847,45 @@ int guac_terminal_clear_range(guac_terminal* term,
 
 }
 
+/**
+ * Returns whether the given character would be visible relative to the
+ * background of the given terminal.
+ *
+ * @param term
+ *     The guac_terminal to test the character against.
+ *
+ * @param c
+ *     The character being tested.
+ *
+ * @return
+ *     true if the given character is different from the terminal background,
+ *     false otherwise.
+ */
+static bool guac_terminal_is_visible(guac_terminal* term,
+        guac_terminal_char* c) {
+
+    /* Continuation characters are NEVER visible */
+    if (c->value == GUAC_CHAR_CONTINUATION)
+        return false;
+
+    /* Characters with glyphs are ALWAYS visible */
+    if (guac_terminal_has_glyph(c->value))
+        return true;
+
+    int background;
+
+    /* Determine actual background color of character */
+    if (c->attributes.reverse != c->attributes.cursor)
+        background = c->attributes.foreground;
+    else
+        background = c->attributes.background;
+
+    /* Blank characters are visible if their background color differs from that
+     * of the terminal */
+    return background != term->default_char.attributes.background;
+
+}
+
 void guac_terminal_scroll_display_down(guac_terminal* terminal,
         int scroll_amount) {
 
@@ -893,7 +932,7 @@ void guac_terminal_scroll_display_down(guac_terminal* terminal,
         for (column=0; column<buffer_row->length; column++) {
 
             /* Only draw if not blank */
-            if (guac_terminal_has_glyph(current->value))
+            if (guac_terminal_is_visible(terminal, current))
                 guac_terminal_display_set_columns(terminal->display, dest_row, column, column, current);
 
             current++;
@@ -955,7 +994,7 @@ void guac_terminal_scroll_display_up(guac_terminal* terminal,
         for (column=0; column<buffer_row->length; column++) {
 
             /* Only draw if not blank */
-            if (guac_terminal_has_glyph(current->value))
+            if (guac_terminal_is_visible(terminal, current))
                 guac_terminal_display_set_columns(terminal->display, dest_row, column, column, current);
 
             current++;
@@ -1230,7 +1269,7 @@ static void __guac_terminal_redraw_rect(guac_terminal* term, int start_row, int
 
             /* Only redraw if not blank */
             guac_terminal_char* c = &(buffer_row->characters[col]);
-            if (guac_terminal_has_glyph(c->value))
+            if (guac_terminal_is_visible(term, c))
                 guac_terminal_display_set_columns(term->display, row, col, col, c);
 
         }


[2/2] incubator-guacamole-server git commit: GUACAMOLE-193: Merge fix for whitespace background color.

Posted by jm...@apache.org.
GUACAMOLE-193: Merge fix for whitespace background color.


Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/commit/09c493b3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/tree/09c493b3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/diff/09c493b3

Branch: refs/heads/master
Commit: 09c493b39c1c10e400ef4067fba3f555bdd54424
Parents: d831a4b fc6f361
Author: James Muehlner <ja...@guac-dev.org>
Authored: Mon Jan 30 23:31:01 2017 -0800
Committer: James Muehlner <ja...@guac-dev.org>
Committed: Mon Jan 30 23:31:01 2017 -0800

----------------------------------------------------------------------
 src/terminal/terminal.c | 45 +++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 42 insertions(+), 3 deletions(-)
----------------------------------------------------------------------