1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-22 15:47:37 +00:00

Use statndard (syscons) way to disable bell.

Testesd by:	markj

Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Aleksandr Rybalko 2013-12-25 19:07:14 +00:00
parent 6a1456ccc2
commit 650c134f19
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=259882
2 changed files with 12 additions and 0 deletions

View File

@ -135,6 +135,7 @@ struct vt_device {
#define VDF_DEAD 0x10 /* Early probing found nothing. */
#define VDF_INITIALIZED 0x20 /* vtterm_cnprobe already done. */
#define VDF_MOUSECURSOR 0x40 /* Mouse cursor visible. */
#define VDF_QUIET_BELL 0x80 /* Disable bell. */
int vd_keyboard; /* (G) Keyboard index. */
unsigned int vd_kbstate; /* (?) Device unit. */
unsigned int vd_unit; /* (c) Device unit. */

View File

@ -589,6 +589,11 @@ vt_allocate_keyboard(struct vt_device *vd)
static void
vtterm_bell(struct terminal *tm)
{
struct vt_window *vw = tm->tm_softc;
struct vt_device *vd = vw->vw_device;
if (vd->vd_flags & VDF_QUIET_BELL)
return;
sysbeep(1193182 / VT_BELLPITCH, VT_BELLDURATION);
}
@ -1505,6 +1510,12 @@ vtterm_ioctl(struct terminal *tm, u_long cmd, caddr_t data,
/* XXX */
*(int *)data = M_CG640x480;
return (0);
case CONS_BELLTYPE: /* set bell type sound */
if ((*(int *)data) & CONS_QUIET_BELL)
vd->vd_flags |= VDF_QUIET_BELL;
else
vd->vd_flags &= ~VDF_QUIET_BELL;
return (0);
case CONS_GETINFO: {
vid_info_t *vi = (vid_info_t *)data;