All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Weil <weil@mail.berlios.de>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel][Patch] qemu console.c
Date: Sat, 27 Jan 2007 19:30:22 +0100	[thread overview]
Message-ID: <45BB9A3E.4090404@mail.berlios.de> (raw)
In-Reply-To: <E1H6xK8-00014t-Nc@savannah.gnu.org>

[-- Attachment #1: Type: text/plain, Size: 352 bytes --]


> CVSROOT: /sources/qemu
> Module name: qemu
> Changes by: Thiemo Seufer <ths> 07/01/16 23:02:36
>
> Modified files:
> . : console.c
>
> Log message:
> Improved console handling, thanks Stefan Weil.
Here are two additional smaller changes for console.c.
They fix cursor display at end of line and line wrapping.

Please add them to CVS HEAD.

Stefan


[-- Attachment #2: console.patch --]
[-- Type: text/plain, Size: 2155 bytes --]

Index: console.c
===================================================================
RCS file: /sources/qemu/qemu/console.c,v
retrieving revision 1.10
diff -u -b -B -w -u -r1.10 console.c
--- console.c	16 Jan 2007 23:02:36 -0000	1.10
+++ console.c	27 Jan 2007 15:41:01 -0000
@@ -536,21 +536,24 @@
     int y, y1;
 
     if (s == active_console) {
+        int x = s->x;
+        if (x >= s->width) {
+            x = s->width - 1;
+        }
         y1 = (s->y_base + s->y) % s->total_height;
         y = y1 - s->y_displayed;
         if (y < 0)
             y += s->total_height;
         if (y < s->height) {
-            c = &s->cells[y1 * s->width + s->x];
+            c = &s->cells[y1 * s->width + x];
             if (show) {
                 TextAttributes t_attrib = s->t_attrib_default;
                 t_attrib.invers = !(t_attrib.invers); /* invert fg and bg */
-                vga_putcharxy(s->ds, s->x, y, c->ch, &t_attrib);
+                vga_putcharxy(s->ds, x, y, c->ch, &t_attrib);
             } else {
-                vga_putcharxy(s->ds, s->x, y, c->ch, 
-                              &(c->t_attrib));
+                vga_putcharxy(s->ds, x, y, c->ch, &(c->t_attrib));
             }
-            dpy_update(s->ds, s->x * FONT_WIDTH, y * FONT_HEIGHT, 
+            dpy_update(s->ds, x * FONT_WIDTH, y * FONT_HEIGHT, 
                        FONT_WIDTH, FONT_HEIGHT);
         }
     }
@@ -799,8 +802,10 @@
             s->state = TTY_STATE_ESC;
             break;
         default:
-            if (s->x >= s->width - 1) {
-                break;
+            if (s->x >= s->width) {
+                /* line wrap */
+                s->x = 0;
+                console_put_lf(s);
             }
             y1 = (s->y_base + s->y) % s->total_height;
             c = &s->cells[y1 * s->width + s->x];
@@ -808,12 +813,6 @@
             c->t_attrib = s->t_attrib;
             update_xy(s, s->x, s->y);
             s->x++;
-#if 0 /* line wrap disabled */
-            if (s->x >= s->width) {
-                s->x = 0;
-                console_put_lf(s);
-            }
-#endif
             break;
         }
         break;

  reply	other threads:[~2007-01-27 18:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-16 23:02 [Qemu-devel] qemu console.c Thiemo Seufer
2007-01-27 18:30 ` Stefan Weil [this message]
2007-02-03  2:12   ` [Qemu-devel][Patch] " Thiemo Seufer
2007-02-06 19:14     ` Stefan Weil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45BB9A3E.4090404@mail.berlios.de \
    --to=weil@mail.berlios.de \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.