[Midnightbsd-cvs] src [8779] trunk/sys/dev/syscons/syscons.c: Make sure that all mouse buttons are released when clients using /dev/consolectl close.
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sun Sep 25 23:02:57 EDT 2016
Revision: 8779
http://svnweb.midnightbsd.org/src/?rev=8779
Author: laffer1
Date: 2016-09-25 23:02:56 -0400 (Sun, 25 Sep 2016)
Log Message:
-----------
Make sure that all mouse buttons are released when clients using /dev/consolectl close.
Modified Paths:
--------------
trunk/sys/dev/syscons/syscons.c
Modified: trunk/sys/dev/syscons/syscons.c
===================================================================
--- trunk/sys/dev/syscons/syscons.c 2016-09-26 03:02:19 UTC (rev 8778)
+++ trunk/sys/dev/syscons/syscons.c 2016-09-26 03:02:56 UTC (rev 8779)
@@ -1,4 +1,4 @@
-/* $MidnightBSD: src/sys/dev/syscons/syscons.c,v 1.14 2012/02/16 23:14:25 laffer1 Exp $ */
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1992-1998 S\xF8ren Schmidt
* All rights reserved.
@@ -250,11 +250,13 @@
};
static d_ioctl_t consolectl_ioctl;
+static d_close_t consolectl_close;
static struct cdevsw consolectl_devsw = {
.d_version = D_VERSION,
- .d_flags = D_NEEDGIANT,
+ .d_flags = D_NEEDGIANT | D_TRACKCLOSE,
.d_ioctl = consolectl_ioctl,
+ .d_close = consolectl_close,
.d_name = "consolectl",
};
@@ -1558,6 +1560,23 @@
return sctty_ioctl(dev->si_drv1, cmd, data, td);
}
+static int
+consolectl_close(struct cdev *dev, int flags, int mode, struct thread *td)
+{
+#ifndef SC_NO_SYSMOUSE
+ mouse_info_t info;
+ memset(&info, 0, sizeof(info));
+ info.operation = MOUSE_ACTION;
+
+ /*
+ * Make sure all buttons are released when moused and other
+ * console daemons exit, so that no buttons are left pressed.
+ */
+ (void) sctty_ioctl(dev->si_drv1, CONS_MOUSECTL, (caddr_t)&info, td);
+#endif
+ return (0);
+}
+
static void
sc_cnprobe(struct consdev *cp)
{
More information about the Midnightbsd-cvs
mailing list