summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Campbell <aaron@cvs.openbsd.org>2001-02-08 02:47:13 +0000
committerAaron Campbell <aaron@cvs.openbsd.org>2001-02-08 02:47:13 +0000
commitc693318dd78e5cc3dbae4ca18679b5860a526180 (patch)
tree84dbd979e0c8b3b13c56caa5b9d2d7cc18ceb2eb
parent43b87b68212dadba31a6933a3dbcf8aa809ce28d (diff)
Cause keypresses to reset the screen in case we are in scrollback (previously
the screen was only restored if a new character was actually displayed on the screen); jcs@rt.fm. This brings us closer to the behavior of PCVT. Also, while I'm here, add some #ifdef so wskbd does not depend on wsdisplay (pointed out to me by fgsch@).
-rw-r--r--sys/dev/ic/vga.c8
-rw-r--r--sys/dev/wscons/wsdisplay.c12
-rw-r--r--sys/dev/wscons/wsdisplayvar.h7
-rw-r--r--sys/dev/wscons/wskbd.c34
4 files changed, 42 insertions, 19 deletions
diff --git a/sys/dev/ic/vga.c b/sys/dev/ic/vga.c
index c2d59fb6e47..b0eb9df1092 100644
--- a/sys/dev/ic/vga.c
+++ b/sys/dev/ic/vga.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vga.c,v 1.16 2001/01/31 16:38:00 aaron Exp $ */
+/* $OpenBSD: vga.c,v 1.17 2001/02/08 02:47:10 aaron Exp $ */
/* $NetBSD: vga.c,v 1.28.2.1 2000/06/30 16:27:47 simonb Exp $ */
/*
@@ -913,8 +913,12 @@ vga_scrollback(v, cookie, lines)
struct vgascreen *scr = cookie;
struct vga_handle *vh = &vc->hdl;
- if (lines == 0)
+ if (lines == 0) {
+ if (scr->pcs.visibleoffset == scr->pcs.dispoffset)
+ return;
+
scr->pcs.visibleoffset = scr->pcs.dispoffset; /* reset */
+ }
else {
int vga_scr_end;
int margin = scr->pcs.type->ncols * 2;
diff --git a/sys/dev/wscons/wsdisplay.c b/sys/dev/wscons/wsdisplay.c
index 8cf700dd3bf..cc09b6a34af 100644
--- a/sys/dev/wscons/wsdisplay.c
+++ b/sys/dev/wscons/wsdisplay.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsdisplay.c,v 1.9 2000/11/23 16:13:42 aaron Exp $ */
+/* $OpenBSD: wsdisplay.c,v 1.10 2001/02/08 02:47:11 aaron Exp $ */
/* $NetBSD: wsdisplay.c,v 1.37.4.1 2000/06/30 16:27:53 simonb Exp $ */
/*
@@ -1811,9 +1811,13 @@ wsscrollback(arg, op)
struct wsdisplay_softc *sc = arg;
int lines;
- lines = sc->sc_focus->scr_dconf->scrdata->nrows - 1;
- if (op == WSCONS_SCROLL_BACKWARD)
- lines = -lines;
+ if (op == WSDISPLAY_SCROLL_RESET)
+ lines = 0;
+ else {
+ lines = sc->sc_focus->scr_dconf->scrdata->nrows - 1;
+ if (op == WSDISPLAY_SCROLL_BACKWARD)
+ lines = -lines;
+ }
if (sc->sc_accessops->scrollback) {
(*sc->sc_accessops->scrollback)(sc->sc_accesscookie,
diff --git a/sys/dev/wscons/wsdisplayvar.h b/sys/dev/wscons/wsdisplayvar.h
index fdd4cec4c65..8eeba2a65a3 100644
--- a/sys/dev/wscons/wsdisplayvar.h
+++ b/sys/dev/wscons/wsdisplayvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsdisplayvar.h,v 1.5 2001/01/31 16:38:02 aaron Exp $ */
+/* $OpenBSD: wsdisplayvar.h,v 1.6 2001/02/08 02:47:12 aaron Exp $ */
/* $NetBSD: wsdisplayvar.h,v 1.14.4.1 2000/06/30 16:27:53 simonb Exp $ */
/*
@@ -205,5 +205,6 @@ void wsdisplay_switchtoconsole __P((void));
*/
void wsscrollback __P((void *, int op));
-#define WSCONS_SCROLL_BACKWARD 0
-#define WSCONS_SCROLL_FORWARD 1
+#define WSDISPLAY_SCROLL_BACKWARD 0
+#define WSDISPLAY_SCROLL_FORWARD 1
+#define WSDISPLAY_SCROLL_RESET 2
diff --git a/sys/dev/wscons/wskbd.c b/sys/dev/wscons/wskbd.c
index 4c4167493e1..ed4422e18d8 100644
--- a/sys/dev/wscons/wskbd.c
+++ b/sys/dev/wscons/wskbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wskbd.c,v 1.6 2001/01/30 17:33:20 aaron Exp $ */
+/* $OpenBSD: wskbd.c,v 1.7 2001/02/08 02:47:12 aaron Exp $ */
/* $NetBSD: wskbd.c,v 1.38 2000/03/23 07:01:47 thorpej Exp $ */
/*
@@ -522,14 +522,16 @@ wskbd_detach(self, flags)
#if NWSMUX > 0
int mux;
+ mux = sc->sc_dv.dv_cfdata->wskbddevcf_mux;
+ if (mux != WSKBDDEVCF_MUX_DEFAULT)
+ wsmux_detach(mux, &sc->sc_dv);
+#endif
+
+#if NWSDISPLAY > 0
if (sc->sc_repeating) {
sc->sc_repeating = 0;
timeout_del(&sc->sc_repeat_ch);
}
-
- mux = sc->sc_dv.dv_cfdata->wskbddevcf_mux;
- if (mux != WSKBDDEVCF_MUX_DEFAULT)
- wsmux_detach(mux, &sc->sc_dv);
#endif
evar = &sc->sc_events;
@@ -584,9 +586,15 @@ wskbd_input(dev, type, value)
num = wskbd_translate(sc->id, type, value);
if (num > 0) {
if (sc->sc_displaydv != NULL) {
- for (i = 0; i < num; i++)
- wsdisplay_kbdinput(sc->sc_displaydv,
- sc->id->t_symbols[i]);
+ /* XXX - Shift_R+PGUP(release) emits PrtSc */
+ if (sc->id->t_symbols[0] != KS_Print_Screen) {
+ wsscrollback(sc->sc_displaydv,
+ WSDISPLAY_SCROLL_RESET);
+ }
+ for (i = 0; i < num; i++) {
+ wsdisplay_kbdinput(sc->sc_displaydv,
+ sc->id->t_symbols[i]);
+ }
}
sc->sc_repeating = num;
@@ -1304,13 +1312,15 @@ internal_command(sc, type, ksym)
switch (ksym) {
case KS_Cmd_ScrollBack:
if (MOD_ONESET(sc->id, MOD_ANYSHIFT)) {
- wsscrollback(sc->sc_displaydv, WSCONS_SCROLL_BACKWARD);
+ wsscrollback(sc->sc_displaydv,
+ WSDISPLAY_SCROLL_BACKWARD);
return (1);
}
case KS_Cmd_ScrollFwd:
if (MOD_ONESET(sc->id, MOD_ANYSHIFT)) {
- wsscrollback(sc->sc_displaydv, WSCONS_SCROLL_FORWARD);
+ wsscrollback(sc->sc_displaydv,
+ WSDISPLAY_SCROLL_FORWARD);
return (1);
}
}
@@ -1445,6 +1455,7 @@ wskbd_translate(id, type, value)
#endif
}
+#if NWSDISPLAY > 0
if (sc != NULL && sc->sc_repeating) {
if ((type == WSCONS_EVENT_KEY_UP && value != sc->sc_repkey) ||
(type == WSCONS_EVENT_KEY_DOWN && value == sc->sc_repkey))
@@ -1458,6 +1469,9 @@ kbrep:
}
if (sc != NULL)
sc->sc_repkey = value;
+#else
+kbrep:
+#endif
/* If this is a key release or we are in command mode, we are done */
if (type != WSCONS_EVENT_KEY_DOWN || iscommand) {