Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F115741406
D30542.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D30542.diff
View Options
diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c
--- a/sys/dev/atkbdc/psm.c
+++ b/sys/dev/atkbdc/psm.c
@@ -5111,6 +5111,10 @@
break;
}
+ /* Store last packet for reinjection if it has not been set already */
+ if (timevalisset(&sc->idletimeout) && sc->idlepacket.inputbytes == 0)
+ sc->idlepacket = *pb;
+
#ifdef EVDEV_SUPPORT
if (evdev_rcpt_mask & EVDEV_RCPT_HW_MOUSE &&
sc->hw.model != MOUSE_MODEL_ELANTECH &&
@@ -5144,6 +5148,10 @@
evdev_push_mouse_btn(sc->evdev_r, ms.button);
evdev_sync(sc->evdev_r);
}
+
+ if ((sc->evdev_a != NULL && evdev_is_grabbed(sc->evdev_a)) ||
+ (sc->evdev_r != NULL && evdev_is_grabbed(sc->evdev_r)))
+ goto next;
#endif
/* scale values */
@@ -5164,10 +5172,6 @@
}
}
- /* Store last packet for reinjection if it has not been set already */
- if (timevalisset(&sc->idletimeout) && sc->idlepacket.inputbytes == 0)
- sc->idlepacket = *pb;
-
ms.dx = x;
ms.dy = y;
ms.dz = z;
diff --git a/sys/dev/evdev/evdev.h b/sys/dev/evdev/evdev.h
--- a/sys/dev/evdev/evdev.h
+++ b/sys/dev/evdev/evdev.h
@@ -154,6 +154,7 @@
int evdev_set_report_size(struct evdev_dev *, size_t);
void evdev_set_flag(struct evdev_dev *, uint16_t);
void *evdev_get_softc(struct evdev_dev *);
+bool evdev_is_grabbed(struct evdev_dev *);
/* Multitouch related functions: */
int evdev_mt_id_to_slot(struct evdev_dev *, int32_t);
diff --git a/sys/dev/evdev/evdev.c b/sys/dev/evdev/evdev.c
--- a/sys/dev/evdev/evdev.c
+++ b/sys/dev/evdev/evdev.c
@@ -1094,6 +1094,17 @@
return (0);
}
+bool
+evdev_is_grabbed(struct evdev_dev *evdev)
+{
+ /*
+ * The function is intended to be called from evdev-unrelated parts of
+ * code like syscons-compatible parts of mouse and keyboard drivers.
+ * That makes unlocked read-only access acceptable.
+ */
+ return (evdev->ev_grabber != NULL);
+}
+
static void
evdev_repeat_callout(void *arg)
{
diff --git a/sys/dev/syscons/sysmouse.c b/sys/dev/syscons/sysmouse.c
--- a/sys/dev/syscons/sysmouse.c
+++ b/sys/dev/syscons/sysmouse.c
@@ -295,6 +295,8 @@
#ifdef EVDEV_SUPPORT
smdev_evdev_write(x, y, z, mouse_status.button);
+ if (evdev_is_grabbed(sysmouse_evdev))
+ goto done;
#endif
if (!tty_opened(sysmouse_tty))
diff --git a/sys/dev/usb/input/ums.c b/sys/dev/usb/input/ums.c
--- a/sys/dev/usb/input/ums.c
+++ b/sys/dev/usb/input/ums.c
@@ -875,6 +875,10 @@
{
uint8_t buf[8];
+#ifdef EVDEV_SUPPORT
+ if (evdev_is_grabbed(sc->sc_evdev))
+ return;
+#endif
if (1) {
if (dx > 254)
dx = 254;
diff --git a/sys/dev/vt/vt_sysmouse.c b/sys/dev/vt/vt_sysmouse.c
--- a/sys/dev/vt/vt_sysmouse.c
+++ b/sys/dev/vt/vt_sysmouse.c
@@ -249,6 +249,8 @@
#ifdef EVDEV_SUPPORT
sysmouse_evdev_store(x, y, z, sysmouse_status.button);
+ if (evdev_is_grabbed(sysmouse_evdev))
+ goto done;
#endif
/* The first five bytes are compatible with MouseSystems. */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Apr 28, 11:54 PM (10 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17834975
Default Alt Text
D30542.diff (2 KB)
Attached To
Mode
D30542: evdev: Extend EVIOCGRAB ioctl scope to cover kbd/sysmouse interfaces
Attached
Detach File
Event Timeline
Log In to Comment