Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Jan 2009 22:16:31 +0100
From:      Ed Schouten <ed@80386.nl>
To:        Michiel Boland <michiel@boland.org>
Cc:        FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Re: console oddities
Message-ID:  <20090128211631.GW17198@hoeg.nl>
In-Reply-To: <20090128211416.GV17198@hoeg.nl>
References:  <4980C766.50207@boland.org> <20090128211416.GV17198@hoeg.nl>

next in thread | previous in thread | raw e-mail | index | archive | help

--XCIqNWEteo88hZlY
Content-Type: multipart/mixed; boundary="doUn1Hmx68n+7ij2"
Content-Disposition: inline


--doUn1Hmx68n+7ij2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

* Ed Schouten <ed@80386.nl> wrote:
> Can you try the attached patch?

Obviously I forgot to add the attachment.

--=20
 Ed Schouten <ed@80386.nl>
 WWW: http://80386.nl/

--doUn1Hmx68n+7ij2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="syscons.diff"
Content-Transfer-Encoding: quoted-printable

Index: syscons.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- syscons.c	(revision 187835)
+++ syscons.c	(working copy)
@@ -2635,6 +2635,19 @@
 }
=20
 static void
+sc_sync_cursorpos(scr_stat *scp, int col, int row)
+{
+
+    if (col >=3D scp->xsize)
+	col =3D 0;
+    if (row >=3D scp->ysize)
+	row =3D scp->ysize - 1;
+    scp->xpos =3D col;
+    scp->ypos =3D row;
+    scp->cursor_pos =3D scp->cursor_oldpos =3D row*scp->xsize + col;
+}
+
+static void
 scinit(int unit, int flags)
 {
=20
@@ -2743,13 +2756,7 @@
 			(void *)sc_buffer, FALSE);
=20
 	    /* move cursors to the initial positions */
-	    if (col >=3D scp->xsize)
-		col =3D 0;
-	    if (row >=3D scp->ysize)
-		row =3D scp->ysize - 1;
-	    scp->xpos =3D col;
-	    scp->ypos =3D row;
-	    scp->cursor_pos =3D scp->cursor_oldpos =3D row*scp->xsize + col;
+	    sc_sync_cursorpos(scp, col, row);
=20
 	    if (sc_init_emulator(scp, SC_DFLT_TERM))
 		sc_init_emulator(scp, "*");
@@ -2763,6 +2770,9 @@
 	    sc->dev[0] =3D sc_alloc_tty(0, "ttyv%r", unit * MAXCONS);
 	    scp =3D alloc_scp(sc, sc->first_vty);
 	    SC_STAT(sc->dev[0]) =3D scp;
+
+	    /* move cursors to the initial positions */
+	    sc_sync_cursorpos(scp, col, row);
 	}
 	sc->cur_scp =3D scp;
=20

--doUn1Hmx68n+7ij2--

--XCIqNWEteo88hZlY
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEARECAAYFAkmAyy8ACgkQ52SDGA2eCwX2NQCffmRxz+hf2OChXl3FSg/11/yF
nhEAn0srAqJ7JGtKhaqxXyY8N4FylQ1p
=6xjE
-----END PGP SIGNATURE-----

--XCIqNWEteo88hZlY--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090128211631.GW17198>