summaryrefslogtreecommitdiff
path: root/hw/xfree86/common
diff options
context:
space:
mode:
authorPovilas Kanapickas <povilas@radix.lt>2020-09-17 00:55:17 +0300
committerAdam Jackson <ajax@nwnk.net>2020-09-24 17:33:22 +0000
commit5eb985e3531b69d3ddc4dc0d4b69b4280b1626f8 (patch)
treea9a646d3f3b20ea250f36d61f79f0e619f0ebe17 /hw/xfree86/common
parenta5f439dcd21b4fda093cb382bb1a758b434a1444 (diff)
mi: Add a callback to notify driver about input event submission
This is useful for mock input drivers that control the server in integration tests. Given that input submission happens on a different thread than processing, it's otherwise impossible for the driver to synchronize with the completion of the processing of submitted events. Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
Diffstat (limited to 'hw/xfree86/common')
-rw-r--r--hw/xfree86/common/xf86Helper.c14
-rw-r--r--hw/xfree86/common/xf86Xinput.h5
2 files changed, 19 insertions, 0 deletions
diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index 6bdbf7c15..31aa068e0 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -39,6 +39,7 @@
#endif
#include <X11/X.h>
+#include "mi.h"
#include "os.h"
#include "servermd.h"
#include "pixmapstr.h"
@@ -1738,3 +1739,16 @@ xf86UpdateDesktopDimensions(void)
{
update_desktop_dimensions();
}
+
+
+void
+xf86AddInputEventDrainCallback(CallbackProcPtr callback, void *param)
+{
+ mieqAddCallbackOnDrained(callback, param);
+}
+
+void
+xf86RemoveInputEventDrainCallback(CallbackProcPtr callback, void *param)
+{
+ mieqRemoveCallbackOnDrained(callback, param);
+}
diff --git a/hw/xfree86/common/xf86Xinput.h b/hw/xfree86/common/xf86Xinput.h
index 0024053c7..749a80d4b 100644
--- a/hw/xfree86/common/xf86Xinput.h
+++ b/hw/xfree86/common/xf86Xinput.h
@@ -199,6 +199,11 @@ xf86VIDrvMsgVerb(InputInfoPtr dev,
MessageType type, int verb, const char *format, va_list args)
_X_ATTRIBUTE_PRINTF(4, 0);
+extern _X_EXPORT void xf86AddInputEventDrainCallback(CallbackProcPtr callback,
+ void *param);
+extern _X_EXPORT void xf86RemoveInputEventDrainCallback(CallbackProcPtr callback,
+ void *param);
+
/* xf86Option.c */
extern _X_EXPORT void
xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts);