Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/wscons If no screen got the "focus" (which happens w...
details: https://anonhg.NetBSD.org/src/rev/0d1cb9c43457
branches: trunk
changeset: 467350:0d1cb9c43457
user: drochner <drochner%NetBSD.org@localhost>
date: Tue Mar 23 15:56:56 1999 +0000
description:
If no screen got the "focus" (which happens with serial console or if
the current screen is deleted), automatically give focus to the next
screen created. Saves the need to switch to a usable screen manually.
diffstat:
sys/dev/wscons/wsdisplay.c | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diffs (43 lines):
diff -r ef4cf0036d04 -r 0d1cb9c43457 sys/dev/wscons/wsdisplay.c
--- a/sys/dev/wscons/wsdisplay.c Tue Mar 23 15:55:43 1999 +0000
+++ b/sys/dev/wscons/wsdisplay.c Tue Mar 23 15:56:56 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wsdisplay.c,v 1.21 1999/03/13 14:46:20 drochner Exp $ */
+/* $NetBSD: wsdisplay.c,v 1.22 1999/03/23 15:56:56 drochner Exp $ */
/*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@@ -33,7 +33,7 @@
static const char _copyright[] __attribute__ ((unused)) =
"Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.";
static const char _rcsid[] __attribute__ ((unused)) =
- "$NetBSD: wsdisplay.c,v 1.21 1999/03/13 14:46:20 drochner Exp $";
+ "$NetBSD: wsdisplay.c,v 1.22 1999/03/23 15:56:56 drochner Exp $";
#include <sys/param.h>
#include <sys/conf.h>
@@ -319,6 +319,7 @@
int ccol, crow;
long defattr;
struct wsscreen *scr;
+ int s;
if (idx < 0 || idx >= WSDISPLAY_MAXSCREEN)
return (EINVAL);
@@ -348,6 +349,16 @@
if (WSSCREEN_HAS_EMULATOR(scr))
printf(", %s emulation", scr->scr_dconf->wsemul->name);
printf(")\n");
+
+ /* if no screen has focus yet, activate the first we get */
+ s = spltty();
+ if (!sc->sc_focus) {
+ (*sc->sc_accessops->show_screen)(sc->sc_accesscookie,
+ scr->scr_dconf->emulcookie);
+ sc->sc_focusidx = idx;
+ sc->sc_focus = scr;
+ }
+ splx(s);
return (0);
}
Home |
Main Index |
Thread Index |
Old Index