[PATCH xserver 10/25] xnest: Use SetNotifyFd to receive events

Keith Packard keithp at keithp.com
Wed May 25 05:38:47 UTC 2016


Signed-off-by: Keith Packard <keithp at keithp.com>
---
 hw/xnest/Init.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/hw/xnest/Init.c b/hw/xnest/Init.c
index bec2c51..e8a700e 100644
--- a/hw/xnest/Init.c
+++ b/hw/xnest/Init.c
@@ -35,6 +35,7 @@ is" without express or implied warranty.
 #include "Pointer.h"
 #include "Keyboard.h"
 #include "Handlers.h"
+#include "Events.h"
 #include "Init.h"
 #include "Args.h"
 #include "Drawable.h"
@@ -86,6 +87,12 @@ InitOutput(ScreenInfo * screen_info, int argc, char *argv[])
     xnestDoFullGeneration = xnestFullGeneration;
 }
 
+static void
+xnestNotifyConnection(int fd, int ready, void *data)
+{
+    xnestCollectEvents();
+}
+
 void
 InitInput(int argc, char *argv[])
 {
@@ -101,7 +108,7 @@ InitInput(int argc, char *argv[])
 
     mieqInit();
 
-    AddEnabledDevice(XConnectionNumber(xnestDisplay));
+    SetNotifyFd(XConnectionNumber(xnestDisplay), xnestNotifyConnection, X_NOTIFY_READ, NULL);
 
     RegisterBlockAndWakeupHandlers(xnestBlockHandler, xnestWakeupHandler, NULL);
 }
-- 
2.8.0.rc3



More information about the xorg-devel mailing list