diff options
-rw-r--r-- | sys/dev/wscons/wsdisplay.c | 57 |
1 files changed, 29 insertions, 28 deletions
diff --git a/sys/dev/wscons/wsdisplay.c b/sys/dev/wscons/wsdisplay.c index e6d4e30e197..4a137396ad1 100644 --- a/sys/dev/wscons/wsdisplay.c +++ b/sys/dev/wscons/wsdisplay.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsdisplay.c,v 1.43 2002/04/30 23:01:55 mickey Exp $ */ +/* $OpenBSD: wsdisplay.c,v 1.44 2002/04/30 23:07:48 mickey Exp $ */ /* $NetBSD: wsdisplay.c,v 1.37.4.1 2000/06/30 16:27:53 simonb Exp $ */ /* @@ -109,17 +109,17 @@ struct wsscreen { struct wsdisplay_softc *sc; /* mouse console support via wsmoused(8) */ - unsigned short mouse; /* mouse cursor position */ + unsigned short mouse; /* mouse cursor position */ unsigned short cursor; /* selection cursor position (if different from mouse cursor pos) */ - unsigned short cpy_start; /* position of the copy start mark*/ + unsigned short cpy_start; /* position of the copy start mark*/ unsigned short cpy_end; /* position of the copy end mark */ unsigned short orig_start; /* position of the original sel. start*/ unsigned short orig_end; /* position of the original sel. end */ -#define MOUSE_VISIBLE (1 << 0) /* flag, the mouse cursor is visible */ -#define SEL_EXISTS (1 << 1) /* flag, a selection exists */ +#define MOUSE_VISIBLE (1 << 0) /* flag, the mouse cursor is visible */ +#define SEL_EXISTS (1 << 1) /* flag, a selection exists */ #define SEL_IN_PROGRESS (1 << 2) /* flag, a selection is in progress */ -#define SEL_EXT_AFTER (1 << 3) /* flag, selection is extended after */ +#define SEL_EXT_AFTER (1 << 3) /* flag, selection is extended after */ #define BLANK_TO_EOL (1 << 4) /* flag, there are only blanks characters to eol */ #define SEL_BY_CHAR (1 << 5) /* flag, select character by character*/ @@ -1088,16 +1088,16 @@ wsdisplay_internal_ioctl(sc, scr, cmd, data, flag, p) ((d == WSDISPLAYIO_MODE_DUMBFB) ? SCR_DUMBFB : 0); - /* - * wsmoused cohabitation with X-Window support - * X-Window is starting + /* + * wsmoused cohabitation with X-Window support + * X-Window is starting */ wsmoused_release(sc); } else { - /* - * wsmoused cohabitation with X-Window support - * X-Window is ending + /* + * wsmoused cohabitation with X-Window support + * X-Window is ending */ wsmoused_wakeup(sc); @@ -1737,6 +1737,7 @@ wsdisplay_switch(dev, no, waitok) int s, res = 0; struct wsscreen *scr; + if (no != WSDISPLAY_NULLSCREEN && (no < 0 || no >= WSDISPLAY_MAXSCREEN || !sc->sc_scr[no])) return (ENXIO); @@ -1767,23 +1768,23 @@ wsdisplay_switch(dev, no, waitok) sc->sc_oldscreen = sc->sc_focusidx; - /* - * wsmoused cohabitation with X-Window support - * + /* + * wsmoused cohabitation with X-Window support + * * Detect switch from a graphic to text console and vice-versa * This only happen when switching from X-Window to text mode and * switching back from text mode to X-Window. * * scr_flags is not yet flagged with SCR_GRAPHICS when X-Window starts * (KD_GRAPHICS ioctl happens after VT_ACTIVATE ioctl in - * xf86OpenPcvt()). Conversely, scr_flags is no longer flagged with + * xf86OpenPcvt()). Conversely, scr_flags is no longer flagged with * SCR_GRAPHICS when X-Window stops. In this case, the first of the - * three following 'if' statements is evaluated. + * three following 'if' statements is evaluated. * We handle wsmoused(8) events the WSDISPLAYIO_SMODE ioctl. * */ - if (!(scr->scr_flags & SCR_GRAPHICS) && + if (!(scr->scr_flags & SCR_GRAPHICS) && (!(sc->sc_scr[no]->scr_flags & SCR_GRAPHICS))) { /* switching from a text console to another text console */ /* XXX evaluated when the X-server starts or stops, see above */ @@ -1792,7 +1793,7 @@ wsdisplay_switch(dev, no, waitok) mouse_remove(sc); } - if (!(scr->scr_flags & SCR_GRAPHICS) && + if (!(scr->scr_flags & SCR_GRAPHICS) && (sc->sc_scr[no]->scr_flags & SCR_GRAPHICS)) { /* switching from a text console to a graphic console */ @@ -1801,7 +1802,7 @@ wsdisplay_switch(dev, no, waitok) wsmoused_release(sc); } - if ((scr->scr_flags & SCR_GRAPHICS) && + if ((scr->scr_flags & SCR_GRAPHICS) && !(sc->sc_scr[no]->scr_flags & SCR_GRAPHICS)) { /* switching from a graphic console to a text console */ @@ -2292,10 +2293,10 @@ ctrl_event(u_int type, int value, struct wsdisplay_softc *ws_sc, struct proc *p) if (type == WSCONS_EVENT_WSMOUSED_SLEEP) { /* sleeping until next switch to text mode */ ws_sc->wsmoused_sleep = 1; - while (ws_sc->wsmoused_sleep && error == 0) + while (ws_sc->wsmoused_sleep && error == 0) error = tsleep(&ws_sc->wsmoused_sleep, PPAUSE, "wsmoused_sleep", 0); - if (error) + if (error) return error; else return (0); @@ -2454,7 +2455,7 @@ skip_spc_left(void) * Stolen from xterm sources of the Xfree project (see cvs tag below) * $TOG: button.c /main/76 1997/07/30 16:56:19 kaleb $ */ -static int charClass[256] = { +static const int charClass[256] = { /* NUL SOH STX ETX EOT ENQ ACK BEL */ 32, 1, 1, 1, 1, 1, 1, 1, /* BS HT NL VT NP CR SO SI */ @@ -2600,7 +2601,7 @@ mouse_copy_start(void) if (!IS_MOUSE_VISIBLE(sc->sc_focus)) inverse_char(MOUSE); - CPY_START = MOUSE; + CPY_START = MOUSE; CPY_END = MOUSE; ORIG_START = CPY_START; ORIG_END = CPY_END; @@ -2864,7 +2865,7 @@ mouse_copy_extend_word(void) } else { old_cpy_end = CPY_END; CPY_END = MOUSE + skip_char_right(MOUSE); - if (CPY_END != old_cpy_end) { + if (CPY_END != old_cpy_end) { /* reducing selection, from the end of * next word */ inverse_region(CPY_END + 1, @@ -3181,7 +3182,7 @@ wsmoused_release(struct wsdisplay_softc *sc) /* obtain major of /dev/wsmouse{0..n} devices */ if (wsmouse_cd.cd_ndevs > 0) { - if (cdevsw[major(sc->wsmoused_dev)].d_open == + if (cdevsw[major(sc->wsmoused_dev)].d_open == wsmouseopen) is_wsmouse = 1; } @@ -3189,7 +3190,7 @@ wsmoused_release(struct wsdisplay_softc *sc) if (is_wsmouse && (minor(sc->wsmoused_dev) <= NWSMOUSE)) { /* /dev/wsmouseX case */ if (minor(sc->wsmoused_dev) <= wsmouse_cd.cd_ndevs) { - wsms_dev = + wsms_dev = wsms_dev_list[minor(sc->wsmoused_dev)]; } else @@ -3198,7 +3199,7 @@ wsmoused_release(struct wsdisplay_softc *sc) } /* inject event to notify wsmoused(8) to close mouse device */ - wsmouse_input(wsms_dev, 0, 0, 0, 0, + wsmouse_input(wsms_dev, 0, 0, 0, 0, WSMOUSE_INPUT_WSMOUSED_CLOSE); } #endif /* NWSMOUSE > 0 */ |